nixos-config/nix/default.nix

48 lines
1.1 KiB
Nix
Raw Normal View History

2025-05-18 09:51:46 +02:00
# * Outputs - default.nix
2025-05-18 08:49:34 +02:00
{ inputs, configRootPath }:
let
2025-05-18 10:05:47 +02:00
isDecrypted =
npkgs: system:
let
file = ../private/check-encryption;
resultFile = npkgs.legacyPackages."${system}".runCommandLocal "check-encryption" { src = file; } ''
if [[ "$(< $src)" != "DECRYPTED" ]]; then
echo -n "no" >> $out;
else
echo -n "yes" >> $out;
fi
'';
in
(builtins.readFile resultFile == "yes");
2025-05-18 08:49:34 +02:00
stable = inputs.config-stable;
unstable = inputs.config-unstable;
nixpkgs = stable.nixpkgs;
nixpkgs-unstable = unstable.nixpkgs;
mkkArg = {
inherit stable;
inherit unstable;
inherit configRootPath;
};
in
{
# * NixOS configurations
nixosConfigurations = {
# ** materusPC
2025-05-18 10:05:47 +02:00
"materusPC" = nixpkgs.lib.nixosSystem rec {
2025-05-18 08:49:34 +02:00
system = "x86_64-linux";
specialArgs = { mkkArg = mkkArg // {current = stable;}; };
modules = [
./hosts/materusPC.nix
2025-05-18 10:05:47 +02:00
(if (isDecrypted stable.nixpkgs system) then ./hosts/materusPC-private.nix else {} )
./common.nix
2025-05-18 08:49:34 +02:00
];
};
2025-05-18 09:51:46 +02:00
# * default.nix END
2025-05-18 08:49:34 +02:00
};
}