forked from Fachschaft/nixConfig
nix config to save some space
This commit is contained in:
parent
e7154785dd
commit
372a42a9ed
4 changed files with 38 additions and 19 deletions
|
@ -3,21 +3,28 @@ with lib; let
|
||||||
admins = {
|
admins = {
|
||||||
nerf = {
|
nerf = {
|
||||||
hashedPassword = "$y$j9T$SJcjUIcs3JYuM5oyxfEQa/$tUBQT07FK4cb9xm.A6ZKVnFIPNOYMOKC6Dt6hadCuJ7";
|
hashedPassword = "$y$j9T$SJcjUIcs3JYuM5oyxfEQa/$tUBQT07FK4cb9xm.A6ZKVnFIPNOYMOKC6Dt6hadCuJ7";
|
||||||
keys = [
|
sshKeys = [
|
||||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEdA4LpEGUUmN8esFyrNZXFb2GiBID9/S6zzhcnofQuP nerf@nerflap2"
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEdA4LpEGUUmN8esFyrNZXFb2GiBID9/S6zzhcnofQuP nerf@nerflap2"
|
||||||
];
|
];
|
||||||
|
nixKeys = [
|
||||||
|
"nerflap2-1:pDZCg0oo9PxNQxwVSQSvycw7WXTl53PGvVeZWvxuqJc="
|
||||||
|
];
|
||||||
};
|
};
|
||||||
gonne = {
|
gonne = {
|
||||||
hashedPassword = "$6$EtGpHEcFkOi0yUWp$slXf0CvIUrhdqaoCrQ5YwtYu2IVuE1RGGst4fnDPRLWVm.lYx0ruvSAF2/vw/sLbW37ORJjlb0NHQ.kSG7cVY/";
|
hashedPassword = "$6$EtGpHEcFkOi0yUWp$slXf0CvIUrhdqaoCrQ5YwtYu2IVuE1RGGst4fnDPRLWVm.lYx0ruvSAF2/vw/sLbW37ORJjlb0NHQ.kSG7cVY/";
|
||||||
keys = [
|
sshKeys = [
|
||||||
"sk-ssh-ed25519@openssh.com AAAAGnNrLXNzaC1lZDI1NTE5QG9wZW5zc2guY29tAAAAIAhwkSDISCWLN2GhHfxdZsVkK4J7JoEcPwtNbAesb+BZAAAABHNzaDo= Gonne"
|
"sk-ssh-ed25519@openssh.com AAAAGnNrLXNzaC1lZDI1NTE5QG9wZW5zc2guY29tAAAAIAhwkSDISCWLN2GhHfxdZsVkK4J7JoEcPwtNbAesb+BZAAAABHNzaDo= Gonne"
|
||||||
];
|
];
|
||||||
|
nixKeys = [
|
||||||
|
"gonne.mathebau.de-1:FsXFyFiBFE/JxC9MCkt/WuiXjx5dkRI9RXj0FxOQrV0="
|
||||||
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
mkAdmin = name: {
|
mkAdmin = name: {
|
||||||
hashedPassword,
|
hashedPassword,
|
||||||
keys,
|
sshKeys,
|
||||||
|
...
|
||||||
}: {
|
}: {
|
||||||
"${name}" = {
|
"${name}" = {
|
||||||
isNormalUser = true;
|
isNormalUser = true;
|
||||||
|
@ -25,10 +32,12 @@ with lib; let
|
||||||
extraGroups = ["wheel"];
|
extraGroups = ["wheel"];
|
||||||
group = "users";
|
group = "users";
|
||||||
home = "/home/${name}";
|
home = "/home/${name}";
|
||||||
openssh.authorizedKeys = {inherit keys;};
|
openssh.authorizedKeys = {keys = sshKeys;};
|
||||||
inherit hashedPassword;
|
inherit hashedPassword;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
mkNixKeys = _: {nixKeys, ...}: nixKeys;
|
||||||
in {
|
in {
|
||||||
users.users = mkMerge (mapAttrsToList mkAdmin admins);
|
users.users = mkMerge (mapAttrsToList mkAdmin admins);
|
||||||
|
nix.settings.trusted-public-keys = lists.concatLists (mapAttrsToList mkNixKeys admins);
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,18 +5,11 @@
|
||||||
}: {
|
}: {
|
||||||
imports = [
|
imports = [
|
||||||
./admins.nix
|
./admins.nix
|
||||||
./nix_keys.nix
|
./nix.nix
|
||||||
./prometheusNodeExporter.nix
|
./prometheusNodeExporter.nix
|
||||||
../modules/impermanence.nix
|
../modules/impermanence.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
nix = {
|
|
||||||
extraOptions = ''
|
|
||||||
experimental-features = nix-command flakes
|
|
||||||
builders-use-substitutes = true
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
networking = {
|
networking = {
|
||||||
firewall = {
|
firewall = {
|
||||||
# these shoud be default, but better make sure!
|
# these shoud be default, but better make sure!
|
||||||
|
|
24
nixos/roles/nix.nix
Normal file
24
nixos/roles/nix.nix
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
{
|
||||||
|
nix = {
|
||||||
|
settings = {
|
||||||
|
trusted-public-keys = [];
|
||||||
|
experimental-features = [
|
||||||
|
"flakes"
|
||||||
|
"nix-command"
|
||||||
|
];
|
||||||
|
auto-optimise-store = true;
|
||||||
|
fallback = true;
|
||||||
|
builders-use-substitutes = true;
|
||||||
|
};
|
||||||
|
gc = {
|
||||||
|
persistent = true;
|
||||||
|
dates = "weekly";
|
||||||
|
options = "-d";
|
||||||
|
randomizedDelaySec = "5h";
|
||||||
|
};
|
||||||
|
optimise = {
|
||||||
|
dates = [];
|
||||||
|
automatic = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
|
@ -1,7 +0,0 @@
|
||||||
{
|
|
||||||
imports = [];
|
|
||||||
nix.settings.trusted-public-keys = [
|
|
||||||
"nerflap2-1:pDZCg0oo9PxNQxwVSQSvycw7WXTl53PGvVeZWvxuqJc="
|
|
||||||
"gonne.mathebau.de-1:FsXFyFiBFE/JxC9MCkt/WuiXjx5dkRI9RXj0FxOQrV0="
|
|
||||||
];
|
|
||||||
}
|
|
Loading…
Reference in a new issue