This commit is contained in:
Mateusz Słodkowicz 2025-05-18 10:05:47 +02:00
parent 80af4584e6
commit ca9e1f520a
Signed by: materus
GPG Key ID: 28D140BCA60B4FD1
4 changed files with 22 additions and 5 deletions

1
nix/.#common.nix Symbolic link
View File

@ -0,0 +1 @@
materus@materusPC.1079801:1747170257

View File

@ -180,7 +180,7 @@
}
{
assertion = config.konfig.decrypted;
assertion = config.mkk.isDecrypted;
message = "Need to decrypt MKK repo to build";
}
];
@ -205,9 +205,9 @@
in
{
options.konfig = lib.mkOption { default = { }; };
options.mkk.isDecrypted = lib.mkOption { default = decryptedBool; };
config = {
konfig = {
decrypted = decryptedBool;
unstable = mkkArg.unstable;
stable = mkkArg.stable;
current = mkkArg.current;

View File

@ -1,6 +1,21 @@
# * Outputs - default.nix
{ inputs, configRootPath }:
let
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");
stable = inputs.config-stable;
unstable = inputs.config-unstable;
nixpkgs = stable.nixpkgs;
@ -16,12 +31,14 @@ in
nixosConfigurations = {
# ** materusPC
"materusPC" = nixpkgs.lib.nixosSystem {
"materusPC" = nixpkgs.lib.nixosSystem rec {
system = "x86_64-linux";
specialArgs = { mkkArg = mkkArg // {current = stable;}; };
modules = [
./common.nix
./hosts/materusPC.nix
(if (isDecrypted stable.nixpkgs system) then ./hosts/materusPC-private.nix else {} )
./common.nix
];
};
# * default.nix END

View File

@ -8,7 +8,6 @@
}:
{
imports = [
./materusPC-private.nix
# * CONFIG
# ** Nix System Settings
{