make sure we only have fresh systems
This commit is contained in:
parent
360a4f81d0
commit
4d53abe9c3
3 changed files with 20 additions and 7 deletions
20
flake.nix
20
flake.nix
|
@ -21,11 +21,21 @@
|
||||||
writeCommand = krops.packages.${system}.writeCommand;
|
writeCommand = krops.packages.${system}.writeCommand;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
# deploy like this:
|
# deployment
|
||||||
# nix run ".#deploy.sterni"
|
apps.${system} = {
|
||||||
apps.${system}.deploy = pkgs.callPackage ./nixos/krops.nix {
|
# nix run ".#deploy.sterni"
|
||||||
inherit writeCommand secrets;
|
deploy = pkgs.callPackage ./nixos/krops.nix {
|
||||||
lib = krops.lib;
|
inherit writeCommand secrets;
|
||||||
|
lib = krops.lib;
|
||||||
|
};
|
||||||
|
|
||||||
|
# nix run ".#test.sterni"
|
||||||
|
test = pkgs.callPackage ./nixos/krops.nix {
|
||||||
|
inherit writeCommand secrets;
|
||||||
|
lib = krops.lib;
|
||||||
|
nixosRebuildCommand = "test";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
{ pkgs, writeCommand, lib, secrets }:
|
{ pkgs, writeCommand, lib, secrets, nixosRebuildCommand ? "switch" }:
|
||||||
let
|
let
|
||||||
|
|
||||||
# command that ensures we use flake.nix during switch
|
# command that ensures we use flake.nix during switch
|
||||||
command = targetPath:
|
command = targetPath:
|
||||||
let
|
let
|
||||||
commandLine = "TMPDIR=/tmp nixos-rebuild switch --flake ${targetPath} -L --keep-going";
|
commandLine = "TMPDIR=/tmp nixos-rebuild ${nixosRebuildCommand} --flake ${targetPath} -L --keep-going";
|
||||||
in
|
in
|
||||||
''
|
''
|
||||||
echo '${commandLine}'
|
echo '${commandLine}'
|
||||||
|
|
|
@ -28,6 +28,9 @@
|
||||||
|
|
||||||
];
|
];
|
||||||
|
|
||||||
|
# how much configurations should be kept?
|
||||||
|
boot.loader.systemd-boot.configurationLimit = lib.mkDefault 5;
|
||||||
|
|
||||||
# default backup excludes
|
# default backup excludes
|
||||||
backup.exclude = [ ".git" ".stfolder" ".stversions" ];
|
backup.exclude = [ ".git" ".stfolder" ".stversions" ];
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue