wooooooot, we're compiling again

This commit is contained in:
Chris Kruining 2026-03-26 14:00:25 +01:00
parent 97b63074f0
commit ba7c3392b9
No known key found for this signature in database
GPG key ID: EB894A3560CCCAD2
94 changed files with 654 additions and 677 deletions

124
flake.lock generated
View file

@ -71,15 +71,23 @@
"clan-core": { "clan-core": {
"inputs": { "inputs": {
"data-mesher": "data-mesher", "data-mesher": "data-mesher",
"disko": "disko", "disko": [
"disko"
],
"flake-parts": [ "flake-parts": [
"flake-parts" "flake-parts"
], ],
"nix-darwin": "nix-darwin", "nix-darwin": "nix-darwin",
"nix-select": "nix-select", "nix-select": "nix-select",
"nixpkgs": "nixpkgs", "nixpkgs": [
"sops-nix": "sops-nix", "nixpkgs"
"systems": "systems", ],
"sops-nix": [
"sops-nix"
],
"systems": [
"systems"
],
"treefmt-nix": "treefmt-nix" "treefmt-nix": "treefmt-nix"
}, },
"locked": { "locked": {
@ -139,7 +147,6 @@
"disko": { "disko": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
"clan-core",
"nixpkgs" "nixpkgs"
] ]
}, },
@ -160,7 +167,7 @@
"erosanix": { "erosanix": {
"inputs": { "inputs": {
"flake-compat": "flake-compat", "flake-compat": "flake-compat",
"nixpkgs": "nixpkgs_2" "nixpkgs": "nixpkgs"
}, },
"locked": { "locked": {
"lastModified": 1773767380, "lastModified": 1773767380,
@ -264,7 +271,6 @@
"flake-parts": { "flake-parts": {
"inputs": { "inputs": {
"nixpkgs-lib": [ "nixpkgs-lib": [
"clan-core",
"nixpkgs" "nixpkgs"
] ]
}, },
@ -369,7 +375,7 @@
"flux": { "flux": {
"inputs": { "inputs": {
"mcman": "mcman", "mcman": "mcman",
"nixpkgs": "nixpkgs_4" "nixpkgs": "nixpkgs_3"
}, },
"locked": { "locked": {
"lastModified": 1767316901, "lastModified": 1767316901,
@ -422,7 +428,7 @@
}, },
"grub2-themes": { "grub2-themes": {
"inputs": { "inputs": {
"nixpkgs": "nixpkgs_5" "nixpkgs": "nixpkgs_4"
}, },
"locked": { "locked": {
"lastModified": 1757136219, "lastModified": 1757136219,
@ -538,7 +544,7 @@
"mcman": { "mcman": {
"inputs": { "inputs": {
"crane": "crane", "crane": "crane",
"nixpkgs": "nixpkgs_3" "nixpkgs": "nixpkgs_2"
}, },
"locked": { "locked": {
"lastModified": 1766962671, "lastModified": 1766962671,
@ -572,7 +578,7 @@
"mydia": { "mydia": {
"inputs": { "inputs": {
"flake-parts": "flake-parts_2", "flake-parts": "flake-parts_2",
"nixpkgs": "nixpkgs_6" "nixpkgs": "nixpkgs_5"
}, },
"locked": { "locked": {
"lastModified": 1764866402, "lastModified": 1764866402,
@ -656,8 +662,8 @@
"nix-minecraft": { "nix-minecraft": {
"inputs": { "inputs": {
"flake-compat": "flake-compat_2", "flake-compat": "flake-compat_2",
"nixpkgs": "nixpkgs_7", "nixpkgs": "nixpkgs_6",
"systems": "systems_2" "systems": "systems"
}, },
"locked": { "locked": {
"lastModified": 1774407052, "lastModified": 1774407052,
@ -719,22 +725,6 @@
} }
}, },
"nixpkgs_2": { "nixpkgs_2": {
"locked": {
"lastModified": 1772380631,
"narHash": "sha256-FhW0uxeXjefINP0vUD4yRBB52Us7fXZPk9RiPAopfiY=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "6d3b61b190a899042ce82a5355111976ba76d698",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "master",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_3": {
"locked": { "locked": {
"lastModified": 1757347588, "lastModified": 1757347588,
"narHash": "sha256-tLdkkC6XnsY9EOZW9TlpesTclELy8W7lL2ClL+nma8o=", "narHash": "sha256-tLdkkC6XnsY9EOZW9TlpesTclELy8W7lL2ClL+nma8o=",
@ -749,7 +739,7 @@
"type": "indirect" "type": "indirect"
} }
}, },
"nixpkgs_4": { "nixpkgs_3": {
"locked": { "locked": {
"lastModified": 1766902085, "lastModified": 1766902085,
"narHash": "sha256-coBu0ONtFzlwwVBzmjacUQwj3G+lybcZ1oeNSQkgC0M=", "narHash": "sha256-coBu0ONtFzlwwVBzmjacUQwj3G+lybcZ1oeNSQkgC0M=",
@ -765,7 +755,7 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs_5": { "nixpkgs_4": {
"locked": { "locked": {
"lastModified": 1774449288, "lastModified": 1774449288,
"narHash": "sha256-ukB6NS45Oi62fQM4RpZfx3dpqxIu66ADCCFl6h72Fjo=", "narHash": "sha256-ukB6NS45Oi62fQM4RpZfx3dpqxIu66ADCCFl6h72Fjo=",
@ -781,7 +771,7 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs_6": { "nixpkgs_5": {
"locked": { "locked": {
"lastModified": 1764242076, "lastModified": 1764242076,
"narHash": "sha256-sKoIWfnijJ0+9e4wRvIgm/HgE27bzwQxcEmo2J/gNpI=", "narHash": "sha256-sKoIWfnijJ0+9e4wRvIgm/HgE27bzwQxcEmo2J/gNpI=",
@ -797,7 +787,7 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs_7": { "nixpkgs_6": {
"locked": { "locked": {
"lastModified": 1769461804, "lastModified": 1769461804,
"narHash": "sha256-msG8SU5WsBUfVVa/9RPLaymvi5bI8edTavbIq3vRlhI=", "narHash": "sha256-msG8SU5WsBUfVVa/9RPLaymvi5bI8edTavbIq3vRlhI=",
@ -813,6 +803,22 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs_7": {
"locked": {
"lastModified": 1774386573,
"narHash": "sha256-4hAV26quOxdC6iyG7kYaZcM3VOskcPUrdCQd/nx8obc=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "46db2e09e1d3f113a13c0d7b81e2f221c63b8ce9",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_8": { "nixpkgs_8": {
"locked": { "locked": {
"lastModified": 1771008912, "lastModified": 1771008912,
@ -877,7 +883,7 @@
"mnw": "mnw", "mnw": "mnw",
"ndg": "ndg", "ndg": "ndg",
"nixpkgs": "nixpkgs_8", "nixpkgs": "nixpkgs_8",
"systems": "systems_3" "systems": "systems_2"
}, },
"locked": { "locked": {
"lastModified": 1774375131, "lastModified": 1774375131,
@ -919,6 +925,7 @@
"root": { "root": {
"inputs": { "inputs": {
"clan-core": "clan-core", "clan-core": "clan-core",
"disko": "disko",
"erosanix": "erosanix", "erosanix": "erosanix",
"fenix": "fenix", "fenix": "fenix",
"flake-parts": "flake-parts", "flake-parts": "flake-parts",
@ -930,15 +937,12 @@
"jovian": "jovian", "jovian": "jovian",
"mydia": "mydia", "mydia": "mydia",
"nix-minecraft": "nix-minecraft", "nix-minecraft": "nix-minecraft",
"nixpkgs": [ "nixpkgs": "nixpkgs_7",
"clan-core",
"nixpkgs"
],
"nvf": "nvf", "nvf": "nvf",
"plasma-manager": "plasma-manager", "plasma-manager": "plasma-manager",
"sops-nix": "sops-nix_2", "sops-nix": "sops-nix",
"stylix": "stylix", "stylix": "stylix",
"systems": "systems_5", "systems": "systems_4",
"terranix": "terranix", "terranix": "terranix",
"zen-browser": "zen-browser" "zen-browser": "zen-browser"
} }
@ -961,27 +965,6 @@
} }
}, },
"sops-nix": { "sops-nix": {
"inputs": {
"nixpkgs": [
"clan-core",
"nixpkgs"
]
},
"locked": {
"lastModified": 1774154798,
"narHash": "sha256-zsTuloDSdKf+PrI1MsWx5z/cyGEJ8P3eERtAfdP8Bmg=",
"owner": "Mic92",
"repo": "sops-nix",
"rev": "3e0d543e6ba6c0c48117a81614e90c6d8c425170",
"type": "github"
},
"original": {
"owner": "Mic92",
"repo": "sops-nix",
"type": "github"
}
},
"sops-nix_2": {
"inputs": { "inputs": {
"nixpkgs": "nixpkgs_9" "nixpkgs": "nixpkgs_9"
}, },
@ -1010,7 +993,7 @@
"gnome-shell": "gnome-shell", "gnome-shell": "gnome-shell",
"nixpkgs": "nixpkgs_10", "nixpkgs": "nixpkgs_10",
"nur": "nur", "nur": "nur",
"systems": "systems_4", "systems": "systems_3",
"tinted-foot": "tinted-foot", "tinted-foot": "tinted-foot",
"tinted-kitty": "tinted-kitty", "tinted-kitty": "tinted-kitty",
"tinted-schemes": "tinted-schemes", "tinted-schemes": "tinted-schemes",
@ -1106,28 +1089,13 @@
"type": "github" "type": "github"
} }
}, },
"systems_6": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"terranix": { "terranix": {
"inputs": { "inputs": {
"flake-parts": "flake-parts_5", "flake-parts": "flake-parts_5",
"nixpkgs": [ "nixpkgs": [
"nixpkgs" "nixpkgs"
], ],
"systems": "systems_6" "systems": "systems_5"
}, },
"locked": { "locked": {
"lastModified": 1773700838, "lastModified": 1773700838,

View file

@ -7,25 +7,37 @@
}; };
inputs = { inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
flake-parts = { flake-parts = {
url = "github:hercules-ci/flake-parts"; url = "github:hercules-ci/flake-parts";
inputs.nixpkgs-lib.follows = "clan-core/nixpkgs"; inputs.nixpkgs-lib.follows = "nixpkgs";
}; };
import-tree.url = "github:vic/import-tree"; import-tree.url = "github:vic/import-tree";
clan-core = {
url = "https://git.clan.lol/clan/clan-core/archive/main.tar.gz";
inputs.flake-parts.follows = "flake-parts";
};
nixpkgs.follows = "clan-core/nixpkgs";
systems.url = "github:nix-systems/default"; systems.url = "github:nix-systems/default";
sops-nix.url = "github:Mic92/sops-nix";
disko = {
url = "github:nix-community/disko";
inputs.nixpkgs.follows = "nixpkgs";
};
home-manager = { home-manager = {
url = "github:nix-community/home-manager"; url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
clan-core = {
url = "https://git.clan.lol/clan/clan-core/archive/main.tar.gz";
inputs = {
flake-parts.follows = "flake-parts";
nixpkgs.follows = "nixpkgs";
sops-nix.follows = "sops-nix";
disko.follows = "disko";
systems.follows = "systems";
};
};
plasma-manager = { plasma-manager = {
url = "github:nix-community/plasma-manager"; url = "github:nix-community/plasma-manager";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
@ -52,8 +64,6 @@
flux.url = "github:IogaMaster/flux"; flux.url = "github:IogaMaster/flux";
sops-nix.url = "github:Mic92/sops-nix";
# Azure AD for linux # Azure AD for linux
himmelblau = { himmelblau = {
url = "github:himmelblau-idm/himmelblau"; url = "github:himmelblau-idm/himmelblau";
@ -98,6 +108,8 @@
flake-parts.flakeModules.modules flake-parts.flakeModules.modules
clan-core.flakeModules.default clan-core.flakeModules.default
home-manager.flakeModules.default home-manager.flakeModules.default
terranix.flakeModule
./packages/flake-module.nix
]; ];
perSystem = {system, ...}: { perSystem = {system, ...}: {
@ -113,9 +125,13 @@
config = { config = {
allowUnfree = true; allowUnfree = true;
permittedInsecurePackages = [ permittedInsecurePackages = [
# I think this is because of zen # I think this is because of zen
"qtwebengine-5.15.19" "qtwebengine-5.15.19"
# For mautrix-signal, the matrix to signal bridge
"olm-3.2.16"
]; ];
}; };
}; };

View file

@ -5,47 +5,12 @@
... ...
}: let }: let
inherit (lib) mkOption types; inherit (lib) mkOption types;
namespace = "sneeuwvlok";
sharedContext = {
inherit inputs namespace;
erosanixLib = inputs.erosanix.lib;
repoRoot = ../.;
sneeuwvlokLib = config.localLib;
terranixLib = inputs.terranix.lib;
};
baseNixosModules =
[
inputs.grub2-themes.nixosModules.default
inputs.home-manager.nixosModules.home-manager
inputs.himmelblau.nixosModules.himmelblau
inputs.jovian.nixosModules.default
inputs.mydia.nixosModules.default
inputs.nix-minecraft.nixosModules.minecraft-servers
inputs.nvf.nixosModules.default
inputs.sops-nix.nixosModules.sops
{
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
extraSpecialArgs = sharedContext;
sharedModules = config.localUsers.homeSharedModules;
};
}
]
++ [../modules/nixos];
in { in {
imports = [ imports = [
./options ./options
./strings ./strings
]; ];
options.localLib = mkOption {
type = types.lazyAttrsOf types.raw;
default = {};
};
config = { config = {
_module.args = { _module.args = {
inherit inherit
@ -55,7 +20,6 @@ in {
sharedContext sharedContext
systemOverlays systemOverlays
; ;
sneeuwvlokLib = config.localLib;
}; };
flake.lib = config.localLib; flake.lib = config.localLib;

View file

@ -2,36 +2,54 @@
inherit (builtins) isString typeOf match toString head; inherit (builtins) isString typeOf match toString head;
inherit (lib) throwIfNot concatStringsSep splitStringBy toLower map concatMapAttrsStringSep; inherit (lib) throwIfNot concatStringsSep splitStringBy toLower map concatMapAttrsStringSep;
in { in {
localLib.strings = { strings = {
#======================================================================================== #========================================================================================
# Converts a string to snake case # Converts a string to snake case
# #
# simply replaces any uppercase letter to its lowercase variant preceeded by an underscore # simply replaces any uppercase letter to its lowercase variant preceeded by an underscore
#======================================================================================== #========================================================================================
toSnakeCase = toSnakeCase = str:
str:
throwIfNot (isString str) "toSnakeCase only accepts string values, but got ${typeOf str}" ( throwIfNot (isString str) "toSnakeCase only accepts string values, but got ${typeOf str}" (
str str
|> splitStringBy (prev: curr: builtins.match "[a-z]" prev != null && builtins.match "[A-Z]" curr != null) true |> splitStringBy (prev: curr: builtins.match "[a-z]" prev != null && builtins.match "[A-Z]" curr != null) true
|> map (p: toLower p) |> map (p: toLower p)
|> concatStringsSep "_" |> concatStringsSep "_"
); );
#======================================================================================== #========================================================================================
# Converts a set of url parts to a string # Converts a set of url parts to a string
#======================================================================================== #========================================================================================
toUrl = toUrl = {
{ protocol ? null, host, port ? null, path ? null, query ? null, hash ? null }: protocol ? null,
let host,
trim_slashes = str: str |> match "^\/*(.+?)\/*$" |> head; port ? null,
encode_to_str = set: concatMapAttrsStringSep "&" (n: v: "${n}=${v}") set; path ? null,
query ? null,
_protocol = if protocol != null then "${protocol}://" else ""; hash ? null,
_port = if port != null then ":${toString port}" else ""; }: let
_path = if path != null then "/${path |> trim_slashes}" else ""; trim_slashes = str: str |> match "^\/*(.+?)\/*$" |> head;
_query = if query != null then "?${query |> encode_to_str}" else ""; encode_to_str = set: concatMapAttrsStringSep "&" (n: v: "${n}=${v}") set;
_hash = if hash != null then "#${hash |> encode_to_str}" else "";
in _protocol =
"${_protocol}${host}${_port}${_path}${_query}${_hash}"; if protocol != null
then "${protocol}://"
else "";
_port =
if port != null
then ":${toString port}"
else "";
_path =
if path != null
then "/${path |> trim_slashes}"
else "";
_query =
if query != null
then "?${query |> encode_to_str}"
else "";
_hash =
if hash != null
then "#${hash |> encode_to_str}"
else "";
in "${_protocol}${host}${_port}${_path}${_query}${_hash}";
}; };
} }

View file

@ -1,301 +1,286 @@
{ {
pkgs, pkgs,
inputs, lib,
self,
... ...
}: { }: {
_module.args = {
pkgs = lib.mkForce (import self.inputs.nixpkgs {
system = "x86_64-linux";
overlays = with self.inputs; [
fenix.overlays.default
nix-minecraft.overlay
flux.overlays.default
];
config = {
allowUnfree = true;
permittedInsecurePackages = [
# I think this is because of zen
"qtwebengine-5.15.19"
# For mautrix-signal, the matrix to signal bridge
"olm-3.2.16"
];
};
});
};
imports = [ imports = [
./disks.nix ./disks.nix
./hardware.nix ./hardware.nix
../../modules/nixos ../../modules/nixos
self.inputs.home-manager.nixosModules.home-manager
self.inputs.himmelblau.nixosModules.himmelblau
self.inputs.jovian.nixosModules.default
self.inputs.mydia.nixosModules.default
self.inputs.nix-minecraft.nixosModules.minecraft-servers
self.inputs.nvf.nixosModules.default
self.inputs.sops-nix.nixosModules.sops
]; ];
sneeuwvlok.application.steam.enable = true;
nixpkgs.hostPlatform = "x86_64-linux";
system.stateVersion = "23.11"; system.stateVersion = "23.11";
boot = { networking = {
kernelPackages = pkgs.linuxPackages_latest; interfaces.enp2s0 = {
ipv6.addresses = [
{
address = "2a0d:6e00:1dc9:0::dead:beef";
prefixLength = 64;
}
];
loader = { useDHCP = true;
systemd-boot.enable = false; };
efi.canTouchEfiVariables = true;
grub = { defaultGateway = {
address = "192.168.1.1";
interface = "enp2s0";
};
defaultGateway6 = {
address = "fe80::1";
interface = "enp2s0";
};
};
sneeuwvlok = {
services = {
backup.borg.enable = true;
authentication.zitadel = {
enable = true; enable = true;
efiSupport = true;
efiInstallAsRemovable = false; organization = {
device = "nodev"; # INFO: https://discourse.nixos.org/t/question-about-grub-and-nodev nix = {
user = {
chris = {
email = "chris@kruining.eu";
firstName = "Chris";
lastName = "Kruining";
roles = ["ORG_OWNER"];
instanceRoles = ["IAM_OWNER"];
};
kaas = {
email = "chris+kaas@kruining.eu";
firstName = "Kaas";
lastName = "Kruining";
};
};
project = {
ulmo = {
projectRoleCheck = true;
projectRoleAssertion = true;
hasProjectCheck = true;
role = {
jellyfin = {
group = "jellyfin";
};
jellyfin_admin = {
group = "jellyfin";
};
};
assign = {
chris = ["jellyfin" "jellyfin_admin"];
kaas = ["jellyfin"];
};
application = {
jellyfin = {
redirectUris = ["https://jellyfin.kruining.eu/sso/OID/redirect/zitadel"];
grantTypes = ["authorizationCode"];
responseTypes = ["code"];
};
forgejo = {
redirectUris = ["https://git.amarth.cloud/user/oauth2/zitadel/callback"];
grantTypes = ["authorizationCode"];
responseTypes = ["code"];
};
vaultwarden = {
redirectUris = ["https://vault.kruining.eu/identity/connect/oidc-signin"];
grantTypes = ["authorizationCode"];
responseTypes = ["code"];
exportMap = {
client_id = "SSO_CLIENT_ID";
client_secret = "SSO_CLIENT_SECRET";
};
};
matrix = {
redirectUris = ["https://matrix.kruining.eu/_synapse/client/oidc/callback"];
grantTypes = ["authorizationCode"];
responseTypes = ["code"];
};
mydia = {
redirectUris = ["http://localhost:2010/auth/oidc/callback"];
grantTypes = ["authorizationCode"];
responseTypes = ["code"];
};
grafana = {
redirectUris = ["http://localhost:9001/login/generic_oauth"];
grantTypes = ["authorizationCode"];
responseTypes = ["code"];
};
};
};
convex = {
projectRoleCheck = true;
projectRoleAssertion = true;
hasProjectCheck = true;
application = {
scry = {
redirectUris = ["https://nautical-salamander-320.eu-west-1.convex.cloud/api/auth/callback/zitadel"];
grantTypes = ["authorizationCode"];
responseTypes = ["code"];
};
};
};
};
action = {
flattenRoles = {
script = ''
(ctx, api) => {
if (ctx.v1.user.grants == undefined || ctx.v1.user.grants.count == 0) {
return;
}
const roles = ctx.v1.user.grants.grants.flatMap(({ roles, projectId }) => roles.map(role => projectId + ':' + role));
api.v1.claims.setClaim('nix:zitadel:custom', JSON.stringify({ roles }));
};
'';
};
};
triggers = [
{
flowType = "customiseToken";
triggerType = "preUserinfoCreation";
actions = ["flattenRoles"];
}
{
flowType = "customiseToken";
triggerType = "preAccessTokenCreation";
actions = ["flattenRoles"];
}
];
};
};
};
communication.matrix.enable = true;
development.forgejo.enable = true;
networking.ssh.enable = true;
networking.caddy.hosts = {
# Expose amarht cloud stuff like this until I have a proper solution
"auth.amarth.cloud" = ''
reverse_proxy http://192.168.1.223:9092
'';
"amarth.cloud" = ''
reverse_proxy http://192.168.1.223:8080
'';
};
media.enable = true;
media.glance.enable = true;
media.mydia.enable = true;
media.nfs.enable = true;
media.jellyfin.enable = true;
media.servarr = {
radarr = {
enable = true;
port = 2001;
rootFolders = [
"/var/media/movies"
];
};
sonarr = {
enable = true;
# debug = true;
port = 2002;
rootFolders = [
"/var/media/series"
];
};
lidarr = {
enable = true;
debug = true;
port = 2003;
rootFolders = [
"/var/media/music"
];
};
prowlarr = {
enable = true;
# debug = true;
port = 2004;
};
};
observability = {
grafana.enable = true;
prometheus.enable = true;
loki.enable = true;
promtail.enable = true;
# uptime-kuma.enable = true;
};
security.vaultwarden = {
enable = true;
database = {
# type = "sqlite";
# file = "/var/lib/vaultwarden/state.db";
type = "postgresql";
host = "localhost";
port = 5432;
sslMode = "disabled";
};
}; };
}; };
supportedFilesystems = ["nfs"]; editor = {
nano.enable = true;
};
}; };
# sneeuwvlok.application.steam.enable = true;
# networking = {
# interfaces.enp2s0 = {
# ipv6.addresses = [
# {
# address = "2a0d:6e00:1dc9:0::dead:beef";
# prefixLength = 64;
# }
# ];
# useDHCP = true;
# };
# defaultGateway = {
# address = "192.168.1.1";
# interface = "enp2s0";
# };
# defaultGateway6 = {
# address = "fe80::1";
# interface = "enp2s0";
# };
# };
# # virtualisation = {
# # containers.enable = true;
# # podman = {
# # enable = true;
# # dockerCompat = true;
# # };
# # oci-containers = {
# # backend = "podman";
# # containers = {
# # homey = {
# # image = "ghcr.io/athombv/homey-shs:latest";
# # autoStart = true;
# # privileged = true;
# # volumes = [
# # "/home/chris/.homey-shs:/homey/user"
# # ];
# # ports = [
# # "4859:4859"
# # ];
# # };
# # };
# # };
# # };
# # sneeuwvlok = {
# # services = {
# # backup.borg.enable = true;
# # authentication.zitadel = {
# # enable = true;
# # organization = {
# # nix = {
# # user = {
# # chris = {
# # email = "chris@kruining.eu";
# # firstName = "Chris";
# # lastName = "Kruining";
# # roles = ["ORG_OWNER"];
# # instanceRoles = ["IAM_OWNER"];
# # };
# # kaas = {
# # email = "chris+kaas@kruining.eu";
# # firstName = "Kaas";
# # lastName = "Kruining";
# # };
# # };
# # project = {
# # ulmo = {
# # projectRoleCheck = true;
# # projectRoleAssertion = true;
# # hasProjectCheck = true;
# # role = {
# # jellyfin = {
# # group = "jellyfin";
# # };
# # jellyfin_admin = {
# # group = "jellyfin";
# # };
# # };
# # assign = {
# # chris = ["jellyfin" "jellyfin_admin"];
# # kaas = ["jellyfin"];
# # };
# # application = {
# # jellyfin = {
# # redirectUris = ["https://jellyfin.kruining.eu/sso/OID/redirect/zitadel"];
# # grantTypes = ["authorizationCode"];
# # responseTypes = ["code"];
# # };
# # forgejo = {
# # redirectUris = ["https://git.amarth.cloud/user/oauth2/zitadel/callback"];
# # grantTypes = ["authorizationCode"];
# # responseTypes = ["code"];
# # };
# # vaultwarden = {
# # redirectUris = ["https://vault.kruining.eu/identity/connect/oidc-signin"];
# # grantTypes = ["authorizationCode"];
# # responseTypes = ["code"];
# # exportMap = {
# # client_id = "SSO_CLIENT_ID";
# # client_secret = "SSO_CLIENT_SECRET";
# # };
# # };
# # matrix = {
# # redirectUris = ["https://matrix.kruining.eu/_synapse/client/oidc/callback"];
# # grantTypes = ["authorizationCode"];
# # responseTypes = ["code"];
# # };
# # mydia = {
# # redirectUris = ["http://localhost:2010/auth/oidc/callback"];
# # grantTypes = ["authorizationCode"];
# # responseTypes = ["code"];
# # };
# # grafana = {
# # redirectUris = ["http://localhost:9001/login/generic_oauth"];
# # grantTypes = ["authorizationCode"];
# # responseTypes = ["code"];
# # };
# # };
# # };
# # convex = {
# # projectRoleCheck = true;
# # projectRoleAssertion = true;
# # hasProjectCheck = true;
# # application = {
# # scry = {
# # redirectUris = ["https://nautical-salamander-320.eu-west-1.convex.cloud/api/auth/callback/zitadel"];
# # grantTypes = ["authorizationCode"];
# # responseTypes = ["code"];
# # };
# # };
# # };
# # };
# # action = {
# # flattenRoles = {
# # script = ''
# # (ctx, api) => {
# # if (ctx.v1.user.grants == undefined || ctx.v1.user.grants.count == 0) {
# # return;
# # }
# # const roles = ctx.v1.user.grants.grants.flatMap(({ roles, projectId }) => roles.map(role => projectId + ':' + role));
# # api.v1.claims.setClaim('nix:zitadel:custom', JSON.stringify({ roles }));
# # };
# # '';
# # };
# # };
# # triggers = [
# # {
# # flowType = "customiseToken";
# # triggerType = "preUserinfoCreation";
# # actions = ["flattenRoles"];
# # }
# # {
# # flowType = "customiseToken";
# # triggerType = "preAccessTokenCreation";
# # actions = ["flattenRoles"];
# # }
# # ];
# # };
# # };
# # };
# # communication.matrix.enable = true;
# # development.forgejo.enable = true;
# # networking.ssh.enable = true;
# # networking.caddy.hosts = {
# # # Expose amarht cloud stuff like this until I have a proper solution
# # "auth.amarth.cloud" = ''
# # reverse_proxy http://192.168.1.223:9092
# # '';
# # "amarth.cloud" = ''
# # reverse_proxy http://192.168.1.223:8080
# # '';
# # };
# # media.enable = true;
# # media.glance.enable = true;
# # media.mydia.enable = true;
# # media.nfs.enable = true;
# # media.jellyfin.enable = true;
# # media.servarr = {
# # radarr = {
# # enable = true;
# # port = 2001;
# # rootFolders = [
# # "/var/media/movies"
# # ];
# # };
# # sonarr = {
# # enable = true;
# # # debug = true;
# # port = 2002;
# # rootFolders = [
# # "/var/media/series"
# # ];
# # };
# # lidarr = {
# # enable = true;
# # debug = true;
# # port = 2003;
# # rootFolders = [
# # "/var/media/music"
# # ];
# # };
# # prowlarr = {
# # enable = true;
# # # debug = true;
# # port = 2004;
# # };
# # };
# # observability = {
# # grafana.enable = true;
# # prometheus.enable = true;
# # loki.enable = true;
# # promtail.enable = true;
# # # uptime-kuma.enable = true;
# # };
# # security.vaultwarden = {
# # enable = true;
# # database = {
# # # type = "sqlite";
# # # file = "/var/lib/vaultwarden/state.db";
# # type = "postgresql";
# # host = "localhost";
# # port = 5432;
# # sslMode = "disabled";
# # };
# # };
# # };
# # editor = {
# # nano.enable = true;
# # };
# # };
} }

View file

@ -1,18 +1,20 @@
{ config, lib, pkgs, modulesPath, ... }:
let
inherit (lib.modules) mkDefault;
in
{ {
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; config,
pkgs,
lib,
modulesPath,
...
}: let
inherit (lib.modules) mkDefault;
in {
boot = { boot = {
initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod" ]; initrd.availableKernelModules = ["xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod"];
initrd.kernelModules = [ ]; initrd.kernelModules = [];
kernelModules = [ "kvm-intel" ]; kernelModules = ["kvm-intel"];
kernelParams = []; kernelParams = [];
extraModulePackages = [ ]; extraModulePackages = [];
}; };
nixpkgs.hostPlatform = mkDefault pkgs.stdenv.hostPlatform.system; nixpkgs.hostPlatform = "x86_64-linux";
hardware.cpu.intel.updateMicrocode = mkDefault config.hardware.enableRedistributableFirmware; hardware.cpu.intel.updateMicrocode = mkDefault config.hardware.enableRedistributableFirmware;
} }

View file

@ -1,15 +1,19 @@
{ inputs, config, lib, pkgs, namespace, ... }: {
let inputs,
config,
lib,
pkgs,
...
}: let
inherit (lib) mkIf mkEnableOption; inherit (lib) mkIf mkEnableOption;
cfg = config.sneeuwvlok.application.bitwarden; cfg = config.sneeuwvlok.application.bitwarden;
in in {
{
options.sneeuwvlok.application.bitwarden = { options.sneeuwvlok.application.bitwarden = {
enable = mkEnableOption "enable bitwarden"; enable = mkEnableOption "enable bitwarden";
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
home.packages = with pkgs; [ bitwarden-desktop ]; home.packages = with pkgs; [bitwarden-desktop];
}; };
} }

View file

@ -3,7 +3,6 @@
config, config,
lib, lib,
pkgs, pkgs,
namespace,
... ...
}: let }: let
inherit (lib) mkIf mkEnableOption; inherit (lib) mkIf mkEnableOption;

View file

@ -3,7 +3,6 @@
config, config,
lib, lib,
pkgs, pkgs,
namespace,
... ...
}: let }: let
inherit (lib) mkIf mkEnableOption; inherit (lib) mkIf mkEnableOption;

View file

@ -1,15 +1,19 @@
{ inputs, config, lib, pkgs, namespace, ... }: {
let inputs,
config,
lib,
pkgs,
...
}: let
inherit (lib) mkIf mkEnableOption; inherit (lib) mkIf mkEnableOption;
cfg = config.sneeuwvlok.application.ladybird; cfg = config.sneeuwvlok.application.ladybird;
in in {
{
options.sneeuwvlok.application.ladybird = { options.sneeuwvlok.application.ladybird = {
enable = mkEnableOption "enable ladybird"; enable = mkEnableOption "enable ladybird";
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
home.packages = with pkgs; [ ladybird ]; home.packages = with pkgs; [ladybird];
}; };
} }

View file

@ -1,16 +1,20 @@
{ config, lib, pkgs, namespace, osConfig ? {}, ... }: {
let config,
lib,
pkgs,
osConfig ? {},
...
}: let
inherit (lib) mkIf mkEnableOption; inherit (lib) mkIf mkEnableOption;
cfg = config.sneeuwvlok.application.matrix; cfg = config.sneeuwvlok.application.matrix;
in in {
{
options.sneeuwvlok.application.matrix = { options.sneeuwvlok.application.matrix = {
enable = mkEnableOption "enable Matrix client (Fractal)"; enable = mkEnableOption "enable Matrix client (Fractal)";
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
home.packages = with pkgs; [ fractal element-desktop ]; home.packages = with pkgs; [fractal element-desktop];
programs.element-desktop = { programs.element-desktop = {
enable = true; enable = true;

View file

@ -2,7 +2,6 @@
config, config,
lib, lib,
pkgs, pkgs,
namespace,
osConfig ? {}, osConfig ? {},
... ...
}: let }: let

View file

@ -3,7 +3,6 @@
config, config,
lib, lib,
pkgs, pkgs,
namespace,
... ...
}: let }: let
inherit (lib) mkIf mkEnableOption; inherit (lib) mkIf mkEnableOption;

View file

@ -1,15 +1,19 @@
{ inputs, config, lib, pkgs, namespace, ... }: {
let inputs,
config,
lib,
pkgs,
...
}: let
inherit (lib) mkIf mkEnableOption; inherit (lib) mkIf mkEnableOption;
cfg = config.sneeuwvlok.application.signal; cfg = config.sneeuwvlok.application.signal;
in in {
{
options.sneeuwvlok.application.signal = { options.sneeuwvlok.application.signal = {
enable = mkEnableOption "enable signal"; enable = mkEnableOption "enable signal";
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
home.packages = with pkgs; [ signal-desktop ]; home.packages = with pkgs; [signal-desktop];
}; };
} }

View file

@ -3,7 +3,6 @@
config, config,
lib, lib,
pkgs, pkgs,
namespace,
... ...
}: let }: let
inherit (lib) mkIf mkEnableOption; inherit (lib) mkIf mkEnableOption;

View file

@ -1,18 +1,18 @@
{ config, lib, pkgs, namespace, repoRoot, erosanixLib, ... }: {
let config,
lib,
self,
...
}: let
inherit (lib) mkIf mkEnableOption; inherit (lib) mkIf mkEnableOption;
cfg = config.sneeuwvlok.application.studio; cfg = config.sneeuwvlok.application.studio;
studioPackage = pkgs.callPackage (repoRoot + "/packages/studio/package.nix") { in {
inherit erosanixLib;
};
in
{
options.sneeuwvlok.application.studio = { options.sneeuwvlok.application.studio = {
enable = mkEnableOption "enable Bricklink Studio"; enable = mkEnableOption "enable Bricklink Studio";
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
home.packages = [ studioPackage ]; home.packages = [self.packages.studio];
}; };
} }

View file

@ -1,10 +1,14 @@
{ inputs, config, lib, pkgs, namespace, ... }: {
let inputs,
config,
lib,
pkgs,
...
}: let
inherit (lib) mkIf mkEnableOption; inherit (lib) mkIf mkEnableOption;
cfg = config.sneeuwvlok.application.teamspeak; cfg = config.sneeuwvlok.application.teamspeak;
in in {
{
options.sneeuwvlok.application.teamspeak = { options.sneeuwvlok.application.teamspeak = {
enable = mkEnableOption "enable teamspeak"; enable = mkEnableOption "enable teamspeak";
}; };

View file

@ -1,10 +1,14 @@
{ inputs, config, lib, pkgs, namespace, ... }: {
let inputs,
config,
lib,
pkgs,
...
}: let
inherit (lib) mkIf mkEnableOption; inherit (lib) mkIf mkEnableOption;
cfg = config.sneeuwvlok.application.thunderbird; cfg = config.sneeuwvlok.application.thunderbird;
in in {
{
options.sneeuwvlok.application.thunderbird = { options.sneeuwvlok.application.thunderbird = {
enable = mkEnableOption "enable thunderbird"; enable = mkEnableOption "enable thunderbird";
}; };
@ -14,7 +18,7 @@ in
enable = true; enable = true;
package = pkgs.thunderbird-latest; package = pkgs.thunderbird-latest;
profiles.chris = { profiles.chris = {
isDefault = true; isDefault = true;
}; };
}; };
@ -30,7 +34,7 @@ in
}; };
thunderbird = { thunderbird = {
enable = true; enable = true;
profiles = [ "chris" ]; profiles = ["chris"];
}; };
}; };

View file

@ -2,7 +2,6 @@
config, config,
lib, lib,
pkgs, pkgs,
namespace,
... ...
}: let }: let
inherit (lib) mkIf mkEnableOption; inherit (lib) mkIf mkEnableOption;

View file

@ -2,7 +2,6 @@
pkgs, pkgs,
config, config,
lib, lib,
namespace,
... ...
}: let }: let
inherit (lib) mkOption; inherit (lib) mkOption;

View file

@ -1,13 +1,15 @@
{ config, lib, namespace, osConfig ? {}, ... }: {
let config,
lib,
osConfig ? {},
...
}: let
inherit (lib) mkIf; inherit (lib) mkIf;
cfg = config.sneeuwvlok.desktop.plasma; cfg = config.sneeuwvlok.desktop.plasma;
osCfg = osConfig.sneeuwvlok.desktop.plasma or { enable = false; }; osCfg = osConfig.sneeuwvlok.desktop.plasma or {enable = false;};
in in {
{
options.sneeuwvlok.desktop.plasma = { options.sneeuwvlok.desktop.plasma = {
}; };
config = mkIf osCfg.enable { config = mkIf osCfg.enable {

View file

@ -1,15 +1,18 @@
{ config, lib, pkgs, namespace, ... }: {
let config,
lib,
pkgs,
...
}: let
inherit (lib) mkEnableOption mkIf; inherit (lib) mkEnableOption mkIf;
cfg = config.sneeuwvlok.development.dotnet; cfg = config.sneeuwvlok.development.dotnet;
in in {
{
options.sneeuwvlok.development.dotnet = { options.sneeuwvlok.development.dotnet = {
enable = mkEnableOption "Enable dotnet development tools"; enable = mkEnableOption "Enable dotnet development tools";
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
home.packages = with pkgs; [ dotnet-sdk_8 ]; home.packages = with pkgs; [dotnet-sdk_8];
}; };
} }

View file

@ -1,15 +1,18 @@
{ config, lib, pkgs, namespace, ... }: {
let config,
lib,
pkgs,
...
}: let
inherit (lib) mkEnableOption mkIf; inherit (lib) mkEnableOption mkIf;
cfg = config.sneeuwvlok.development.javascript; cfg = config.sneeuwvlok.development.javascript;
in in {
{
options.sneeuwvlok.development.javascript = { options.sneeuwvlok.development.javascript = {
enable = mkEnableOption "Enable javascript development tools"; enable = mkEnableOption "Enable javascript development tools";
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
home.packages = with pkgs; [ bun nodejs nodePackages_latest.typescript-language-server ]; home.packages = with pkgs; [bun nodejs nodePackages_latest.typescript-language-server];
}; };
} }

View file

@ -2,7 +2,6 @@
config, config,
lib, lib,
pkgs, pkgs,
namespace,
... ...
}: let }: let
inherit (lib) mkEnableOption mkIf; inherit (lib) mkEnableOption mkIf;

View file

@ -3,7 +3,6 @@
options, options,
lib, lib,
pkgs, pkgs,
namespace,
... ...
}: let }: let
inherit (lib) mkEnableOption mkIf; inherit (lib) mkEnableOption mkIf;

View file

@ -3,7 +3,6 @@
config, config,
lib, lib,
pkgs, pkgs,
namespace,
... ...
}: let }: let
inherit (lib) mkIf mkEnableOption; inherit (lib) mkIf mkEnableOption;

View file

@ -1,4 +1,9 @@
{ config, lib, pkgs, namespace, ... }: let {
config,
lib,
pkgs,
...
}: let
inherit (lib) mkIf mkEnableOption; inherit (lib) mkIf mkEnableOption;
cfg = config.sneeuwvlok.editor.zed; cfg = config.sneeuwvlok.editor.zed;
@ -9,13 +14,16 @@ in {
config = mkIf cfg.enable { config = mkIf cfg.enable {
home.packages = with pkgs; [ home.packages = with pkgs; [
zed-editor nixd nil alejandra zed-editor
nixd
nil
alejandra
]; ];
programs.zed-editor = { programs.zed-editor = {
enable = true; enable = true;
extensions = [ "nix" "toml" "html" "just-ls" ]; extensions = ["nix" "toml" "html" "just-ls"];
userSettings = { userSettings = {
assistant.enabled = false; assistant.enabled = false;

View file

@ -3,7 +3,6 @@
config, config,
lib, lib,
pkgs, pkgs,
namespace,
... ...
}: let }: let
inherit (lib) mkIf mkEnableOption; inherit (lib) mkIf mkEnableOption;

View file

@ -1,10 +1,13 @@
{ config, lib, pkgs, namespace, ... }: {
let config,
lib,
pkgs,
...
}: let
inherit (lib) mkIf mkMerge mkEnableOption mkDefault; inherit (lib) mkIf mkMerge mkEnableOption mkDefault;
cfg = config.sneeuwvlok.shell; cfg = config.sneeuwvlok.shell;
in in {
{
imports = [ imports = [
./toolset ./toolset
./zsh ./zsh
@ -30,8 +33,8 @@ in
}; };
}) })
({ {
home.packages = with pkgs; [ any-nix-shell pwgen yt-dlp ripdrag fd (ripgrep.override {withPCRE2 = true;}) ]; home.packages = with pkgs; [any-nix-shell pwgen yt-dlp ripdrag fd (ripgrep.override {withPCRE2 = true;})];
programs = { programs = {
direnv = { direnv = {
@ -45,6 +48,6 @@ in
config.whitelist.prefix = ["/home"]; config.whitelist.prefix = ["/home"];
}; };
}; };
}) }
]; ];
} }

View file

@ -2,7 +2,6 @@
config, config,
lib, lib,
pkgs, pkgs,
namespace,
... ...
}: let }: let
inherit (lib) mkIf mkEnableOption; inherit (lib) mkIf mkEnableOption;

View file

@ -2,7 +2,6 @@
config, config,
lib, lib,
pkgs, pkgs,
namespace,
... ...
}: let }: let
inherit (lib) mkIf mkEnableOption; inherit (lib) mkIf mkEnableOption;

View file

@ -2,7 +2,6 @@
config, config,
lib, lib,
pkgs, pkgs,
namespace,
... ...
}: let }: let
inherit (lib) mkIf mkEnableOption; inherit (lib) mkIf mkEnableOption;

View file

@ -2,7 +2,6 @@
config, config,
lib, lib,
pkgs, pkgs,
namespace,
... ...
}: let }: let
inherit (lib) mkIf mkEnableOption; inherit (lib) mkIf mkEnableOption;

View file

@ -2,7 +2,6 @@
config, config,
lib, lib,
pkgs, pkgs,
namespace,
... ...
}: let }: let
inherit (lib) mkEnableOption mkIf; inherit (lib) mkEnableOption mkIf;

View file

@ -2,7 +2,6 @@
config, config,
lib, lib,
pkgs, pkgs,
namespace,
... ...
}: let }: let
inherit (lib) mkIf mkEnableOption; inherit (lib) mkIf mkEnableOption;

View file

@ -2,7 +2,6 @@
config, config,
lib, lib,
pkgs, pkgs,
namespace,
... ...
}: let }: let
inherit (lib) mkEnableOption mkIf; inherit (lib) mkEnableOption mkIf;

View file

@ -1,16 +1,19 @@
{ config, lib, pkgs, namespace, ... }: {
let config,
lib,
pkgs,
...
}: let
inherit (lib) mkIf mkEnableOption; inherit (lib) mkIf mkEnableOption;
cfg = config.sneeuwvlok.shell.toolset.starship; cfg = config.sneeuwvlok.shell.toolset.starship;
in in {
{
options.sneeuwvlok.shell.toolset.starship = { options.sneeuwvlok.shell.toolset.starship = {
enable = mkEnableOption "fancy pansy shell prompt"; enable = mkEnableOption "fancy pansy shell prompt";
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
home.packages = with pkgs; [ starship ]; home.packages = with pkgs; [starship];
programs.starship = { programs.starship = {
enable = true; enable = true;

View file

@ -1,16 +1,19 @@
{ config, lib, pkgs, namespace, ... }: {
let config,
lib,
pkgs,
...
}: let
inherit (lib) mkIf mkEnableOption; inherit (lib) mkIf mkEnableOption;
cfg = config.sneeuwvlok.shell.toolset.tmux; cfg = config.sneeuwvlok.shell.toolset.tmux;
in in {
{ options.sneeuwvlok.shell.toolset.tmux = {
options.sneeuwvlok.shell.toolset.tmux = { enable = mkEnableOption "terminal multiplexer";
enable = mkEnableOption "terminal multiplexer";
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
home.packages = with pkgs; [ tmux ]; home.packages = with pkgs; [tmux];
programs.tmux = { programs.tmux = {
enable = true; enable = true;

View file

@ -2,7 +2,6 @@
config, config,
lib, lib,
pkgs, pkgs,
namespace,
... ...
}: let }: let
inherit (lib) mkIf mkEnableOption; inherit (lib) mkIf mkEnableOption;

View file

@ -1,16 +1,19 @@
{ config, lib, pkgs, namespace, ... }: {
let config,
lib,
pkgs,
...
}: let
inherit (lib) mkIf mkEnableOption; inherit (lib) mkIf mkEnableOption;
cfg = config.sneeuwvlok.shell.toolset.zellij; cfg = config.sneeuwvlok.shell.toolset.zellij;
in in {
{
options.sneeuwvlok.shell.toolset.zellij = { options.sneeuwvlok.shell.toolset.zellij = {
enable = mkEnableOption "terminal multiplexer"; enable = mkEnableOption "terminal multiplexer";
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
home.packages = with pkgs; [ zellij ]; home.packages = with pkgs; [zellij];
programs.zellij = { programs.zellij = {
enable = true; enable = true;

View file

@ -2,7 +2,6 @@
config, config,
lib, lib,
pkgs, pkgs,
namespace,
... ...
}: let }: let
inherit (lib) mkIf mkEnableOption; inherit (lib) mkIf mkEnableOption;

View file

@ -1,10 +1,13 @@
{ config, lib, pkgs, namespace, ... }: {
let config,
lib,
pkgs,
...
}: let
inherit (lib) mkIf mkEnableOption; inherit (lib) mkIf mkEnableOption;
cfg = config.sneeuwvlok.shell.zsh; cfg = config.sneeuwvlok.shell.zsh;
in in {
{
options.sneeuwvlok.shell.zsh = { options.sneeuwvlok.shell.zsh = {
enable = mkEnableOption "enable ZSH"; enable = mkEnableOption "enable ZSH";
}; };

View file

@ -1,7 +1,6 @@
{ {
config, config,
lib, lib,
namespace,
... ...
}: let }: let
inherit (lib) mkIf mkEnableOption; inherit (lib) mkIf mkEnableOption;

View file

@ -1,7 +1,6 @@
{ {
config, config,
lib, lib,
namespace,
... ...
}: let }: let
inherit (lib) mkIf mkEnableOption; inherit (lib) mkIf mkEnableOption;

View file

@ -2,7 +2,6 @@
config, config,
lib, lib,
pkgs, pkgs,
namespace,
osConfig ? {}, osConfig ? {},
... ...
}: let }: let

View file

@ -12,7 +12,7 @@ in {
enable = mkEnableOption "enable steam"; enable = mkEnableOption "enable steam";
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
environment.systemPackages = with pkgs; [steam]; # environment.systemPackages = with pkgs; [steam];
programs = { programs = {
steam = { steam = {

View file

@ -1,7 +1,6 @@
{ {
inputs, inputs,
lib, lib,
namespace,
config, config,
pkgs, pkgs,
... ...

View file

@ -1,7 +1,6 @@
{ {
lib, lib,
config, config,
namespace,
inputs, inputs,
... ...
}: let }: let

View file

@ -1,7 +1,6 @@
{ {
lib, lib,
config, config,
namespace,
... ...
}: let }: let
inherit (lib) mkIf mkOption mkEnableOption mkMerge; inherit (lib) mkIf mkOption mkEnableOption mkMerge;

View file

@ -1,7 +1,6 @@
{ {
lib, lib,
config, config,
namespace,
... ...
}: let }: let
inherit (lib) mkIf mkEnableOption mkForce; inherit (lib) mkIf mkEnableOption mkForce;

View file

@ -1,7 +1,6 @@
{ {
lib, lib,
config, config,
namespace,
... ...
}: let }: let
inherit (lib) mkIf mkEnableOption; inherit (lib) mkIf mkEnableOption;

View file

@ -2,7 +2,6 @@
pkgs, pkgs,
lib, lib,
config, config,
namespace,
... ...
}: let }: let
inherit (lib) mkIf mkEnableOption; inherit (lib) mkIf mkEnableOption;

View file

@ -1,10 +1,14 @@
{ config, options, lib, pkgs, namespace, ... }: {
let config,
options,
lib,
pkgs,
...
}: let
inherit (lib) mkEnableOption mkIf; inherit (lib) mkEnableOption mkIf;
cfg = config.sneeuwvlok.editor.nano; cfg = config.sneeuwvlok.editor.nano;
in in {
{
options.sneeuwvlok.editor.nano = { options.sneeuwvlok.editor.nano = {
enable = mkEnableOption "nano"; enable = mkEnableOption "nano";
}; };

View file

@ -1,14 +1,18 @@
{ config, lib, pkgs, namespace, ... }: {
let config,
lib,
pkgs,
...
}: let
inherit (lib) mkIf mkEnableOption; inherit (lib) mkIf mkEnableOption;
cfg = config.sneeuwvlok.editor.nvim; cfg = config.sneeuwvlok.editor.nvim;
in in {
{
options.sneeuwvlok.editor.nvim = { options.sneeuwvlok.editor.nvim = {
enable = mkEnableOption "enable nvim via nvf on system level"; enable = mkEnableOption "enable nvim via nvf on system level";
}; };
config = mkIf cfg.enable { config =
}; mkIf cfg.enable {
};
} }

View file

@ -1,10 +1,13 @@
{ pkgs, lib, namespace, config, ... }: {
let pkgs,
lib,
config,
...
}: let
inherit (lib) mkIf mkEnableOption; inherit (lib) mkIf mkEnableOption;
cfg = config.sneeuwvlok.hardware.has.audio; cfg = config.sneeuwvlok.hardware.has.audio;
in in {
{
options.sneeuwvlok.hardware.has.audio = mkEnableOption "Enable bluetooth"; options.sneeuwvlok.hardware.has.audio = mkEnableOption "Enable bluetooth";
config = mkIf cfg { config = mkIf cfg {

View file

@ -1,10 +1,12 @@
{ lib, namespace, config, ... }: {
let lib,
config,
...
}: let
inherit (lib) mkIf mkEnableOption; inherit (lib) mkIf mkEnableOption;
cfg = config.sneeuwvlok.hardware.has.bluetooth; cfg = config.sneeuwvlok.hardware.has.bluetooth;
in in {
{
options.sneeuwvlok.hardware.has.bluetooth = mkEnableOption "Enable bluetooth"; options.sneeuwvlok.hardware.has.bluetooth = mkEnableOption "Enable bluetooth";
config = mkIf cfg { config = mkIf cfg {
@ -21,7 +23,7 @@ in
"bluez5.enable-sbc-xq" = true; "bluez5.enable-sbc-xq" = true;
"bluez5.enable-msbc" = true; "bluez5.enable-msbc" = true;
"bluez5.enable-hw-volume" = true; "bluez5.enable-hw-volume" = true;
"bluez5.roles" = [ "hsp_hs" "hsp_ag" "hfp_hf" "hfp_ag" ]; "bluez5.roles" = ["hsp_hs" "hsp_ag" "hfp_hf" "hfp_ag"];
}; };
}; };
}; };

View file

@ -1,7 +1,6 @@
{ {
pkgs, pkgs,
lib, lib,
namespace,
config, config,
... ...
}: let }: let

View file

@ -1,14 +1,17 @@
{ pkgs, lib, namespace, config, ... }: {
let pkgs,
lib,
config,
...
}: let
inherit (lib) mkIf mkEnableOption; inherit (lib) mkIf mkEnableOption;
cfg = config.sneeuwvlok.hardware.has.gpu.nvidia; cfg = config.sneeuwvlok.hardware.has.gpu.nvidia;
in in {
{
options.sneeuwvlok.hardware.has.gpu.nvidia = mkEnableOption "Enable NVidia gpu configuration"; options.sneeuwvlok.hardware.has.gpu.nvidia = mkEnableOption "Enable NVidia gpu configuration";
config = mkIf cfg { config = mkIf cfg {
services.xserver.videoDrivers = [ "nvidia" ]; services.xserver.videoDrivers = ["nvidia"];
hardware = { hardware = {
graphics = { graphics = {

View file

@ -1,7 +1,6 @@
{ {
pkgs, pkgs,
lib, lib,
namespace,
config, config,
... ...
}: let }: let

View file

@ -2,7 +2,6 @@
lib, lib,
config, config,
pkgs, pkgs,
namespace,
... ...
}: let }: let
inherit (lib) mkIf mkEnableOption; inherit (lib) mkIf mkEnableOption;

View file

@ -1,7 +1,6 @@
{ {
pkgs, pkgs,
lib, lib,
namespace,
config, config,
... ...
}: let }: let

View file

@ -2,7 +2,6 @@
config, config,
lib, lib,
pkgs, pkgs,
namespace,
... ...
}: let }: let
inherit (lib) mkIf mkEnableOption; inherit (lib) mkIf mkEnableOption;

View file

@ -1,7 +1,6 @@
{ {
lib, lib,
config, config,
namespace,
... ...
}: let }: let
inherit (lib) mkEnableOption mkIf; inherit (lib) mkEnableOption mkIf;

View file

@ -1,7 +1,7 @@
{ config, lib, pkgs, namespace, terranixLib, sneeuwvlokLib, ... }: { config, lib, pkgs, self, ... }:
let let
inherit (lib) mkIf mkEnableOption mkOption types toUpper toSentenceCase nameValuePair mapAttrs mapAttrs' concatMapAttrs concatMapStringsSep filterAttrsRecursive listToAttrs imap0 head drop length literalExpression attrNames; inherit (lib) mkIf mkEnableOption mkOption types toUpper toSentenceCase nameValuePair mapAttrs mapAttrs' concatMapAttrs concatMapStringsSep filterAttrsRecursive listToAttrs imap0 head drop length literalExpression attrNames;
inherit (sneeuwvlokLib.strings) toSnakeCase; inherit ((import ../../../../../lib/strings { inherit lib;}).strings) toSnakeCase;
cfg = config.sneeuwvlok.services.authentication.zitadel; cfg = config.sneeuwvlok.services.authentication.zitadel;
@ -339,7 +339,7 @@ in
config' = config; config' = config;
# this is a nix package, the generated json file to be exact # this is a nix package, the generated json file to be exact
terraformConfiguration = terranixLib.terranixConfiguration { terraformConfiguration = self.inputs.terranix.lib.terranixConfiguration {
system = pkgs.stdenv.hostPlatform.system; system = pkgs.stdenv.hostPlatform.system;
modules = [ modules = [

View file

@ -1,10 +1,13 @@
{ config, lib, pkgs, namespace, ... }: {
let config,
lib,
pkgs,
...
}: let
inherit (lib) mkIf mkEnableOption; inherit (lib) mkIf mkEnableOption;
cfg = config.sneeuwvlok.services.backup.borg; cfg = config.sneeuwvlok.services.backup.borg;
in in {
{
options.sneeuwvlok.services.backup.borg = { options.sneeuwvlok.services.backup.borg = {
enable = mkEnableOption "Borg Backup"; enable = mkEnableOption "Borg Backup";
}; };

View file

@ -2,7 +2,6 @@
config, config,
lib, lib,
pkgs, pkgs,
namespace,
... ...
}: let }: let
inherit (builtins) toString toJSON; inherit (builtins) toString toJSON;

View file

@ -2,7 +2,6 @@
config, config,
lib, lib,
pkgs, pkgs,
namespace,
... ...
}: let }: let
inherit (builtins) toString; inherit (builtins) toString;

View file

@ -2,7 +2,6 @@
config, config,
lib, lib,
pkgs, pkgs,
namespace,
... ...
}: let }: let
inherit (lib) mkIf mkEnableOption mkOption; inherit (lib) mkIf mkEnableOption mkOption;

View file

@ -2,7 +2,6 @@
config, config,
lib, lib,
pkgs, pkgs,
namespace,
... ...
}: let }: let
inherit (lib) mkIf mkEnableOption; inherit (lib) mkIf mkEnableOption;

View file

@ -1,7 +1,6 @@
{ {
config, config,
lib, lib,
namespace,
... ...
}: let }: let
inherit (lib) mkIf mkEnableOption; inherit (lib) mkIf mkEnableOption;

View file

@ -1,7 +1,6 @@
{ {
pkgs, pkgs,
lib, lib,
namespace,
config, config,
... ...
}: let }: let

View file

@ -1,7 +1,6 @@
{ {
config, config,
lib, lib,
namespace,
... ...
}: let }: let
inherit (lib) mkIf mkEnableOption; inherit (lib) mkIf mkEnableOption;

View file

@ -2,7 +2,6 @@
pkgs, pkgs,
config, config,
lib, lib,
namespace,
inputs, inputs,
... ...
}: let }: let

View file

@ -1,7 +1,6 @@
{ {
config, config,
lib, lib,
namespace,
... ...
}: let }: let
inherit (lib) mkIf mkEnableOption; inherit (lib) mkIf mkEnableOption;

View file

@ -2,7 +2,6 @@
config, config,
lib, lib,
pkgs, pkgs,
namespace,
... ...
}: let }: let
inherit (lib) mkIf mkEnableOption mkOption; inherit (lib) mkIf mkEnableOption mkOption;

View file

@ -1,16 +1,18 @@
{ config, lib, namespace, ... }: {
let config,
lib,
...
}: let
inherit (lib) mkIf mkEnableOption; inherit (lib) mkIf mkEnableOption;
cfg = config.sneeuwvlok.services.media.nfs; cfg = config.sneeuwvlok.services.media.nfs;
in in {
{
options.sneeuwvlok.services.media.nfs = { options.sneeuwvlok.services.media.nfs = {
enable = mkEnableOption "Enable NFS"; enable = mkEnableOption "Enable NFS";
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
networking.firewall.allowedTCPPorts = [ 2049 ]; networking.firewall.allowedTCPPorts = [2049];
services.nfs.server = { services.nfs.server = {
enable = true; enable = true;

View file

@ -2,8 +2,7 @@
pkgs, pkgs,
config, config,
lib, lib,
namespace, self,
terranixLib,
... ...
}: let }: let
inherit (builtins) toString; inherit (builtins) toString;
@ -154,7 +153,7 @@ in {
config' = config; config' = config;
lib' = lib; lib' = lib;
terraformConfiguration = terranixLib.terranixConfiguration { terraformConfiguration = self.inputs.terranix.lib.terranixConfiguration {
system = pkgs.stdenv.hostPlatform.system; system = pkgs.stdenv.hostPlatform.system;
modules = [ modules = [

View file

@ -2,7 +2,6 @@
config, config,
pkgs, pkgs,
lib, lib,
namespace,
... ...
}: let }: let
inherit (builtins) length; inherit (builtins) length;
@ -12,7 +11,7 @@
hasHosts = (cfg.hosts |> attrNames |> length) > 0; hasHosts = (cfg.hosts |> attrNames |> length) > 0;
caddyPackage = pkgs.caddy.withPlugins { caddyPackage = pkgs.caddy.withPlugins {
plugins = ["github.com/corazawaf/coraza-caddy/v2@v2.1.0"]; plugins = ["github.com/corazawaf/coraza-caddy/v2@v2.1.0"];
hash = "sha256-rsDnTunR8C7hVOX5aKcba+iFYHbpWek65DZgbMxOdTs="; hash = "sha256-pSXjLaZoRtKV3eFl2ySRSjl3yxi514G1Cb7pfrpxxtE=";
}; };
in { in {
options.sneeuwvlok.services.networking.caddy = { options.sneeuwvlok.services.networking.caddy = {

View file

@ -1,7 +1,6 @@
{ {
config, config,
lib, lib,
namespace,
... ...
}: let }: let
inherit (lib.modules) mkIf; inherit (lib.modules) mkIf;

View file

@ -2,7 +2,6 @@
config, config,
pkgs, pkgs,
lib, lib,
namespace,
... ...
}: let }: let
inherit (builtins) length; inherit (builtins) length;
@ -29,6 +28,7 @@ in {
}; };
}; };
}); });
default = {};
}; };
}; };

View file

@ -2,7 +2,6 @@
pkgs, pkgs,
config, config,
lib, lib,
namespace,
... ...
}: let }: let
inherit (lib.modules) mkIf; inherit (lib.modules) mkIf;

View file

@ -2,7 +2,6 @@
pkgs, pkgs,
config, config,
lib, lib,
namespace,
... ...
}: let }: let
inherit (lib.modules) mkIf; inherit (lib.modules) mkIf;

View file

@ -1,11 +1,14 @@
{ pkgs, config, lib, namespace, ... }: {
let pkgs,
config,
lib,
...
}: let
inherit (builtins) toString; inherit (builtins) toString;
inherit (lib) mkIf mkEnableOption; inherit (lib) mkIf mkEnableOption;
cfg = config.sneeuwvlok.services.observability.prometheus; cfg = config.sneeuwvlok.services.observability.prometheus;
in in {
{
options.sneeuwvlok.services.observability.prometheus = { options.sneeuwvlok.services.observability.prometheus = {
enable = mkEnableOption "enable Prometheus"; enable = mkEnableOption "enable Prometheus";
}; };
@ -21,14 +24,14 @@ in
{ {
job_name = "prometheus"; job_name = "prometheus";
static_configs = [ static_configs = [
{ targets = [ "localhost:9002" ]; } {targets = ["localhost:9002"];}
]; ];
} }
{ {
job_name = "node"; job_name = "node";
static_configs = [ static_configs = [
{ targets = [ "localhost:${toString config.services.prometheus.exporters.node.port}" ]; } {targets = ["localhost:${toString config.services.prometheus.exporters.node.port}"];}
]; ];
} }
]; ];
@ -37,12 +40,12 @@ in
node = { node = {
enable = true; enable = true;
port = 9005; port = 9005;
enabledCollectors = [ "systemd" ]; enabledCollectors = ["systemd"];
openFirewall = true; openFirewall = true;
}; };
}; };
}; };
networking.firewall.allowedTCPPorts = [ 9002 ]; networking.firewall.allowedTCPPorts = [9002];
}; };
} }

View file

@ -2,7 +2,6 @@
pkgs, pkgs,
config, config,
lib, lib,
namespace,
... ...
}: let }: let
inherit (lib.modules) mkIf; inherit (lib.modules) mkIf;

View file

@ -2,7 +2,6 @@
pkgs, pkgs,
config, config,
lib, lib,
namespace,
... ...
}: let }: let
inherit (builtins) toString; inherit (builtins) toString;

View file

@ -2,7 +2,6 @@
config, config,
lib, lib,
pkgs, pkgs,
namespace,
... ...
}: let }: let
inherit (lib) mkIf mkEnableOption; inherit (lib) mkIf mkEnableOption;

View file

@ -2,13 +2,12 @@
pkgs, pkgs,
config, config,
lib, lib,
namespace, self,
repoRoot,
sneeuwvlokLib,
... ...
}: let }: let
inherit (builtins) toString; inherit (builtins) toString;
inherit (lib) mkIf mkEnableOption mkOption types getAttrs toUpper concatMapAttrsStringSep; inherit (lib) mkIf mkEnableOption mkOption types getAttrs toUpper concatMapAttrsStringSep;
inherit (import ../../../../../lib/strings {inherit lib;}) strings;
cfg = config.sneeuwvlok.services.security.vaultwarden; cfg = config.sneeuwvlok.services.security.vaultwarden;
@ -27,15 +26,22 @@
}; };
}); });
databaseProviderPostgresql = types.submodule ({...}: let databaseProviderPostgresql = types.submodule ({...}: {
urlOptions = sneeuwvlokLib.options.mkUrlOptions { options = {
host = { type = mkOption {
type = types.enum ["postgresql"];
};
host = mkOption {
type = types.str;
example = "host.tld";
description = '' description = ''
Hostname of the postgresql server Hostname of the postgresql server
''; '';
}; };
port = { port = mkOption {
type = types.port;
default = 5432; default = 5432;
example = "5432"; example = "5432";
description = '' description = ''
@ -44,38 +50,34 @@
}; };
protocol = mkOption { protocol = mkOption {
type = types.str;
default = "postgres"; default = "postgres";
example = "postgres"; example = "postgres";
description = ''
Which protocol to use when creating a url string
'';
};
sslMode = mkOption {
type = types.enum ["verify-ca" "verify-full" "require" "prefer" "allow" "disabled"];
default = "verify-full";
example = "verify-ca";
description = ''
How to verify the server's ssl
| mode | eavesdropping protection | MITM protection | Statement |
|-------------|--------------------------|----------------------|---------------------------------------------------------------------------------------------------------------------------------------------|
| disable | No | No | I don't care about security, and I don't want to pay the overhead of encryption. |
| allow | Maybe | No | I don't care about security, but I will pay the overhead of encryption if the server insists on it. |
| prefer | Maybe | No | I don't care about encryption, but I wish to pay the overhead of encryption if the server supports it. |
| require | Yes | No | I want my data to be encrypted, and I accept the overhead. I trust that the network will make sure I always connect to the server I want. |
| verify-ca | Yes | Depends on CA policy | I want my data encrypted, and I accept the overhead. I want to be sure that I connect to a server that I trust. |
| verify-full | Yes | Yes | I want my data encrypted, and I accept the overhead. I want to be sure that I connect to a server I trust, and that it's the one I specify. |
[Source](https://www.postgresql.org/docs/current/libpq-ssl.html#LIBPQ-SSL-SSLMODE-STATEMENTS)
'';
}; };
}; };
in {
options =
{
type = mkOption {
type = types.enum ["postgresql"];
};
sslMode = mkOption {
type = types.enum ["verify-ca" "verify-full" "require" "prefer" "allow" "disabled"];
default = "verify-full";
example = "verify-ca";
description = ''
How to verify the server's ssl
| mode | eavesdropping protection | MITM protection | Statement |
|-------------|--------------------------|----------------------|---------------------------------------------------------------------------------------------------------------------------------------------|
| disable | No | No | I don't care about security, and I don't want to pay the overhead of encryption. |
| allow | Maybe | No | I don't care about security, but I will pay the overhead of encryption if the server insists on it. |
| prefer | Maybe | No | I don't care about encryption, but I wish to pay the overhead of encryption if the server supports it. |
| require | Yes | No | I want my data to be encrypted, and I accept the overhead. I trust that the network will make sure I always connect to the server I want. |
| verify-ca | Yes | Depends on CA policy | I want my data encrypted, and I accept the overhead. I want to be sure that I connect to a server that I trust. |
| verify-full | Yes | Yes | I want my data encrypted, and I accept the overhead. I want to be sure that I connect to a server I trust, and that it's the one I specify. |
[Source](https://www.postgresql.org/docs/current/libpq-ssl.html#LIBPQ-SSL-SSLMODE-STATEMENTS)
'';
};
}
// (urlOptions |> getAttrs ["protocol" "host" "port"]);
}); });
in { in {
options.sneeuwvlok.services.security.vaultwarden = { options.sneeuwvlok.services.security.vaultwarden = {
@ -120,7 +122,7 @@ in {
enable = true; enable = true;
dbBackend = "postgresql"; dbBackend = "postgresql";
package = pkgs.callPackage (repoRoot + "/packages/vaultwarden/package.nix") {}; package = pkgs.vaultwarden-postgresql;
config = { config = {
SIGNUPS_ALLOWED = false; SIGNUPS_ALLOWED = false;
@ -198,7 +200,7 @@ in {
else if type == "postgresql" else if type == "postgresql"
then { then {
inherit (db) type; inherit (db) type;
url = sneeuwvlokLib.strings.toUrl { url = strings.toUrl {
inherit (db) protocol host port; inherit (db) protocol host port;
path = "vaultwarden"; path = "vaultwarden";
query = { query = {

View file

@ -3,7 +3,6 @@
options, options,
lib, lib,
pkgs, pkgs,
namespace,
... ...
}: let }: let
inherit (lib) mkIf mkEnableOption; inherit (lib) mkIf mkEnableOption;

View file

@ -3,7 +3,6 @@
config, config,
lib, lib,
pkgs, pkgs,
namespace,
... ...
}: let }: let
inherit (lib) mkIf mkEnableOption; inherit (lib) mkIf mkEnableOption;

View file

@ -1,10 +1,13 @@
{ config, lib, pkgs, namespace, ... }: {
let config,
lib,
pkgs,
...
}: let
inherit (lib) mkDefault; inherit (lib) mkDefault;
cfg = config.sneeuwvlok.system.networking; cfg = config.sneeuwvlok.system.networking;
in in {
{
options.sneeuwvlok.system.networking = {}; options.sneeuwvlok.system.networking = {};
config = { config = {

View file

@ -1,6 +1,5 @@
{ {
config, config,
namespace,
inputs, inputs,
... ...
}: let }: let

View file

@ -1,7 +1,6 @@
{...}: { {...}: {
flake.modules.nixos.sneeuwvlok.system.security = { flake.modules.nixos.sneeuwvlok.system.security = {
config, config,
namespace,
inputs, inputs,
... ...
}: let }: let

View file

@ -1,8 +1,7 @@
{ {
pkgs, pkgs,
config, config,
namespace, self,
repoRoot,
... ...
}: let }: let
cfg = config.sneeuwvlok.system.security.sops; cfg = config.sneeuwvlok.system.security.sops;
@ -14,7 +13,7 @@ in {
sops = { sops = {
defaultSopsFormat = "yaml"; defaultSopsFormat = "yaml";
defaultSopsFile = repoRoot + "/systems/${pkgs.stdenv.hostPlatform.system}/${config.networking.hostName}/secrets.yml"; defaultSopsFile = self + "/systems/${pkgs.stdenv.hostPlatform.system}/${config.networking.hostName}/secrets.yml";
age = { age = {
# keyFile = "~/.config/sops/age/keys.txt"; # keyFile = "~/.config/sops/age/keys.txt";

View file

@ -1,8 +1,6 @@
{ config, namespace, ... }: {config, ...}: let
let
cfg = config.sneeuwvlok.system.security.sudo; cfg = config.sneeuwvlok.system.security.sudo;
in in {
{
options.sneeuwvlok.system.security.sudo = {}; options.sneeuwvlok.system.security.sudo = {};
config = { config = {
@ -11,7 +9,7 @@ in
enable = false; enable = false;
execWheelOnly = true; execWheelOnly = true;
}; };
sudo-rs = { sudo-rs = {
enable = true; enable = true;
execWheelOnly = true; execWheelOnly = true;
@ -19,4 +17,4 @@ in
}; };
}; };
}; };
} }