chore: remove unused devshell

This commit is contained in:
Nickolaj Jepsen 2025-02-23 23:04:41 +01:00
parent 5e83abc0fb
commit afbeb29e7d
8 changed files with 86 additions and 70 deletions

View file

@ -1,20 +0,0 @@
{inputs, ...}: {
imports = [inputs.agenix-rekey.flakeModule];
perSystem = {
system,
pkgs,
...
}: {
devShells.default = pkgs.mkShell {
inherit system;
packages = [
pkgs.nix
pkgs.nixos-rebuild
pkgs.nixos-rebuild
pkgs.nh
];
};
};
}

78
flake.lock generated
View file

@ -34,11 +34,11 @@
"treefmt-nix": "treefmt-nix" "treefmt-nix": "treefmt-nix"
}, },
"locked": { "locked": {
"lastModified": 1738758381, "lastModified": 1739816852,
"narHash": "sha256-cNEfY2a6amDIMHNcgiBDqwUHg+vA2C9evIeLHb+AVDI=", "narHash": "sha256-QG8aA6hWsi6pqaidaz5a5SL+dM1mT9LMWMrmc1hrOrU=",
"owner": "oddlama", "owner": "oddlama",
"repo": "agenix-rekey", "repo": "agenix-rekey",
"rev": "2df379f6fec3ecc4190e1778b29a3eceef86d546", "rev": "5f56d711ffe2aca62cfeeada9ec56692a13b9061",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -96,11 +96,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1739380580, "lastModified": 1740081950,
"narHash": "sha256-wGtGEfdooudj74wn59Vu5Z2DLsrX9cxdGTFc9sJrP9M=", "narHash": "sha256-h6RFLln99Br7o0TmtKE+vd6F2PQiGBIrRobf4Ld2wRA=",
"owner": "aylur", "owner": "aylur",
"repo": "astal", "repo": "astal",
"rev": "956b74fd9ff8c607b6683b404860c4e6b30ffe2b", "rev": "3620d51bc6c23ada1bd4b7c9cf1c458c138e68df",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -120,11 +120,11 @@
"stable": "stable" "stable": "stable"
}, },
"locked": { "locked": {
"lastModified": 1734897875, "lastModified": 1739900653,
"narHash": "sha256-LLpiqfOGBippRax9F33kSJ/Imt8gJXb6o0JwSBiNHCk=", "narHash": "sha256-hPSLvw6AZQYrZyGI6Uq4XgST7benF/0zcCpugn/P0yM=",
"owner": "zhaofengli", "owner": "zhaofengli",
"repo": "colmena", "repo": "colmena",
"rev": "a6b51f5feae9bfb145daa37fd0220595acb7871e", "rev": "2370d4336eda2a9ef29fce10fa7076ae011983ab",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -183,11 +183,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1739529569, "lastModified": 1739841949,
"narHash": "sha256-sQzLVCRPfAV/TJXru/jhCyecMXinG/sW8KLoYg0nOpk=", "narHash": "sha256-lSOXdgW/1zi/SSu7xp71v+55D5Egz8ACv0STkj7fhbs=",
"owner": "nix-community", "owner": "nix-community",
"repo": "disko", "repo": "disko",
"rev": "e51159153b5fbe5c41caab41a7212df93c42d34b", "rev": "15dbf8cebd8e2655a883b74547108e089f051bf0",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -389,11 +389,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1739570999, "lastModified": 1739757849,
"narHash": "sha256-eCc0/Q4bPpe4/AS+uzIrHLJcR6BxPQ69q2kD0/Qe6rU=", "narHash": "sha256-Gs076ot1YuAAsYVcyidLKUMIc4ooOaRGO0PqTY7sBzA=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "254d47082e23dbf72fdeca1da6fe1da420f478d8", "rev": "9d3d080aec2a35e05a15cedd281c2384767c2cfe",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -431,11 +431,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1739676768, "lastModified": 1740281615,
"narHash": "sha256-U1HQ7nzhJyVVXUgjU028UCkbLQLEIkg42+G7iIiBmlU=", "narHash": "sha256-dZWcbAQ1sF8oVv+zjSKkPVY0ebwENQEkz5vc6muXbKY=",
"owner": "nix-community", "owner": "nix-community",
"repo": "nix-index-database", "repo": "nix-index-database",
"rev": "ae15068e79e22b76c344f0d7f8aed1bb1c5b0b63", "rev": "465792533d03e6bb9dc849d58ab9d5e31fac9023",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -451,11 +451,11 @@
"nixpkgs": "nixpkgs" "nixpkgs": "nixpkgs"
}, },
"locked": { "locked": {
"lastModified": 1739670916, "lastModified": 1740275623,
"narHash": "sha256-Tdzu06QlI8DsYdXNe96c9eu0clj9Wkd1cKo6em/0xPU=", "narHash": "sha256-LQ9hq3hKwWqm+dzBhgsIkr2KO6Bb0aU+yO/TtI7hXXo=",
"owner": "nix-community", "owner": "nix-community",
"repo": "nix-vscode-extensions", "repo": "nix-vscode-extensions",
"rev": "370af219cf4ad7660e3ad4577849fb0478edb33c", "rev": "35ff5dce04469e7b4e56a9d997e5201bfce52ae3",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -533,11 +533,11 @@
}, },
"nixpkgs-unstable": { "nixpkgs-unstable": {
"locked": { "locked": {
"lastModified": 1739446958, "lastModified": 1740126099,
"narHash": "sha256-+/bYK3DbPxMIvSL4zArkMX0LQvS7rzBKXnDXLfKyRVc=", "narHash": "sha256-ozoOtE2hGsqh4XkTJFsrTkNxkRgShxpQxDynaPZUGxk=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "2ff53fe64443980e139eaa286017f53f88336dd0", "rev": "32fb99ba93fea2798be0e997ea331dd78167f814",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -549,11 +549,11 @@
}, },
"nixpkgs_2": { "nixpkgs_2": {
"locked": { "locked": {
"lastModified": 1739357830, "lastModified": 1740162160,
"narHash": "sha256-9xim3nJJUFbVbJCz48UP4fGRStVW5nv4VdbimbKxJ3I=", "narHash": "sha256-SSYxFhqCOb3aiPb6MmN68yEzBIltfom8IgRz7phHscM=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "0ff09db9d034a04acd4e8908820ba0b410d7a33a", "rev": "11415c7ae8539d6292f2928317ee7a8410b28bb9",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -565,11 +565,11 @@
}, },
"nixpkgs_3": { "nixpkgs_3": {
"locked": { "locked": {
"lastModified": 1739482815, "lastModified": 1735554305,
"narHash": "sha256-/5Lwtmp/8j+ro32gXzitucSdyjJ6QehfJCL58WNA7N0=", "narHash": "sha256-zExSA1i/b+1NMRhGGLtNfFGXgLtgo+dcuzHzaWA6w3Q=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "ba0939c506a03c60a765cd7f7c43794816540eec", "rev": "0e82ab234249d8eee3e8c91437802b32c74bb3fd",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -588,11 +588,11 @@
"treefmt-nix": "treefmt-nix_2" "treefmt-nix": "treefmt-nix_2"
}, },
"locked": { "locked": {
"lastModified": 1739903703, "lastModified": 1740340210,
"narHash": "sha256-w2tTcjx39lJoPDaFbIxi+INIjAKE0jbIx9TNjj9ghmg=", "narHash": "sha256-4ChQlobPMj36419ftR8Ijp1SOIQOkE46zrIbX8krqso=",
"owner": "nix-community", "owner": "nix-community",
"repo": "NUR", "repo": "NUR",
"rev": "2215ad5c4347f522523715e809f5f2022509f504", "rev": "54f385108fd1275597cd840ed6c6e3eb9d4ad302",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -753,11 +753,11 @@
"nixpkgs": "nixpkgs_3" "nixpkgs": "nixpkgs_3"
}, },
"locked": { "locked": {
"lastModified": 1738953846, "lastModified": 1739829690,
"narHash": "sha256-yrK3Hjcr8F7qS/j2F+r7C7o010eVWWlm4T1PrbKBOxQ=", "narHash": "sha256-mL1szCeIsjh6Khn3nH2cYtwO5YXG6gBiTw1A30iGeDU=",
"owner": "numtide", "owner": "numtide",
"repo": "treefmt-nix", "repo": "treefmt-nix",
"rev": "4f09b473c936d41582dd744e19f34ec27592c5fd", "rev": "3d0579f5cc93436052d94b73925b48973a104204",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -774,11 +774,11 @@
"systems": "systems_3" "systems": "systems_3"
}, },
"locked": { "locked": {
"lastModified": 1739196332, "lastModified": 1740299512,
"narHash": "sha256-THwDbGY325LdIQQiBq1xE/LDgPCOtmaowh4LfzkIuu8=", "narHash": "sha256-l6WxKXm2kS3T1kDQC3gcq9AG8ALHr4b53ruWB2YKzMk=",
"owner": "abenz1267", "owner": "abenz1267",
"repo": "walker", "repo": "walker",
"rev": "a3c1cb1ff5a83c0b8d94933b75702d550f2cc8a3", "rev": "c0078bff61bd9945fb62b88ce705c6f363a7635e",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -68,7 +68,6 @@
flake-parts.lib.mkFlake {inherit inputs;} { flake-parts.lib.mkFlake {inherit inputs;} {
imports = [ imports = [
inputs.agenix-rekey.flakeModule inputs.agenix-rekey.flakeModule
./devshell.nix
./vm.nix ./vm.nix
./formatter.nix ./formatter.nix
./hosts ./hosts

View file

@ -47,13 +47,22 @@ vm-destroy:
virsh pool-destroy nixos virsh pool-destroy nixos
virsh pool-undefine nixos virsh pool-undefine nixos
[doc("Build a flake output")]
build target='':
@{{ nixcmd }} run nixpkgs#nix-output-monitor -- build {{ justfile_directory() }}#{{ target }}
[doc('Build a nixos configuration')]
[group('deploy')]
build-system hostname:
@just build nixosConfigurations."{{ hostname }}".config.system.build.toplevel
[doc('Wrapper for nixos-facter')] [doc('Wrapper for nixos-facter')]
[group('deploy')] [group('deploy')]
factor hostname target='': factor hostname=`hostname -s` target='':
#!/usr/bin/env -S bash -e #!/usr/bin/env -S bash -e
target="{{ target }}" target="{{ target }}"
if [ -z "$target" ]; then if [ -z "$target" ]; then
{{ nixcmd }} run nixpkgs#nixos-facter -- -o hosts/{{ hostname }}/facter.json sudo {{ nixcmd }} run nixpkgs#nixos-facter -- -o hosts/{{ hostname }}/facter.json
else else
{{ nixcmd }} run github:nix-community/nixos-anywhere -- \ {{ nixcmd }} run github:nix-community/nixos-anywhere -- \
--flake .#{{ hostname }} \ --flake .#{{ hostname }} \
@ -64,11 +73,11 @@ factor hostname target='':
[doc('Wrapper for nixos-rebuild switch')] [doc('Wrapper for nixos-rebuild switch')]
[group("deploy")] [group("deploy")]
switch hostname target='': switch hostname=`hostname -s` target='': (build-system hostname)
#!/usr/bin/env -S bash -e #!/usr/bin/env -S bash -e
target="{{ target }}" target="{{ target }}"
if [ -z "$target" ]; then if [ -z "$target" ]; then
{{ nixcmd }} run nixpkgs#nixos-rebuild -- switch --flake .#{{ hostname }} sudo {{ nixcmd }} run nixpkgs#nixos-rebuild -- switch --fast --flake .#{{ hostname }}
else else
{{ nixcmd }} run nixpkgs#nixos-rebuild -- switch \ {{ nixcmd }} run nixpkgs#nixos-rebuild -- switch \
--flake .#{{ hostname }} \ --flake .#{{ hostname }} \
@ -78,7 +87,7 @@ switch hostname target='':
[doc('Use nixos-anywhere to deploy to a remote host')] [doc('Use nixos-anywhere to deploy to a remote host')]
[group('deploy')] [group('deploy')]
deploy-remote hostname target: deploy-remote hostname target: (build-system hostname)
#!/usr/bin/env -S bash -e #!/usr/bin/env -S bash -e
git add . git add .
@ -103,7 +112,7 @@ deploy-remote hostname target:
[doc('A wrapper disko-install')] [doc('A wrapper disko-install')]
[group('deploy')] [group('deploy')]
disko-install hostname disk="/dev/sda": disko-install hostname disk: (build-system hostname)
sudo {{ nixcmd }} run 'github:nix-community/disko/latest#disko-install' -- --flake .#{{ hostname }} --disk main {{ disk }} sudo {{ nixcmd }} run 'github:nix-community/disko/latest#disko-install' -- --flake .#{{ hostname }} --disk main {{ disk }}
[doc('Build an install ISO for a host')] [doc('Build an install ISO for a host')]
@ -163,3 +172,22 @@ new-host hostname username:
]; ];
}; };
EOF EOF
[doc("Update flake.lock")]
update:
{{ nixcmd }} flake update
[doc("Run nix-tree")]
[group("tools")]
tree *ARGS=("--derivation .#nixosConfigurations." + shell("hostname -s") + ".config.system.build.toplevel"):
{{ nixcmd }} run github:utdemir/nix-tree -- {{ ARGS }}
[doc("Run nix-diff between current system")]
[group("tools")]
diff: build
{{ nixcmd }} run nixpkgs#nvd -- diff /run/current-system {{ justfile_directory() }}/result
[doc("Run nurl")]
[group("tools")]
nurl *ARGS="--help":
{{ nixcmd }} run nixpkgs#nurl -- {{ ARGS }}

11
modules/base/gc.nix Normal file
View file

@ -0,0 +1,11 @@
_: {
boot.loader.systemd-boot.configurationLimit = 10;
nix.gc = {
automatic = true;
dates = "weekly";
options = "--delete-older-than 1w";
};
nix.settings.auto-optimise-store = true;
}

View file

@ -9,6 +9,7 @@
./base/time.nix ./base/time.nix
./base/ssh.nix ./base/ssh.nix
./base/default-apps.nix ./base/default-apps.nix
./base/gc.nix
./dev/just.nix ./dev/just.nix
./hardware/usb.nix ./hardware/usb.nix
./hardware/yubikey.nix ./hardware/yubikey.nix

View file

@ -38,9 +38,6 @@
unzip unzip
gzip gzip
xz xz
# Nix
nurl
]; ];
}; };
} }

2
result
View file

@ -1 +1 @@
/nix/store/nc1f93w32gkn9i69vhfi88fp53q29ib7-nixos-24.11.20250212.0ff09db-x86_64-linux.iso /nix/store/pbkcpq4n56acyyrbxlqgcsh7gng6ksb4-nixos-system-desktop-24.11.20250221.11415c7