feat(nix): pass flake self to darwin modules and add revision
This commit is contained in:
parent
0f741cbb36
commit
45414c48b9
5 changed files with 20 additions and 3 deletions
|
@ -1,11 +1,14 @@
|
||||||
{
|
{
|
||||||
outputs =
|
outputs =
|
||||||
inputs:
|
{ self, ... }@inputs:
|
||||||
inputs.flake-parts.lib.mkFlake { inherit inputs; } (
|
inputs.flake-parts.lib.mkFlake { inherit inputs; } (
|
||||||
(inputs.import-tree ./nix)
|
(inputs.import-tree ./nix)
|
||||||
// {
|
// {
|
||||||
systems = import inputs.systems;
|
systems = import inputs.systems;
|
||||||
flake.paths.root = ./.;
|
flake = {
|
||||||
|
inherit self;
|
||||||
|
paths.root = ./.;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
inputs = {
|
inputs = {
|
||||||
|
|
|
@ -38,6 +38,7 @@ let
|
||||||
}
|
}
|
||||||
else if class == "darwin" then
|
else if class == "darwin" then
|
||||||
darwinSystem {
|
darwinSystem {
|
||||||
|
specialArgs = { inherit (config.flake) self; };
|
||||||
modules = [ cfg.modules.darwin.default ];
|
modules = [ cfg.modules.darwin.default ];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -56,6 +56,7 @@ let
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.flake = mkSubmoduleOptions {
|
options.flake = mkSubmoduleOptions {
|
||||||
|
self = mkOption { type = raw; };
|
||||||
lib = mkOption {
|
lib = mkOption {
|
||||||
type = lazyAttrsOf raw;
|
type = lazyAttrsOf raw;
|
||||||
default = { };
|
default = { };
|
||||||
|
|
|
@ -3,4 +3,11 @@
|
||||||
"nix-command"
|
"nix-command"
|
||||||
"flakes"
|
"flakes"
|
||||||
];
|
];
|
||||||
|
flake.modules.darwin.default = {
|
||||||
|
nix.enable = false;
|
||||||
|
nix.settings.experimental-features = [
|
||||||
|
"nix-command"
|
||||||
|
"flakes"
|
||||||
|
];
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,6 +12,11 @@
|
||||||
{
|
{
|
||||||
home.stateVersion = osConfig.system.stateVersion;
|
home.stateVersion = osConfig.system.stateVersion;
|
||||||
};
|
};
|
||||||
darwin.default.system.stateVersion = 6;
|
darwin.default =
|
||||||
|
{ self, ... }:
|
||||||
|
{
|
||||||
|
system.configurationRevision = self.rev or self.dirtyRev or null;
|
||||||
|
system.stateVersion = 6;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue