added just commands, updated flake

This commit is contained in:
Sam 2024-05-15 20:44:17 +01:00
parent 11702e8bf8
commit 006814d6c1
8 changed files with 41 additions and 17 deletions

View File

@ -27,16 +27,15 @@
]
},
"locked": {
"lastModified": 1715381426,
"narHash": "sha256-wPuqrAQGdv3ISs74nJfGb+Yprm23U/rFpcHFFNWgM94=",
"lastModified": 1715486357,
"narHash": "sha256-4pRuzsHZOW5W4CsXI9uhKtiJeQSUoe1d2M9mWU98HC4=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "ab5542e9dbd13d0100f8baae2bc2d68af901f4b4",
"rev": "44677a1c96810a8e8c4ffaeaad10c842402647c1",
"type": "github"
},
"original": {
"owner": "nix-community",
"ref": "release-23.11",
"repo": "home-manager",
"type": "github"
}

View File

@ -11,7 +11,7 @@
# Home manager
home-manager = {
url = "github:nix-community/home-manager/release-23.11";
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};

View File

@ -19,7 +19,6 @@
shellAliases = {
ll = "ls -l";
update = "sudo nixos-rebuild switch --flake $(readlink -f /etc/nixos)#fileserver";
};
history.size = 10000;
history.path = "${config.xdg.dataHome}/zsh/history";

View File

@ -25,10 +25,6 @@
shellAliases = {
ll = "ls -l";
update = "sudo nixos-rebuild switch --flake $(readlink -f /etc/nixos)#nixdev";
update-home = "home-manager switch --flake $(readlink -f /etc/nixos)#sam@nixdev";
nix-home = "nvim $HOME/nixos/hosts/workmachine/home.nix";
nix-conf = "nvim $HOME/nixos/hosts/workmachine/configuration.nix";
};
history.size = 10000;
history.path = "${config.xdg.dataHome}/zsh/history";

View File

@ -3,4 +3,10 @@
./sops.nix
];
environment.systemPackages = [
pkgs.rsync
pkgs.curl
pkgs.just
];
}

View File

@ -20,9 +20,5 @@ in
programs.zsh.enable = true;
environment.systemPackages = [
pkgs.rsync
pkgs.curl
pkgs.tmux
pkgs.neovim
];
}

View File

@ -31,8 +31,5 @@ in
};
environment.systemPackages = [
pkgs.rsync
pkgs.curl
pkgs.just
];
}

31
justfile Normal file
View File

@ -0,0 +1,31 @@
SOPS_FILE := "../nix-secrets/secrets.yaml"
# default recipe to display help information
default:
@just --list
# ensure the latest revisions of nix-secrets are used next time a rebuild occurs
update-nix-secrets:
(cd ../nix-secrets && git fetch && git rebase) || true
nix flake lock --update-input nix-secrets
# full system rebuild from flake (stages changes and automatically detects host)
rebuild-system:
git add *.nix
sudo nixos-rebuild switch --flake $(readlink -f /etc/nixos)#$(hostname)
# updates all flake inputs for system
update-flake:
nix flake update
# edit sops file
edit-sops:
echo "Editing {{SOPS_FILE}}"
nix-shell -p sops --run "SOPS_AGE_KEY_FILE=~/.config/sops/age/keys.txt sops {{SOPS_FILE}}"
# update
update-secrets:
cd $HOME/nix-secrets && (\
nix-shell -p sops --run "sops updatekeys -y secrets.yaml" && \
git add -u && (git commit -m "updated secrets" || true) && git push \
)