Compare commits
2 commits
1df1a59788
...
d1e661df5d
| Author | SHA1 | Date | |
|---|---|---|---|
| d1e661df5d | |||
| 01106110fe |
1 changed files with 12 additions and 6 deletions
|
|
@ -14,12 +14,14 @@ let
|
||||||
{ pkgs, lib, config, ... }:
|
{ pkgs, lib, config, ... }:
|
||||||
{
|
{
|
||||||
config.system.preSwitchChecks.nvd = ''
|
config.system.preSwitchChecks.nvd = ''
|
||||||
|
nvd_check=y
|
||||||
|
if [[ -d /run/current-system ]]
|
||||||
|
then
|
||||||
${lib.getExe pkgs.nvd} --nix-bin-dir ${config.nix.package}/bin diff /run/current-system "''${1}"
|
${lib.getExe pkgs.nvd} --nix-bin-dir ${config.nix.package}/bin diff /run/current-system "''${1}"
|
||||||
if [[ -t 0 ]]; then
|
if [[ -t 0 ]]; then
|
||||||
printf 'really %s to %s? [y]es/[N]o ' "''${2}" "''${1}"
|
printf 'really %s to %s? [y]es/[N]o ' "''${2}" "''${1}"
|
||||||
read -r nvd_check
|
read -r nvd_check
|
||||||
else
|
fi
|
||||||
nvd_check=y
|
|
||||||
fi
|
fi
|
||||||
[[ "''${nvd_check}" == y ]]
|
[[ "''${nvd_check}" == y ]]
|
||||||
'';
|
'';
|
||||||
|
|
@ -30,6 +32,7 @@ let
|
||||||
{
|
{
|
||||||
namespace ? "fbs42",
|
namespace ? "fbs42",
|
||||||
nixpkgs ? "nixpkgs",
|
nixpkgs ? "nixpkgs",
|
||||||
|
classes ? [ hostname ],
|
||||||
}:
|
}:
|
||||||
inputs.${nixpkgs}.lib.nixosSystem {
|
inputs.${nixpkgs}.lib.nixosSystem {
|
||||||
specialArgs = { inherit inputs flake namespace; };
|
specialArgs = { inherit inputs flake namespace; };
|
||||||
|
|
@ -39,6 +42,9 @@ let
|
||||||
base: builtins.attrValues (flake.lib.scan { base = "${base}/host/${hostname}"; })
|
base: builtins.attrValues (flake.lib.scan { base = "${base}/host/${hostname}"; })
|
||||||
) flake.lib.schema.base
|
) flake.lib.schema.base
|
||||||
)
|
)
|
||||||
|
++ map (class: {
|
||||||
|
imports = map (input: input.${namespace}.${class} or { }) (builtins.attrValues inputs);
|
||||||
|
}) classes
|
||||||
++ [ pre-switch-check ]
|
++ [ pre-switch-check ]
|
||||||
++ [ { config.networking.hostName = hostname; } ]
|
++ [ { config.networking.hostName = hostname; } ]
|
||||||
++ [ nixosModules.default ]
|
++ [ nixosModules.default ]
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue