Fix the makeServiceConfig function.

This commit is contained in:
R-VdP 2023-02-14 13:39:10 +01:00
parent b3c7f71456
commit cf7d0f76d3
No known key found for this signature in database
2 changed files with 12 additions and 8 deletions

View file

@ -100,12 +100,11 @@
}; };
in in
{ {
systemConfig = self.lib.makeServiceConfig { systemConfig = self.lib.makeSystemConfig {
inherit system; inherit system;
modules = [ modules = [
./nix/modules ./nix/modules
]; ];
inherit (self.packages.${system}) system-manager;
}; };
packages = { packages = {
@ -184,6 +183,8 @@
})) }))
// //
{ {
lib = import ./nix/lib.nix { inherit nixpkgs; }; lib = import ./nix/lib.nix {
inherit nixpkgs self;
};
}; };
} }

View file

@ -1,21 +1,25 @@
{ nixpkgs }: { nixpkgs
, self
,
}:
let let
inherit (nixpkgs) lib; inherit (nixpkgs) lib;
in in
{ {
makeServiceConfig = makeSystemConfig =
{ system { system
, modules , modules
, system-manager , extraSpecialArgs ? { }
, ,
}: }:
let let
pkgs = nixpkgs.legacyPackages.${system}; pkgs = nixpkgs.legacyPackages.${system};
inherit (self.packages.${system}) system-manager;
nixosConfig = (lib.nixosSystem { nixosConfig = (lib.nixosSystem {
inherit system; inherit system;
modules = [ ./modules/system-manager.nix ] ++ modules; modules = [ ./modules/system-manager.nix ] ++ modules;
specialArgs = { }; specialArgs = extraSpecialArgs;
}).config; }).config;
returnIfNoAssertions = drv: returnIfNoAssertions = drv:
@ -84,7 +88,6 @@ in
text = lib.generators.toJSON { } etcFiles; text = lib.generators.toJSON { } etcFiles;
}; };
# TODO: remove --ephemeral
activationScript = pkgs.writeShellScript "activate" '' activationScript = pkgs.writeShellScript "activate" ''
${system-manager}/bin/system-manager activate \ ${system-manager}/bin/system-manager activate \
--store-path "$(realpath $(dirname ''${0}))" \ --store-path "$(realpath $(dirname ''${0}))" \