fix: fix all the missed errors again

This commit is contained in:
leonhard committed 2026-11-13 14:33:33 +01:00
1 parent cf6f3772ab
commit cad486346a
6 files changed
+84 -58

No files matched your search

+19
View File
@@ -1,5 +1,17 @@
{
lib,
config,
osConfig ? null,
...
}:
let
mkDefaultSharedAttrs =
base: defaults: lib.mapAttrs (_: v: lib.mkDefault v) (lib.filterAttrs (k: _: base ? ${k}) defaults);
in
{ {
imports = [ imports = [
../options.nix
./git.nix ./git.nix
./firefox.nix ./firefox.nix
./fish.nix ./fish.nix
@@ -15,4 +27,11 @@
}; };
xdg.enable = true; xdg.enable = true;
nix-leonhard = lib.mkIf (osConfig != null) (
mkDefaultSharedAttrs config.nix-leonhard (osConfig.nix-leonhard or { })
);
# https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion
home.stateVersion = "25.11";
} }
+5 -3
View File
@@ -14,17 +14,19 @@ let
inherit specialArgs; inherit specialArgs;
modules = modules ++ [ modules = modules ++ [
../system ../system
../options.nix
inputs.home-manager.nixosModules.home-manager inputs.home-manager.nixosModules.home-manager
{ {
home-manager.useGlobalPkgs = true; home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true; home-manager.useUserPackages = true;
home-manager.users.leonhard = ../home/default.nix; home-manager.users.leonhard = ../home;
} }
]; ];
}; };
in in
{ {
desktop = mkNixosSystem [ ./desktop ]; desktop = mkNixosSystem [ ./desktop ];
server = mkNixosSystem [ ./server ]; server = mkNixosSystem [
./server
inputs.sops-nix.nixosModules.sops
];
} }
+58 -51
View File
@@ -12,70 +12,77 @@
./vaultwarden.nix ./vaultwarden.nix
]; ];
options.nix-leonhard.domain = options.nix-leonhard = with lib.types; {
with lib.types; domain = lib.mkOption {
lib.mkOption {
type = str; type = str;
default = ""; default = "";
description = "Domain of the device."; description = "Domain of the device.";
}; };
publicKeys = lib.mkOption {
nix-leonhard.graphical = false; type = listOf str;
default = [ ];
users.users.leonhard = { description = "Public keys for ssh login.";
initialPassword = "leonhard"; };
isNormalUser = true;
extraGroups = [ "wheel" ];
openssh.authorizedKeys.keys = config.nix-leonhard.publicKeys;
}; };
networking = { config = {
hostName = "server"; nix-leonhard.graphical = false;
firewall.enable = false;
interfaces.eno1 = { users.users.leonhard = {
ipv4.addresses = [ initialPassword = "leonhard";
{ isNormalUser = true;
address = "192.168.178.210"; extraGroups = [ "wheel" ];
prefixLength = 24; openssh.authorizedKeys.keys = config.nix-leonhard.publicKeys;
} };
networking = {
hostName = "server";
firewall.enable = false;
interfaces.eno1 = {
ipv4.addresses = [
{
address = "192.168.178.210";
prefixLength = 24;
}
];
};
defaultGateway = {
address = "192.168.178.1";
interface = "eno1";
};
nameservers = [
"1.1.1.1"
"8.8.8.8"
]; ];
}; };
defaultGateway = {
address = "192.168.178.1"; services.openssh = {
interface = "eno1"; enable = true;
ports = [ 5432 ];
settings = {
PasswordAuthentication = false;
KbdInteractiveAuthentication = false;
PermitRootLogin = "no";
};
}; };
nameservers = [
"1.1.1.1"
"8.8.8.8"
];
};
services.openssh = { security.acme = {
enable = true; acceptTerms = true;
ports = [ 5432 ]; defaults.email = "admin@${config.nix-leonhard.domain}";
settings = { defaults.webroot = "/var/lib/acme/acme-challenge/";
PasswordAuthentication = false; certs.${config.nix-leonhard.domain} = {
KbdInteractiveAuthentication = false; group = config.services.nginx.group;
PermitRootLogin = "no"; };
}; };
};
security.acme = { services.nginx = {
acceptTerms = true; enable = true;
defaults.email = "admin@${config.nix-leonhard.domain}";
defaults.webroot = "/var/lib/acme/acme-challenge/";
certs.${config.nix-leonhard.domain} = {
group = config.services.nginx.group;
};
};
services.nginx = { virtualHosts.${config.nix-leonhard.domain} = {
enable = true; forceSSL = true;
useACMEHost = config.nix-leonhard.domain;
virtualHosts.${config.nix-leonhard.domain} = { locations."/.well-known/".root = config.security.acme.defaults.webroot;
forceSSL = true; };
useACMEHost = config.nix-leonhard.domain;
locations."/.well-known/".root = config.security.acme.defaults.webroot;
}; };
}; };
} }
-3
View File
@@ -23,7 +23,4 @@
}; };
programs.home-manager.enable = true; programs.home-manager.enable = true;
# https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion
home.stateVersion = "25.11";
} }
-1
View File
@@ -14,7 +14,6 @@ homeManagerConfiguration {
modules = [ modules = [
./base.nix ./base.nix
../home ../home
../options.nix
{ {
nix-leonhard.graphical = false; nix-leonhard.graphical = false;
nix-leonhard.neovim.enable = true; nix-leonhard.neovim.enable = true;
+2
View File
@@ -4,6 +4,8 @@
}: }:
{ {
imports = [ imports = [
../options.nix
./fish.nix ./fish.nix
./hyprland.nix ./hyprland.nix
./ly.nix ./ly.nix