diff --git a/flake.nix b/flake.nix index c7b1e13..f273898 100644 --- a/flake.nix +++ b/flake.nix @@ -21,11 +21,21 @@ writeCommand = krops.packages.${system}.writeCommand; in { - # deploy like this: - # nix run ".#deploy.sterni" - apps.${system}.deploy = pkgs.callPackage ./nixos/krops.nix { - inherit writeCommand secrets; - lib = krops.lib; + # deployment + apps.${system} = { + # nix run ".#deploy.sterni" + deploy = pkgs.callPackage ./nixos/krops.nix { + inherit writeCommand secrets; + lib = krops.lib; + }; + + # nix run ".#test.sterni" + test = pkgs.callPackage ./nixos/krops.nix { + inherit writeCommand secrets; + lib = krops.lib; + nixosRebuildCommand = "test"; + }; }; + }; } diff --git a/nixos/krops.nix b/nixos/krops.nix index 7e9f138..106b82e 100644 --- a/nixos/krops.nix +++ b/nixos/krops.nix @@ -1,10 +1,10 @@ -{ pkgs, writeCommand, lib, secrets }: +{ pkgs, writeCommand, lib, secrets, nixosRebuildCommand ? "switch" }: let # command that ensures we use flake.nix during switch command = targetPath: let - commandLine = "TMPDIR=/tmp nixos-rebuild switch --flake ${targetPath} -L --keep-going"; + commandLine = "TMPDIR=/tmp nixos-rebuild ${nixosRebuildCommand} --flake ${targetPath} -L --keep-going"; in '' echo '${commandLine}' diff --git a/nixos/system/all/default.nix b/nixos/system/all/default.nix index e06fae6..93c073b 100644 --- a/nixos/system/all/default.nix +++ b/nixos/system/all/default.nix @@ -28,6 +28,9 @@ ]; + # how much configurations should be kept? + boot.loader.systemd-boot.configurationLimit = lib.mkDefault 5; + # default backup excludes backup.exclude = [ ".git" ".stfolder" ".stversions" ];