Compare commits
9 Commits
a7250e9581
...
137fec122b
Author | SHA1 | Date | |
---|---|---|---|
137fec122b | |||
229a6b13b5 | |||
0726d674cc | |||
79234d0f5b | |||
d14c058a4c | |||
b335e10809 | |||
e9fe2227f3 | |||
5f013e9a5e | |||
fb712795ea |
50
flake.lock
generated
50
flake.lock
generated
@ -23,11 +23,11 @@
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1709569716,
|
||||
"narHash": "sha256-iOR44RU4jQ+YPGrn+uQeYAp7Xo7Z/+gT+wXJoGxxLTY=",
|
||||
"lastModified": 1709677081,
|
||||
"narHash": "sha256-tix36Y7u0rkn6mTm0lA45b45oab2cFLqAzDbJxeXS+c=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "617579a787259b9a6419492eaac670a5f7663917",
|
||||
"rev": "880992dcc006a5e00dd0591446fdf723e6a51a64",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@ -55,11 +55,11 @@
|
||||
},
|
||||
"nixpkgs-unstable": {
|
||||
"locked": {
|
||||
"lastModified": 1709479366,
|
||||
"narHash": "sha256-n6F0n8UV6lnTZbYPl1A9q1BS0p4hduAv1mGAP17CVd0=",
|
||||
"lastModified": 1709703039,
|
||||
"narHash": "sha256-6hqgQ8OK6gsMu1VtcGKBxKQInRLHtzulDo9Z5jxHEFY=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "b8697e57f10292a6165a20f03d2f42920dfaf973",
|
||||
"rev": "9df3e30ce24fd28c7b3e2de0d986769db5d6225d",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@ -70,6 +70,22 @@
|
||||
}
|
||||
},
|
||||
"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": {
|
||||
"lastModified": 1709356872,
|
||||
"narHash": "sha256-mvxCirJbtkP0cZ6ABdwcgTk0u3bgLoIoEFIoYBvD6+4=",
|
||||
@ -85,17 +101,37 @@
|
||||
"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": {
|
||||
"inputs": {
|
||||
"home-manager": "home-manager",
|
||||
"nixpkgs": "nixpkgs",
|
||||
"nixpkgs-unstable": "nixpkgs-unstable",
|
||||
"notlistener": "notlistener",
|
||||
"sops-nix": "sops-nix"
|
||||
}
|
||||
},
|
||||
"sops-nix": {
|
||||
"inputs": {
|
||||
"nixpkgs": "nixpkgs_2",
|
||||
"nixpkgs": "nixpkgs_3",
|
||||
"nixpkgs-stable": "nixpkgs-stable"
|
||||
},
|
||||
"locked": {
|
||||
|
@ -10,9 +10,10 @@
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
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
|
||||
system = "x86_64-linux";
|
||||
user = "torjus";
|
||||
@ -39,7 +40,7 @@
|
||||
inherit system;
|
||||
specialArgs = { inherit inputs self user sops-nix; };
|
||||
modules = [
|
||||
({ config, pkgs, ... }: { nixpkgs.overlays = [ overlay-unstable ]; })
|
||||
({ config, pkgs, ... }: { nixpkgs.overlays = [ overlay-unstable notlistener.overlays.default ]; })
|
||||
./hosts/gunter
|
||||
sops-nix.nixosModules.sops
|
||||
];
|
||||
|
@ -15,6 +15,7 @@
|
||||
./programs/kitty
|
||||
./programs/rofi
|
||||
./programs/obs-studio
|
||||
./programs/vscode
|
||||
./scripts
|
||||
./zsh
|
||||
./packages
|
||||
|
@ -115,7 +115,7 @@
|
||||
# mumble ptt release
|
||||
# ",code:202,exec,mumble rpc stoptalking"
|
||||
# ",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 = [
|
||||
@ -149,7 +149,8 @@
|
||||
|
||||
# mumble ptt click
|
||||
# ",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
|
||||
"$mainMod,1,workspace,name:main 1"
|
||||
|
@ -44,7 +44,7 @@
|
||||
unstable.zoom-us
|
||||
|
||||
# Editors
|
||||
vscode
|
||||
# vscode
|
||||
|
||||
# Go stuff
|
||||
go
|
||||
@ -65,5 +65,8 @@
|
||||
|
||||
# Rust
|
||||
rustup
|
||||
|
||||
# Homemade shit
|
||||
notlistener
|
||||
];
|
||||
}
|
||||
|
19
home/programs/vscode/default.nix
Normal file
19
home/programs/vscode/default.nix
Normal 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";
|
||||
};
|
||||
};
|
||||
}
|
@ -3,16 +3,18 @@ let
|
||||
# Backup home script
|
||||
backup-home = pkgs.writeShellScriptBin "backup-home.sh"
|
||||
''
|
||||
echo "========== BACKUP HOME STARTING =========="
|
||||
export RESTIC_PASSWORD="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
|
||||
${pkgs.libnotify}/bin/notify-send -u critical "Backup issue" "No Gotify token found"
|
||||
fi
|
||||
|
||||
echo "GOTIFY_TOKEN=$GOTIFY_TOKEN"
|
||||
|
||||
# Send start notification
|
||||
${pkgs.libnotify}/bin/notify-send -e -t 3000 "Backup started" "Backup of /home/torjus started"
|
||||
retval=$?
|
||||
@ -21,6 +23,7 @@ let
|
||||
fi
|
||||
|
||||
# Do the backup
|
||||
echo "========== BACKUP TASK STARTING =========="
|
||||
SECONDS=0
|
||||
${pkgs.restic}/bin/restic backup /home/torjus \
|
||||
--exclude '/home/torjus/.cache' \
|
||||
@ -38,11 +41,14 @@ let
|
||||
-F "message=Please check status of backup-home service"
|
||||
fi
|
||||
fi
|
||||
echo "========== BACKUP TASK COMPLETE =========="
|
||||
|
||||
# Remove old snapshots and prune
|
||||
echo "========== PRUNE TASK STARTING =========="
|
||||
${pkgs.restic}/bin/restic forget -d 7 -w 4 -m 6 --keep-within 1d --prune
|
||||
|
||||
echo "========== PRUNE TASK COMPLETE =========="
|
||||
# Gather statistics
|
||||
echo "========== STATS TASK STARTING =========="
|
||||
stats=$(${pkgs.restic}/bin/restic stats --json)
|
||||
stats_raw=$(${pkgs.restic}/bin/restic stats --mode=raw-data --json)
|
||||
|
||||
@ -54,6 +60,7 @@ let
|
||||
| ${pkgs.coreutils}/bin/numfmt --to=iec)
|
||||
total_snapshots=$(${pkgs.jq}/bin/jq -r '.snapshots_count' <<< $stats)
|
||||
message="$total_files files\n$total_snapshots snapshots\n$raw_size ($total_size)"
|
||||
echo "========== STATS TASK COMPLETE =========="
|
||||
|
||||
# Send completion notification
|
||||
${pkgs.libnotify}/bin/notify-send -i checkmark -e -t 10000 \
|
||||
@ -63,6 +70,7 @@ let
|
||||
echo "Failed to send notification"
|
||||
exit $retval
|
||||
fi
|
||||
echo "========== BACKUP HOME COMPLETE =========="
|
||||
'';
|
||||
in
|
||||
{
|
||||
@ -88,7 +96,7 @@ in
|
||||
Persistent = true;
|
||||
};
|
||||
Install = {
|
||||
WantedBy = [ "timers.target" ];
|
||||
WantedBy = [ "timers.target" "graphical-session.target" ];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
@ -12,6 +12,18 @@
|
||||
initExtra = ''
|
||||
bindkey -v
|
||||
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" ]; })
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
@ -113,6 +113,7 @@
|
||||
vim
|
||||
wget
|
||||
v4l-utils
|
||||
nmap
|
||||
|
||||
# X shit
|
||||
# xorg.xorgserver
|
||||
|
@ -8,10 +8,11 @@
|
||||
users.users.torjus = {
|
||||
isNormalUser = true;
|
||||
initialPassword = "password";
|
||||
linger = true;
|
||||
home = "/home/torjus";
|
||||
description = "Torjus";
|
||||
shell = pkgs.zsh;
|
||||
extraGroups = [ "wheel" "networkmanager" ];
|
||||
extraGroups = [ "wheel" "input" "networkmanager" ];
|
||||
# Install some user packages
|
||||
packages = with pkgs; [
|
||||
];
|
||||
|
Loading…
x
Reference in New Issue
Block a user