(desktop) Gen 446: Cleaned up broken inputs, altered 'nixswitch' to be interchangeable between hosts, added 'host' attr

This commit is contained in:
pagedMov
2024-10-13 02:15:56 -04:00
parent 1379e5a8ef
commit 9372e3af0d
14 changed files with 124 additions and 41 deletions

View File

@@ -1,5 +1,5 @@
{ pkgs, self, ... }:
{ host, inputs, username, nur, pkgs, self, ... }:
{
imports = [

View File

@@ -1,9 +1,10 @@
{ inputs, pkgs, config, self, username, ... }:
{ host, inputs, pkgs, config, self, username, ... }:
{
imports = [
./../../modules/sys
./hardware.nix
(import ./nixswitch.nix { self = self; pkgs = pkgs; })
];
environment.systemPackages = with pkgs; [

View File

@@ -0,0 +1,18 @@
{ self, pkgs }:
pkgs.writeShellScriptBin "nixswitch" (''
#!/run/current-system/sw/bin/bash
scheck && runbg aplay ${self}/media/sound/nixswitch-start.wav
builtin cd "$HOME/sysflakes" || exit
nix flake update
sudo nixos-rebuild switch --flake "$HOME/sysflakes#glasshouse-desktop"
if [ $? -eq 0 ]; then
scheck && runbg aplay ${self}/media/sound/update.wav
else
scheck && runbg aplay ${self}/media/sound/error.wav
fi
builtin cd "$OLDPWD" || exit
'')