Add system stuff to config.instance

This commit is contained in:
niten 2021-10-01 12:52:57 -07:00
parent 6170ffc0af
commit 1450256a76
8 changed files with 59 additions and 17 deletions

4
flake.lock generated
View File

@ -223,7 +223,7 @@
"niten-doom-config": "niten-doom-config" "niten-doom-config": "niten-doom-config"
}, },
"locked": { "locked": {
"narHash": "sha256-YU6DAPd4yJtUAwkuXltTi9gJhL+J2W23OQw2KYUEEQc=", "narHash": "sha256-45L0HqvqGw7+s87MvKMR14cxEhBJHRnanmTpJlw7E78=",
"path": "./nix-home", "path": "./nix-home",
"type": "path" "type": "path"
}, },
@ -242,7 +242,7 @@
"ssh-keypairs": "ssh-keypairs" "ssh-keypairs": "ssh-keypairs"
}, },
"locked": { "locked": {
"narHash": "sha256-5lkN+UzOEgzUIDhX8tRdWyqO6aqDCzTK0DvCJ2AgUSw=", "narHash": "sha256-p257NrEQFyj3GYNy+F9NBzEtOqMdyOsrpwMtnGnrOYc=",
"path": "/state/secrets", "path": "/state/secrets",
"type": "path" "type": "path"
}, },

View File

@ -9,7 +9,7 @@
fudo-secrets.url = "path:/state/secrets"; fudo-secrets.url = "path:/state/secrets";
}; };
outputs = { self, nixpkgs, fudo-secrets, ... }: { outputs = { self, nixpkgs, fudo-secrets, fudo-home, ... }: {
nixosConfigurations = let nixosConfigurations = let
lib = nixpkgs.lib; lib = nixpkgs.lib;
@ -37,6 +37,7 @@
system = hostOpts.arch; system = hostOpts.arch;
modules = [ modules = [
fudo-home.nixosModule
fudo-secrets.nixosModule fudo-secrets.nixosModule
(import ./initialize.nix { (import ./initialize.nix {
inherit hostname pkgs build-timestamp fudo-secrets; inherit hostname pkgs build-timestamp fudo-secrets;

View File

@ -14,6 +14,7 @@ with lib; {
./fudo/distributed-builds.nix ./fudo/distributed-builds.nix
./fudo/dns.nix ./fudo/dns.nix
./fudo/domains.nix ./fudo/domains.nix
./fudo-lib.nix
./fudo/garbage-collector.nix ./fudo/garbage-collector.nix
./fudo/git.nix ./fudo/git.nix
./fudo/global.nix ./fudo/global.nix

View File

@ -1,6 +1,15 @@
{ lib, ... }: { lib, ... }:
{ let
ip = import ./ip.nix { inherit lib; }; ip = import ./ip.nix { inherit lib; };
dns = import ./dns.nix { inherit lib; }; dns = import ./dns.nix { inherit lib; };
in
{
lib.overlays = [
(final: prev: {
fudo = {
inherit ip dns;
};
})
];
} }

View File

@ -3,8 +3,6 @@
with lib; with lib;
let let
sys = import ../system.nix { inherit lib config; };
list-contains = lst: item: any (i: i == item) lst; list-contains = lst: item: any (i: i == item) lst;
domain-realm = domain: domainOpts: domainOpts.gssapi-realm; domain-realm = domain: domainOpts: domainOpts.gssapi-realm;
@ -30,5 +28,5 @@ let
}; };
in { in {
config.home-manager.users = mapAttrs user-config sys.local-users; config.home-manager.users = mapAttrs user-config config.instance.local-users;
} }

View File

@ -265,8 +265,8 @@ in {
}; };
}; };
home-manager.userGlobalPkgs = true; home-manager.useGlobalPkgs = true;
# home-manager.userGlobalPkgs = { # home-manager.useGlobalPkgs = {
# useGlobalPkgs = true; # useGlobalPkgs = true;
# users = let # users = let

View File

@ -28,11 +28,44 @@ let
filterAttrs (host: hostOpts: hostOpts.site == local-site) config.fudo.hosts; filterAttrs (host: hostOpts: hostOpts.site == local-site) config.fudo.hosts;
in { in {
local-host = local-host; options.instance = with types; {
local-domain = local-domain; local-host = mkOption {
local-site = local-site; type = str;
local-users = local-users; description = "Name of the current local host.";
local-admins = local-admins; };
local-groups = local-groups; local-domain = mkOption {
local-hosts = local-hosts; type = str;
description = "Domain name of the current local host.";
};
local-site = mkOption {
type = str;
description = "Site name of the current local host.";
};
local-users = mkOption {
type = listOf str;
description = "List of users who should have access to the local host.";
};
local-admins = mkOption {
type = listOf str;
description = "List of users who should have admin access to the local host.";
};
local-groups = mkOption {
type = listOf str;
description = "List of groups which should be created on the local host.";
};
local-hosts = mkOption {
type = listOf str;
description = "List of hosts that should be considered local to the current host.";
};
};
config.instance = {
local-host = local-host;
local-domain = local-domain;
local-site = local-site;
local-users = local-users;
local-admins = local-admins;
local-groups = local-groups;
local-hosts = local-hosts;
};
} }

@ -1 +1 @@
Subproject commit fe65fa2566388d7a259a8abf92d7166fb75e29b4 Subproject commit 94f5f2560a40b167ce368812c6b883bd7c6df5c1