From 5332c0d27854c2856bfc836096c4bba239dc81bd Mon Sep 17 00:00:00 2001 From: Mohammad Rafiq Date: Tue, 11 Mar 2025 21:35:41 +0800 Subject: [PATCH] feat: add rebuild script --- systems/modules/common.nix | 3 +++ users/modules/programs/bash.nix | 1 - users/modules/scripts/default.nix | 15 ++++++++++++--- users/modules/scripts/git-extract.nix | 12 ------------ users/modules/scripts/rebuild.sh | 2 ++ 5 files changed, 17 insertions(+), 16 deletions(-) delete mode 100644 users/modules/scripts/git-extract.nix create mode 100755 users/modules/scripts/rebuild.sh diff --git a/systems/modules/common.nix b/systems/modules/common.nix index 5445c04..250044f 100644 --- a/systems/modules/common.nix +++ b/systems/modules/common.nix @@ -3,6 +3,9 @@ isNormalUser = true; description = "rafiq"; extraGroups = ["networkmanager" "wheel"]; + openssh.authorizedKeys.keys = [ + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILv8HqazE294YdyGaXK6q2EniDlTpGaUL071kk9+W0GJ rafiq@nemesis" + ]; }; # Enable basic fonts for reasonable Unicode coverage diff --git a/users/modules/programs/bash.nix b/users/modules/programs/bash.nix index d4389f8..09a4f5e 100644 --- a/users/modules/programs/bash.nix +++ b/users/modules/programs/bash.nix @@ -2,7 +2,6 @@ programs.bash = { enable = true; shellAliases = { - rebuild = "sudo nixos-rebuild switch --flake"; gs = "git status"; ai = "aichat -r %shell% -e"; }; diff --git a/users/modules/scripts/default.nix b/users/modules/scripts/default.nix index 16c1514..b6a0118 100644 --- a/users/modules/scripts/default.nix +++ b/users/modules/scripts/default.nix @@ -1,5 +1,14 @@ -{ - imports = [ - ./git-extract.nix +{ pkgs, ... }: { + home.packages = [ + (pkgs.writers.writePython3Bin "git-extract" { + + libraries = with pkgs.python3Packages; [ + magic + chardet + ]; + + } (builtins.readFile ./git-extract.py)) + + (pkgs.writeShellScriptBin "rebuild" (builtins.readFile ./rebuild.sh)) ]; } diff --git a/users/modules/scripts/git-extract.nix b/users/modules/scripts/git-extract.nix deleted file mode 100644 index 27fb4bf..0000000 --- a/users/modules/scripts/git-extract.nix +++ /dev/null @@ -1,12 +0,0 @@ -{ pkgs, ... }: { - home.packages = [ - (pkgs.writers.writePython3Bin "git-extract" { - - libraries = with pkgs.python3Packages; [ - magic - chardet - ]; - - } (builtins.readFile ./git-extract.py)) - ]; -} diff --git a/users/modules/scripts/rebuild.sh b/users/modules/scripts/rebuild.sh new file mode 100755 index 0000000..3e2b522 --- /dev/null +++ b/users/modules/scripts/rebuild.sh @@ -0,0 +1,2 @@ +git add . +sudo nixos-rebuild switch --flake .