Compare commits

...
15 Commits
14 changed files with 331 additions and 80 deletions

No files matched your search

Generated
+52 -17
View File
@@ -7,11 +7,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1779135526, "lastModified": 1781152676,
"narHash": "sha256-glCununz6lmaK5fs2X946HA3EkNxB2JagdAAvInuRYU=", "narHash": "sha256-RxWs5ND31KzTG7wvMM+PMfUjyNpmIEr999lqNARaM5o=",
"owner": "nix-community", "owner": "nix-community",
"repo": "disko", "repo": "disko",
"rev": "d405a179887d52b24c0ddd31e09a150bd1f66779", "rev": "ff8702b4de27f72b4c78573dfb89ec74e36abdf1",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -27,11 +27,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1779157263, "lastModified": 1788355065,
"narHash": "sha256-VbiyZkRf8/qr7ObmlyfOHJsNAW5tyZ4MB1+cUwAwdrw=", "narHash": "sha256-gAz5oTI7ur34CfuakQduiQd/2ZhO62Bn2XXg08nZYYQ=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "866412a19866b4a8e32d2306a118040afa2b840c", "rev": "d9d750e4fc11c10cab2da677bdd31e427f3a3a71",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -80,6 +80,24 @@
"type": "github" "type": "github"
} }
}, },
"nix-vscode-extensions": {
"inputs": {
"nixpkgs": "nixpkgs_2"
},
"locked": {
"lastModified": 1791695179,
"narHash": "sha256-m4AV3cIczSMgWJpF85UhqCea5FilfvwrIJm5UwLZbmA=",
"owner": "nix-community",
"repo": "nix-vscode-extensions",
"rev": "f91eac91132b84a439a04ff983aabafa039bedd6",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "nix-vscode-extensions",
"type": "github"
}
},
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1768564909, "lastModified": 1768564909,
@@ -98,27 +116,43 @@
}, },
"nixpkgs-stable": { "nixpkgs-stable": {
"locked": { "locked": {
"lastModified": 1767313136, "lastModified": 1788297115,
"narHash": "sha256-16KkgfdYqjaeRGBaYsNrhPRRENs0qzkQVUooNHtoy2w=", "narHash": "sha256-Z+vUNbfd2FIKkWOTkcT7RYlh3oFCnig/d2eXD1SWf2E=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "ac62194c3917d5f474c1a844b6fd6da2db95077d", "rev": "a3116115851d68b8952a2a4221cc25a84e56b532",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "nixos", "owner": "nixos",
"ref": "nixos-25.05", "ref": "nixos-26.05",
"repo": "nixpkgs", "repo": "nixpkgs",
"type": "github" "type": "github"
} }
}, },
"nixpkgs_2": { "nixpkgs_2": {
"locked": { "locked": {
"lastModified": 1778869304, "lastModified": 1784564315,
"narHash": "sha256-30sZNZoA1cqF5JNO9fVX+wgiQYjB7HJqqJ4ztCDeBZE=", "narHash": "sha256-7OpsHHIZFUBLbeHNQ0oC40DZRQjsmGWodXge+OqgPgk=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "d233902339c02a9c334e7e593de68855ad26c4cb", "rev": "0c2094806c9e542f31785ef3569ab9e900e3ce9c",
"type": "github"
},
"original": {
"owner": "nixos",
"repo": "nixpkgs",
"rev": "0c2094806c9e542f31785ef3569ab9e900e3ce9c",
"type": "github"
}
},
"nixpkgs_3": {
"locked": {
"lastModified": 1789785513,
"narHash": "sha256-B44WL6h0XoLjJ41bUPJk0X5SDinLCII//6EcBLXKiJ0=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "20b1ddd1aa5ace70c9468305030aa4f9ef79671b",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -133,7 +167,8 @@
"disko": "disko", "disko": "disko",
"home-manager": "home-manager", "home-manager": "home-manager",
"impermanence": "impermanence", "impermanence": "impermanence",
"nixpkgs": "nixpkgs_2", "nix-vscode-extensions": "nix-vscode-extensions",
"nixpkgs": "nixpkgs_3",
"nixpkgs-stable": "nixpkgs-stable", "nixpkgs-stable": "nixpkgs-stable",
"secrets": "secrets", "secrets": "secrets",
"sops-nix": "sops-nix" "sops-nix": "sops-nix"
@@ -161,11 +196,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1777944972, "lastModified": 1789890976,
"narHash": "sha256-VfGRo1qTBKOe3s2gOv8LSoA6Fk19PvBlwQ1ECN0Evn8=", "narHash": "sha256-GKwH3zpy7tartuJMG0Rv/xUsdetG1QLmTVv8UKgJLmA=",
"owner": "Mic92", "owner": "Mic92",
"repo": "sops-nix", "repo": "sops-nix",
"rev": "c591bf665727040c6cc5cb409079acb22dcce33c", "rev": "7214124c20c1542c90deb54af50e2f53ae02711f",
"type": "github" "type": "github"
}, },
"original": { "original": {
+4 -1
View File
@@ -3,7 +3,7 @@
inputs = { inputs = {
# General inputs # General inputs
nixpkgs-stable.url = "github:nixos/nixpkgs/nixos-25.05"; nixpkgs-stable.url = "github:nixos/nixpkgs/nixos-26.05";
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
home-manager.url = "github:nix-community/home-manager"; home-manager.url = "github:nix-community/home-manager";
home-manager.inputs.nixpkgs.follows = "nixpkgs"; home-manager.inputs.nixpkgs.follows = "nixpkgs";
@@ -18,6 +18,9 @@
disko.inputs.nixpkgs.follows = "nixpkgs"; disko.inputs.nixpkgs.follows = "nixpkgs";
impermanence.url = "github:nix-community/impermanence"; impermanence.url = "github:nix-community/impermanence";
# VS Code extensions
nix-vscode-extensions.url = "github:nix-community/nix-vscode-extensions";
# MADD # MADD
# madd.url = "git+https://git.bulthuis.dev/Jan/madd"; # madd.url = "git+https://git.bulthuis.dev/Jan/madd";
# madd.inputs.nixpkgs.follows = "nixpkgs"; # madd.inputs.nixpkgs.follows = "nixpkgs";
+12
View File
@@ -9,6 +9,18 @@ let
nixpkgs-config = { nixpkgs-config = {
allowUnfree = true; allowUnfree = true;
permittedInsecurePackages =
let
insecurePackages = [
"electron-39.8.10"
"pnpm-10.34.0"
];
in
if builtins.length insecurePackages > 0 then
lib.trace "Allowing [${lib.strings.join ", " insecurePackages}] which is/are insecure" insecurePackages
else
[ ];
}; };
importDir = importDir =
+49
View File
@@ -0,0 +1,49 @@
{
...
}:
{
# State version
system.stateVersion = "25.05";
# Machine hostname
networking.hostName = "ws-home";
# Enabled modules
modules = {
profiles.server.enable = true;
disko.profile = "ws-home";
};
# Matter controller
services.matterjs-server = {
enable = true;
listenAddress = "::1";
};
modules.impermanence.directories = [
"/var/lib/private/matterjs-server"
"/var/lib/hass"
];
systemd.tmpfiles.rules = [
"d /var/lib/private 0700 root root -"
];
networking.firewall.allowedUDPPorts = [
5353 # mDNS
5540 # Matter
];
# Home Assistant
services.home-assistant = {
enable = true;
extraComponents = [ "matter" ];
config = {
homeassistant = { };
};
};
networking.firewall.allowedTCPPorts = [
8123 # Home Assistant
];
# Set up hardware
imports = [ ./hardware-configuration.nix ];
}
+18
View File
@@ -0,0 +1,18 @@
{ ... }:
# TODO: Replace with output of `nixos-generate-config --show-hardware-config`
{
# Hardware configuration
boot.initrd.availableKernelModules = [
"xhci_pci"
"ahci"
"nvme"
"usb_storage"
"sd_mod"
];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
boot.zfs.forceImportRoot = false;
hardware.cpu.intel.updateMicrocode = true;
}
+27
View File
@@ -52,6 +52,18 @@
services.netbird = { services.netbird = {
enable = true; enable = true;
# package = pkgs.netbird.overrideAttrs (
# final: prev: {
# version = "0.66.3";
# src = pkgs.fetchFromGitHub {
# owner = "netbirdio";
# repo = "netbird";
# tag = "v${final.version}";
# hash = "sha256-Cj9AcdWdHAfdBbqKAkwk3/Vy24XicjTZpmRXLYkyx3k=";
# };
# vendorHash = "sha256-vyf3zLTMtkmt+AXfCTRSPZ/TaJ8VP/5IzNbJwxQcfPs=";
# }
# );
}; };
# SSH X11 forwarding # SSH X11 forwarding
@@ -66,10 +78,25 @@
"passwd program" = "/run/wrappers/bin/passwd %u"; "passwd program" = "/run/wrappers/bin/passwd %u";
"security" = "user"; "security" = "user";
"client min protocol" = "NT1"; "client min protocol" = "NT1";
"server min protocol" = "NT1";
}; };
}; };
}; };
# GStreamer
environment.systemPackages = with pkgs; [
gst_all_1.gstreamer
gst_all_1.gst-plugins-base
gst_all_1.gst-plugins-good
gst_all_1.gst-plugins-bad
gst_all_1.gst-plugins-ugly
gst_all_1.gst-libav
gst_all_1.gst-vaapi
];
environment.variables = {
GST_PLUGIN_PATH = "/run/current-system/sw/lib/gstreamer-1.0/";
};
# TODO: Remove once laptop is properly integrated into domain # TODO: Remove once laptop is properly integrated into domain
programs.ssh = { programs.ssh = {
package = pkgs.openssh_gssapi; package = pkgs.openssh_gssapi;
+2
View File
@@ -45,6 +45,8 @@
".SteamCloud" ".SteamCloud"
".thunderbird" ".thunderbird"
".vscode" ".vscode"
".vscode-shared"
".var/app"
".wine" ".wine"
".Wolfram" ".Wolfram"
]; ];
+1 -1
View File
@@ -47,7 +47,7 @@ in
settings.user.name = cfg.user; settings.user.name = cfg.user;
settings.user.email = cfg.email; settings.user.email = cfg.email;
# ignores = cfg.ignores; ignores = cfg.ignores;
}; };
}; };
} }
+1
View File
@@ -21,6 +21,7 @@ in
}; };
modules.git.ignores = [ modules.git.ignores = [
".direnv" ".direnv"
".envrc"
]; ];
}; };
} }
+3
View File
@@ -17,7 +17,10 @@ in
# TODO: Move to nvidia module # TODO: Move to nvidia module
hardware.nvidia = { hardware.nvidia = {
open = false; open = false;
powerManagement.enable = true;
prime = { prime = {
offload.enable = true;
offload.enableOffloadCmd = true;
intelBusId = "PCI:0@0:2:0"; intelBusId = "PCI:0@0:2:0";
nvidiaBusId = "PCI:1@0:0:0"; nvidiaBusId = "PCI:1@0:0:0";
}; };
+65
View File
@@ -0,0 +1,65 @@
{
disko.devices = {
disk = {
main = {
type = "disk";
device = "/dev/sda"; # TODO: Verify on the actual machine (may be /dev/nvme0n1)
imageSize = "32G"; # For test VMs
content = {
type = "gpt";
partitions = {
boot = {
size = "512M";
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
mountOptions = [ "umask=0077" ];
};
};
zfs = {
end = "-4G";
content = {
type = "zfs";
pool = "tank";
};
};
swap = {
size = "100%";
content = {
type = "swap";
discardPolicy = "both";
};
};
};
};
};
};
zpool = {
tank = {
type = "zpool";
rootFsOptions = {
compression = "zstd";
};
mountpoint = null;
postCreateHook = "zfs snapshot -r tank@blank && zfs hold -r blank tank@blank";
datasets = {
root = {
type = "zfs_fs";
mountpoint = "/";
};
nix = {
type = "zfs_fs";
mountpoint = "/nix";
};
persist = {
type = "zfs_fs";
mountpoint = "/persist";
};
};
};
};
};
}
+15 -1
View File
@@ -40,7 +40,7 @@ in
# feishin # feishin
eduvpn-client eduvpn-client
ryubing ryubing
bottles # bottles
prismlauncher prismlauncher
foliate foliate
wireshark wireshark
@@ -54,6 +54,20 @@ in
winboat winboat
hieroglyphic hieroglyphic
shortwave shortwave
clairvoyant
constrict
curtail
gnome-decoder
dialect
impression
keypunch
gnome-mahjongg
textpieces
video-trimmer
wike
davinci-resolve
kdePackages.kdenlive
kicad
podman podman
podman-compose podman-compose
+80
View File
@@ -0,0 +1,80 @@
{
pkgs,
lib,
config,
...
}:
with lib;
let
cfg = config.modules.profiles.server;
in
{
options.modules.profiles.server = {
enable = mkEnableOption "Base server profile";
};
config = mkIf cfg.enable {
# Enabled modules
modules = {
profiles.base.enable = true;
disko.enable = true;
impermanence = {
enable = true;
resetScript = ''
# Revert to the blank state for the root directory
zfs rollback -r tank/root@blank
'';
};
domain = {
enable = true;
join = {
userFile = config.sops.secrets."vm-join/user".path;
passwordFile = config.sops.secrets."vm-join/password".path;
domainOUFile = config.sops.secrets."vm-join/ou".path;
};
};
ssh.enable = true;
};
# Initialize domain join secrets
sops.secrets."vm-join/user" = { };
sops.secrets."vm-join/password" = { };
sops.secrets."vm-join/ou" = { };
# Local user
sops.secrets."passwords/local-hashed".neededForUsers = true;
users.mutableUsers = false;
users.users.local = {
isNormalUser = true;
group = "local";
hashedPasswordFile = config.sops.secrets."passwords/local-hashed".path;
extraGroups = [ "wheel" ];
openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKKxoQSxfYqf9ITN8Fhckk8WbY4dwtBAXOhC9jxihJvq Admin"
];
};
users.groups.local = { };
home-manager.users.local =
{ ... }:
{
home.stateVersion = "24.11";
modules.profiles.base.enable = true;
};
# System packages
environment.systemPackages = with pkgs; [
# TODO: Make module for utilities/scripts
(writeShellScriptBin "system-update" "nixos-rebuild switch --flake git+https://git.bulthuis.dev/Jan/nixos-config")
];
# Machine platform
nixpkgs.hostPlatform = mkDefault "x86_64-linux";
# Set hostid (required for ZFS)
networking.hostId = "deadbeef";
# Hardware configuration
hardware.enableRedistributableFirmware = true;
};
}
+2 -60
View File
@@ -1,5 +1,4 @@
{ {
pkgs,
lib, lib,
config, config,
... ...
@@ -17,74 +16,17 @@ in
config = mkIf cfg.enable { config = mkIf cfg.enable {
# Enabled modules # Enabled modules
modules = { modules = {
profiles.base.enable = true; profiles.server.enable = true;
disko = { disko.profile = mkDefault "vm";
enable = true;
profile = mkDefault "vm";
};
impermanence = {
enable = true;
resetScript = ''
# Revert to the blank state for the root directory
zfs rollback -r tank/root@blank
'';
};
domain = {
enable = true;
join = {
userFile = config.sops.secrets."vm-join/user".path;
passwordFile = config.sops.secrets."vm-join/password".path;
domainOUFile = config.sops.secrets."vm-join/ou".path;
};
};
ssh.enable = true;
}; };
# Initialize domain join secrets
sops.secrets."vm-join/user" = { };
sops.secrets."vm-join/password" = { };
sops.secrets."vm-join/ou" = { };
# Autologin to root for access from hypervisor # Autologin to root for access from hypervisor
services.getty.autologinUser = "root"; services.getty.autologinUser = "root";
# Local user
sops.secrets."passwords/local-hashed".neededForUsers = true;
users.mutableUsers = false;
users.users.local = {
isNormalUser = true;
group = "local";
hashedPasswordFile = config.sops.secrets."passwords/local-hashed".path;
extraGroups = [ "wheel" ];
openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKKxoQSxfYqf9ITN8Fhckk8WbY4dwtBAXOhC9jxihJvq Admin"
];
};
users.groups.local = { };
home-manager.users.local =
{ ... }:
{
home.stateVersion = "24.11";
modules.profiles.base.enable = true;
};
# System packages
environment.systemPackages = with pkgs; [
# TODO: Make module for utilities/scripts
(writeShellScriptBin "system-update" "nixos-rebuild switch --flake git+https://git.bulthuis.dev/Jan/nixos-config")
];
# Enable qemu guest agent # Enable qemu guest agent
services.qemuGuest.enable = true; services.qemuGuest.enable = true;
# Machine platform
nixpkgs.hostPlatform = "x86_64-linux";
# Set hostid (required for ZFS)
networking.hostId = "deadbeef";
# Hardware configuration # Hardware configuration
hardware.enableRedistributableFirmware = true;
boot.initrd.availableKernelModules = [ boot.initrd.availableKernelModules = [
"ata_piix" "ata_piix"
"uhci_hcd" "uhci_hcd"