Compare commits

...

9 Commits

Author SHA1 Message Date
137fec122b Add torjus to input group
All checks were successful
pre-commit / pre-commit (push) Successful in 2m10s
2024-03-09 20:31:42 +01:00
229a6b13b5 Improve backup script 2024-03-09 20:31:31 +01:00
0726d674cc Remove mumble ptt from hyprland conf 2024-03-09 20:31:18 +01:00
79234d0f5b Add zsh plugins 2024-03-08 18:14:22 +01:00
d14c058a4c Update nixpkgs and nixpkgs-unstable 2024-03-08 15:42:01 +01:00
b335e10809 Improve vscode setup 2024-03-08 15:35:55 +01:00
e9fe2227f3 More logging for backup-home 2024-03-07 15:17:32 +01:00
5f013e9a5e Add nmap 2024-03-07 15:01:55 +01:00
fb712795ea Add notlistener 2024-03-07 04:00:22 +01:00
10 changed files with 101 additions and 18 deletions

50
flake.lock generated
View File

@ -23,11 +23,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1709569716, "lastModified": 1709677081,
"narHash": "sha256-iOR44RU4jQ+YPGrn+uQeYAp7Xo7Z/+gT+wXJoGxxLTY=", "narHash": "sha256-tix36Y7u0rkn6mTm0lA45b45oab2cFLqAzDbJxeXS+c=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "617579a787259b9a6419492eaac670a5f7663917", "rev": "880992dcc006a5e00dd0591446fdf723e6a51a64",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -55,11 +55,11 @@
}, },
"nixpkgs-unstable": { "nixpkgs-unstable": {
"locked": { "locked": {
"lastModified": 1709479366, "lastModified": 1709703039,
"narHash": "sha256-n6F0n8UV6lnTZbYPl1A9q1BS0p4hduAv1mGAP17CVd0=", "narHash": "sha256-6hqgQ8OK6gsMu1VtcGKBxKQInRLHtzulDo9Z5jxHEFY=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "b8697e57f10292a6165a20f03d2f42920dfaf973", "rev": "9df3e30ce24fd28c7b3e2de0d986769db5d6225d",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -70,6 +70,22 @@
} }
}, },
"nixpkgs_2": { "nixpkgs_2": {
"locked": {
"lastModified": 1709479366,
"narHash": "sha256-n6F0n8UV6lnTZbYPl1A9q1BS0p4hduAv1mGAP17CVd0=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "b8697e57f10292a6165a20f03d2f42920dfaf973",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_3": {
"locked": { "locked": {
"lastModified": 1709356872, "lastModified": 1709356872,
"narHash": "sha256-mvxCirJbtkP0cZ6ABdwcgTk0u3bgLoIoEFIoYBvD6+4=", "narHash": "sha256-mvxCirJbtkP0cZ6ABdwcgTk0u3bgLoIoEFIoYBvD6+4=",
@ -85,17 +101,37 @@
"type": "github" "type": "github"
} }
}, },
"notlistener": {
"inputs": {
"nixpkgs": "nixpkgs_2"
},
"locked": {
"lastModified": 1709780344,
"narHash": "sha256-ZwM8Buys5t9WS1sooMsGgMnR1vRsTmazCrCu5UL24dQ=",
"ref": "master",
"rev": "129eea14a4e43de1c21510134cdd0fa84fce5b80",
"revCount": 6,
"type": "git",
"url": "https://git.t-juice.club/torjus/notlistener"
},
"original": {
"ref": "master",
"type": "git",
"url": "https://git.t-juice.club/torjus/notlistener"
}
},
"root": { "root": {
"inputs": { "inputs": {
"home-manager": "home-manager", "home-manager": "home-manager",
"nixpkgs": "nixpkgs", "nixpkgs": "nixpkgs",
"nixpkgs-unstable": "nixpkgs-unstable", "nixpkgs-unstable": "nixpkgs-unstable",
"notlistener": "notlistener",
"sops-nix": "sops-nix" "sops-nix": "sops-nix"
} }
}, },
"sops-nix": { "sops-nix": {
"inputs": { "inputs": {
"nixpkgs": "nixpkgs_2", "nixpkgs": "nixpkgs_3",
"nixpkgs-stable": "nixpkgs-stable" "nixpkgs-stable": "nixpkgs-stable"
}, },
"locked": { "locked": {

View File

@ -10,9 +10,10 @@
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
sops-nix.url = "github:Mic92/sops-nix"; sops-nix.url = "github:Mic92/sops-nix";
notlistener.url = "git+https://git.t-juice.club/torjus/notlistener?ref=master";
}; };
outputs = { self, nixpkgs, nixpkgs-unstable, sops-nix, ... }@inputs: outputs = { self, nixpkgs, nixpkgs-unstable, sops-nix, notlistener, ... }@inputs:
let let
system = "x86_64-linux"; system = "x86_64-linux";
user = "torjus"; user = "torjus";
@ -39,7 +40,7 @@
inherit system; inherit system;
specialArgs = { inherit inputs self user sops-nix; }; specialArgs = { inherit inputs self user sops-nix; };
modules = [ modules = [
({ config, pkgs, ... }: { nixpkgs.overlays = [ overlay-unstable ]; }) ({ config, pkgs, ... }: { nixpkgs.overlays = [ overlay-unstable notlistener.overlays.default ]; })
./hosts/gunter ./hosts/gunter
sops-nix.nixosModules.sops sops-nix.nixosModules.sops
]; ];

View File

@ -15,6 +15,7 @@
./programs/kitty ./programs/kitty
./programs/rofi ./programs/rofi
./programs/obs-studio ./programs/obs-studio
./programs/vscode
./scripts ./scripts
./zsh ./zsh
./packages ./packages

View File

@ -115,7 +115,7 @@
# mumble ptt release # mumble ptt release
# ",code:202,exec,mumble rpc stoptalking" # ",code:202,exec,mumble rpc stoptalking"
# ",code:202,exec,pamixer --source 63 -m" # ",code:202,exec,pamixer --source 63 -m"
",code:202,exec,pamixer --default-source -m" # ",code:202,exec,sleep 0.5 && pamixer --default-source -m"
]; ];
bind = [ bind = [
@ -149,7 +149,8 @@
# mumble ptt click # mumble ptt click
# ",code:202,exec,mumble rpc starttalking" # ",code:202,exec,mumble rpc starttalking"
",code:202,exec,pamixer --default-source -u" #",code:202,pass,^(info\.mumble\.Mumble)$"
# ",code:202,exec,pamixer --default-source -u"
# worspace switching # worspace switching
"$mainMod,1,workspace,name:main 1" "$mainMod,1,workspace,name:main 1"

View File

@ -44,7 +44,7 @@
unstable.zoom-us unstable.zoom-us
# Editors # Editors
vscode # vscode
# Go stuff # Go stuff
go go
@ -65,5 +65,8 @@
# Rust # Rust
rustup rustup
# Homemade shit
notlistener
]; ];
} }

View File

@ -0,0 +1,19 @@
{ pkgs, ... }: {
programs.vscode = {
enable = true;
enableUpdateCheck = true;
enableExtensionUpdateCheck = true;
extensions = with pkgs.vscode-extensions; [
catppuccin.catppuccin-vsc
catppuccin.catppuccin-vsc-icons
golang.go
vscodevim.vim
ms-python.python
ms-vscode-remote.remote-ssh
bbenoist.nix
];
userSettings = {
"window.titleBarStyle" = "custom";
};
};
}

View File

@ -3,16 +3,18 @@ let
# Backup home script # Backup home script
backup-home = pkgs.writeShellScriptBin "backup-home.sh" backup-home = pkgs.writeShellScriptBin "backup-home.sh"
'' ''
echo "========== BACKUP HOME STARTING =========="
export RESTIC_PASSWORD="gunter.home.2rjus.net" export RESTIC_PASSWORD="gunter.home.2rjus.net"
export RESTIC_REPOSITORY="rest:http://10.69.12.52:8000/gunter.home.2rjus.net" export RESTIC_REPOSITORY="rest:http://10.69.12.52:8000/gunter.home.2rjus.net"
GOTIFY_TOKEN=$(<"$XDG_RUNTIME_DIR/gotify_backup_home.txt") GOTIFY_TOKEN=$(<"$XDG_RUNTIME_DIR/secrets/gotify_backup_home")
echo "DEBUG: GOTIFY_TOKEN=$GOTIFY_TOKEN"
echo "DEBUG: BUSADDR=$DBUS_SESSION_BUS_ADDRESS"
if [ -z "$GOTIFY_TOKEN" ]; then if [ -z "$GOTIFY_TOKEN" ]; then
${pkgs.libnotify}/bin/notify-send -u critical "Backup issue" "No Gotify token found" ${pkgs.libnotify}/bin/notify-send -u critical "Backup issue" "No Gotify token found"
fi fi
echo "GOTIFY_TOKEN=$GOTIFY_TOKEN"
# Send start notification # Send start notification
${pkgs.libnotify}/bin/notify-send -e -t 3000 "Backup started" "Backup of /home/torjus started" ${pkgs.libnotify}/bin/notify-send -e -t 3000 "Backup started" "Backup of /home/torjus started"
retval=$? retval=$?
@ -21,6 +23,7 @@ let
fi fi
# Do the backup # Do the backup
echo "========== BACKUP TASK STARTING =========="
SECONDS=0 SECONDS=0
${pkgs.restic}/bin/restic backup /home/torjus \ ${pkgs.restic}/bin/restic backup /home/torjus \
--exclude '/home/torjus/.cache' \ --exclude '/home/torjus/.cache' \
@ -38,11 +41,14 @@ let
-F "message=Please check status of backup-home service" -F "message=Please check status of backup-home service"
fi fi
fi fi
echo "========== BACKUP TASK COMPLETE =========="
# Remove old snapshots and prune # Remove old snapshots and prune
echo "========== PRUNE TASK STARTING =========="
${pkgs.restic}/bin/restic forget -d 7 -w 4 -m 6 --keep-within 1d --prune ${pkgs.restic}/bin/restic forget -d 7 -w 4 -m 6 --keep-within 1d --prune
echo "========== PRUNE TASK COMPLETE =========="
# Gather statistics # Gather statistics
echo "========== STATS TASK STARTING =========="
stats=$(${pkgs.restic}/bin/restic stats --json) stats=$(${pkgs.restic}/bin/restic stats --json)
stats_raw=$(${pkgs.restic}/bin/restic stats --mode=raw-data --json) stats_raw=$(${pkgs.restic}/bin/restic stats --mode=raw-data --json)
@ -54,6 +60,7 @@ let
| ${pkgs.coreutils}/bin/numfmt --to=iec) | ${pkgs.coreutils}/bin/numfmt --to=iec)
total_snapshots=$(${pkgs.jq}/bin/jq -r '.snapshots_count' <<< $stats) total_snapshots=$(${pkgs.jq}/bin/jq -r '.snapshots_count' <<< $stats)
message="$total_files files\n$total_snapshots snapshots\n$raw_size ($total_size)" message="$total_files files\n$total_snapshots snapshots\n$raw_size ($total_size)"
echo "========== STATS TASK COMPLETE =========="
# Send completion notification # Send completion notification
${pkgs.libnotify}/bin/notify-send -i checkmark -e -t 10000 \ ${pkgs.libnotify}/bin/notify-send -i checkmark -e -t 10000 \
@ -63,6 +70,7 @@ let
echo "Failed to send notification" echo "Failed to send notification"
exit $retval exit $retval
fi fi
echo "========== BACKUP HOME COMPLETE =========="
''; '';
in in
{ {
@ -88,7 +96,7 @@ in
Persistent = true; Persistent = true;
}; };
Install = { Install = {
WantedBy = [ "timers.target" ]; WantedBy = [ "timers.target" "graphical-session.target" ];
}; };
}; };
} }

View File

@ -12,6 +12,18 @@
initExtra = '' initExtra = ''
bindkey -v bindkey -v
bindkey '^R' history-incremental-search-backward bindkey '^R' history-incremental-search-backward
# Prompt stuff
autoload -Uz promptinit
promptinit
prompt pure
''; '';
zplug = {
enable = true;
plugins = [
({ name = "plugins/git"; tags = [ "from:oh-my-zsh" ]; })
({ name = "modules/prompt"; tags = [ "from:prezto" ]; })
];
};
}; };
} }

View File

@ -113,6 +113,7 @@
vim vim
wget wget
v4l-utils v4l-utils
nmap
# X shit # X shit
# xorg.xorgserver # xorg.xorgserver

View File

@ -8,10 +8,11 @@
users.users.torjus = { users.users.torjus = {
isNormalUser = true; isNormalUser = true;
initialPassword = "password"; initialPassword = "password";
linger = true;
home = "/home/torjus"; home = "/home/torjus";
description = "Torjus"; description = "Torjus";
shell = pkgs.zsh; shell = pkgs.zsh;
extraGroups = [ "wheel" "networkmanager" ]; extraGroups = [ "wheel" "input" "networkmanager" ];
# Install some user packages # Install some user packages
packages = with pkgs; [ packages = with pkgs; [
]; ];