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"
},
"locked": {
"narHash": "sha256-YU6DAPd4yJtUAwkuXltTi9gJhL+J2W23OQw2KYUEEQc=",
"narHash": "sha256-45L0HqvqGw7+s87MvKMR14cxEhBJHRnanmTpJlw7E78=",
"path": "./nix-home",
"type": "path"
},
@ -242,7 +242,7 @@
"ssh-keypairs": "ssh-keypairs"
},
"locked": {
"narHash": "sha256-5lkN+UzOEgzUIDhX8tRdWyqO6aqDCzTK0DvCJ2AgUSw=",
"narHash": "sha256-p257NrEQFyj3GYNy+F9NBzEtOqMdyOsrpwMtnGnrOYc=",
"path": "/state/secrets",
"type": "path"
},

View File

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

View File

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

View File

@ -1,6 +1,15 @@
{ lib, ... }:
{
let
ip = import ./ip.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;
let
sys = import ../system.nix { inherit lib config; };
list-contains = lst: item: any (i: i == item) lst;
domain-realm = domain: domainOpts: domainOpts.gssapi-realm;
@ -30,5 +28,5 @@ let
};
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.userGlobalPkgs = {
home-manager.useGlobalPkgs = true;
# home-manager.useGlobalPkgs = {
# useGlobalPkgs = true;
# users = let

View File

@ -28,6 +28,38 @@ let
filterAttrs (host: hostOpts: hostOpts.site == local-site) config.fudo.hosts;
in {
options.instance = with types; {
local-host = mkOption {
type = str;
description = "Name of the current local host.";
};
local-domain = mkOption {
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;
@ -35,4 +67,5 @@ in {
local-admins = local-admins;
local-groups = local-groups;
local-hosts = local-hosts;
};
}

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