Compare commits

..

29 Commits

Author SHA1 Message Date
0698de4642 update 2025-10-05 10:10:35 +02:00
24fb89bdea update 2025-09-25 13:37:50 +02:00
9063929477 update 2025-09-02 19:43:06 +02:00
128e3b0dc1 working bridge configuration 2025-07-25 16:55:32 +02:00
e2290b064e add qemu bridge configuration 2025-07-17 12:18:57 +02:00
cb3d05058d update 2025-07-17 12:10:02 +02:00
182c35727e update 2025-06-17 17:05:05 +02:00
978920355c update 2025-06-12 23:11:10 +02:00
fcd8c7b029 update & add git rebase configuration 2025-06-01 16:30:46 +02:00
0d2e8c0c53 add makemkv 2025-05-03 10:46:50 +02:00
d3a815834c update 2025-04-19 12:15:35 +02:00
a37a500200 update flake 2025-03-22 15:03:14 +01:00
2ca4fd81c5 move flatpak to desktop configuration 2025-02-17 09:21:23 +01:00
817f4608e0 basic nas configuration 2025-02-17 09:18:41 +01:00
3c0925a83d move nvidia.nix to hardware folder 2025-02-17 09:09:30 +01:00
215b8987e5 change naming to device folder for device specific configuration 2025-02-17 09:07:20 +01:00
6dc8e03bb9 add zfs volume description to backup-target 2025-02-17 09:04:42 +01:00
21b5233077 format out network shares 2025-02-14 22:30:03 +01:00
817597d060 switch back to latest nvidia drivers 2025-02-14 16:37:37 +01:00
2858d00428 update to nixos-unstable 2025-02-14 02:43:26 +01:00
f633aa32a1 update flake.lock 2025-02-14 02:43:26 +01:00
ffea4cb7cb indentation fix 2024-12-23 12:58:01 +01:00
fc8a5372c4 add wl-clipboard 2024-12-23 09:25:19 +01:00
2e79694285 add ssh login for shatteredmint 2024-12-20 01:04:49 +01:00
90f7484142 add bluetooth on nix-conv 2024-12-14 21:53:44 +01:00
df1eb9f9c7 add hardware configuration for nix-conv 2024-12-13 20:14:38 +01:00
d12c76f48d make configuration.nix host agnostic and add nix-conv 2024-12-13 17:54:06 +01:00
2668121c52 add options to allow backing up to specific machine 2024-12-13 15:23:43 +01:00
f4f9112c05 make hardware configuration for each machine explicit 2024-12-12 22:23:40 +01:00
12 changed files with 337 additions and 57 deletions

27
backup-target.nix Normal file
View File

@@ -0,0 +1,27 @@
# configuration allowing this machine to be user as a backup server
{ config, lib, pkgs, ... }:
{
users.users.backup = {
isNormalUser = true;
openssh.authorizedKeys.keys = [
''command="${pkgs.rrsync}/bin/rrsync /mnt/backup",restrict ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIF1e7hxxQD7pVKMquEuiBrLNFfx9ZRAOU1SGky4iXacD''
#''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIF1e7hxxQD7pVKMquEuiBrLNFfx9ZRAOU1SGky4iXacD Ithuriel@openmediavault''
];
packages = [
pkgs.rsync
pkgs.rrsync
];
};
fileSystems."/mnt/backup" =
{
#depends = [ "/" ];
device = "BACKUP/backup";
fsType = "zfs";
options = [ "nofail" ];
};
networking.firewall.allowedTCPPorts = [ 22 ];
}

View File

@@ -5,11 +5,6 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
{ {
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
];
nix.settings.experimental-features = [ "nix-command" "flakes" ]; nix.settings.experimental-features = [ "nix-command" "flakes" ];
nixpkgs.config.allowUnfree = true; nixpkgs.config.allowUnfree = true;
@@ -26,26 +21,6 @@
}; };
# leftover from the original config # leftover from the original config
boot.loader.efi.canTouchEfiVariables = true; boot.loader.efi.canTouchEfiVariables = true;
# mount network shares
fileSystems."/mnt/nas/private" = {
device = "dashboard.omv:/ShatteredMINT";
fsType = "nfs";
options = [ "x-systemd.automount" "noauto" ];
};
fileSystems."/mnt/nas/shared" = {
device = "dashboard.omv:/default-nas";
fsType = "nfs";
options = [ "x-systemd.automount" "noauto" ];
};
networking.hostName = "nix-desk"; # Define your hostname.
networking.networkmanager.enable = true; # Easiest to use and most distros use this by default.
# required for ZFS
networking.hostId = "00000001";
# Set your time zone. # Set your time zone.
time.timeZone = "Europe/Berlin"; time.timeZone = "Europe/Berlin";
@@ -73,11 +48,12 @@
fonts = { fonts = {
packages = with pkgs; [ packages = with pkgs; [
nerdfonts # nerdfonts
# TODO after 25.05 # TODO after 25.05
# change to only install explicit fonts # change to only install explicit fonts
# nerd-fonts.jetbrains-mono nerd-fonts.jetbrains-mono
# does not exist
# nerd-fonts.jetbrains # nerd-fonts.jetbrains
]; ];
@@ -99,9 +75,6 @@
# Enable touchpad support (enabled default in most desktopManager). # Enable touchpad support (enabled default in most desktopManager).
# services.libinput.enable = true; # services.libinput.enable = true;
# enable flatpak
services.flatpak.enable = true;
# List packages installed in system profile. To search, run: # List packages installed in system profile. To search, run:
# $ nix search wget # $ nix search wget
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
@@ -110,10 +83,6 @@
htop htop
]; ];
# allow specific users to affect system configuration
users.groups.nixos-admins = {};
users.users.root.extraGroups = [ "nixos-admins" ];
# Some programs need SUID wrappers, can be configured further or are # Some programs need SUID wrappers, can be configured further or are
# started in user sessions. # started in user sessions.
# programs.mtr.enable = true; # programs.mtr.enable = true;
@@ -125,7 +94,18 @@
# List services that you want to enable: # List services that you want to enable:
# Enable the OpenSSH daemon. # Enable the OpenSSH daemon.
# services.openssh.enable = true; services.openssh = {
enable = true;
ports = [ 22 ];
settings = {
PasswordAuthentication = true;
KbdInteractiveAuthentication = false;
# AllowUsers = [ "backup" ];
# UseDns = true;
X11Forwarding = false;
PermitRootLogin = "no";
};
};
# Open ports in the firewall. # Open ports in the firewall.
# networking.firewall.allowedTCPPorts = [ ... ]; # networking.firewall.allowedTCPPorts = [ ... ];

70
devices/conv.nix Normal file
View File

@@ -0,0 +1,70 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
{
imports =
[ (modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "NIX_CONV_POOL/root";
fsType = "zfs";
};
fileSystems."/nix" =
{ device = "NIX_CONV_POOL/nix";
fsType = "zfs";
};
fileSystems."/var" =
{ device = "NIX_CONV_POOL/var";
fsType = "zfs";
};
fileSystems."/home" =
{ device = "NIX_CONV_POOL/home";
fsType = "zfs";
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/334B-15CD";
fsType = "vfat";
options = [ "fmask=0022" "dmask=0022" ];
};
swapDevices =
[ { device = "/dev/disk/by-uuid/b3e53298-fdcf-41c5-b80b-6f1ef1dceeae"; }
];
networking.hostName = "nix-conv"; # Define your hostname.
networking.hostId = "00000002";
# Pick only one of the below networking options.
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
networking.networkmanager.enable = true; # Easiest to use and most distros use this by default.
# BLUETOOTH
hardware.bluetooth = {
enable = true;
powerOnBoot = true;
settings.General.Experimental = true;
};
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true;
# networking.interfaces.enp4s0f3u1u4u1.useDHCP = lib.mkDefault true;
# networking.interfaces.wlp2s0.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

61
devices/desk.nix Normal file
View File

@@ -0,0 +1,61 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
##test
{ config, lib, pkgs, modulesPath, ... }:
{
imports =
[ (modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" "sr_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-amd" "sg" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "NIX_DESK_POOL/root";
fsType = "zfs";
};
fileSystems."/nix" =
{ device = "NIX_DESK_POOL/nix";
fsType = "zfs";
};
fileSystems."/var" =
{ device = "NIX_DESK_POOL/var";
fsType = "zfs";
};
fileSystems."/home" =
{ device = "NIX_DESK_POOL/home";
fsType = "zfs";
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/E943-DA32";
fsType = "vfat";
options = [ "fmask=0022" "dmask=0022" ];
};
swapDevices =
[ { device = "/dev/disk/by-uuid/7e1ada61-7a9b-4d28-b608-23d1ac7f4e29"; }
];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
# networking.useDHCP = lib.mkDefault true;
# networking.interfaces.enp4s0.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
networking.hostName = "nix-desk"; # Define your hostname.
networking.networkmanager.enable = true; # Easiest to use and most distros use this by default.
# required for ZFS
networking.hostId = "00000001";
}

61
devices/nas.nix Normal file
View File

@@ -0,0 +1,61 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
{
imports =
[ (modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "NIX_CONV_POOL/root";
fsType = "zfs";
};
fileSystems."/nix" =
{ device = "NIX_CONV_POOL/nix";
fsType = "zfs";
};
fileSystems."/var" =
{ device = "NIX_CONV_POOL/var";
fsType = "zfs";
};
fileSystems."/home" =
{ device = "NIX_CONV_POOL/home";
fsType = "zfs";
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/334B-15CD";
fsType = "vfat";
options = [ "fmask=0022" "dmask=0022" ];
};
#swapDevices =
# [ { device = "/dev/disk/by-uuid/b3e53298-fdcf-41c5-b80b-6f1ef1dceeae"; }
# ];
networking.hostName = "nix-nas"; # Define your hostname.
networking.hostId = "00000003";
# Pick only one of the below networking options.
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
networking.networkmanager.enable = true; # Easiest to use and most distros use this by default.
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true;
# networking.interfaces.enp4s0f3u1u4u1.useDHCP = lib.mkDefault true;
# networking.interfaces.wlp2s0.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "aarch64-linux";
}

15
flake.lock generated
View File

@@ -7,32 +7,31 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1733572789, "lastModified": 1759573136,
"narHash": "sha256-zjO6m5BqxXIyjrnUziAzk4+T4VleqjstNudSqWcpsHI=", "narHash": "sha256-ILSPD0Dm8p0w0fCVzOx98ZH8yFDrR75GmwmH3fS2VnE=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "c7ffc9727d115e433fd884a62dc164b587ff651d", "rev": "5f06ceafc6c9b773a776b9195c3f47bbe1defa43",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "nix-community", "owner": "nix-community",
"ref": "release-24.11",
"repo": "home-manager", "repo": "home-manager",
"type": "github" "type": "github"
} }
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1733808091, "lastModified": 1759381078,
"narHash": "sha256-KWwINTQelKOoQgrXftxoqxmKFZb9pLVfnRvK270nkVk=", "narHash": "sha256-gTrEEp5gEspIcCOx9PD8kMaF1iEmfBcTbO0Jag2QhQs=",
"owner": "NixOs", "owner": "NixOs",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "a0f3e10d94359665dba45b71b4227b0aeb851f8e", "rev": "7df7ff7d8e00218376575f0acdcc5d66741351ee",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "NixOs", "owner": "NixOs",
"ref": "nixos-24.11", "ref": "nixos-unstable",
"repo": "nixpkgs", "repo": "nixpkgs",
"type": "github" "type": "github"
} }

View File

@@ -2,9 +2,9 @@
description = "Flake to handle all my infrastructure"; description = "Flake to handle all my infrastructure";
inputs = { inputs = {
nixpkgs.url = "github:NixOs/nixpkgs/nixos-24.11"; nixpkgs.url = "github:NixOs/nixpkgs/nixos-unstable";
home-manager = { home-manager = {
url = "github:nix-community/home-manager/release-24.11"; url = "github:nix-community/home-manager";
# follow defined nixpkgs to prevent version mismatch # follow defined nixpkgs to prevent version mismatch
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
@@ -20,9 +20,42 @@
system = "x86_64-linux"; system = "x86_64-linux";
specialArgs = inputs; specialArgs = inputs;
modules = [ modules = [
./devices/desk.nix
./hardware/nvidia.nix
./configuration.nix ./configuration.nix
./nvidia.nix
./plasma.nix ./plasma.nix
./network-shares.nix
./backup-target.nix
./users/shatteredmint.nix
./qemu-bridges.nix
];
};
nix-conv = lib.nixosSystem {
system = "x86_64-linux";
specialArgs = inputs;
modules = [
./devices/conv.nix
./configuration.nix
./plasma.nix
./users/shatteredmint.nix
./network-shares.nix
];
};
nix-nas = lib.nixosSystem {
system = "aarch64-linux";
specialArgs = inputs;
modules = [
./devices/nas.nix
./configuration.nix
./users/shatteredmint.nix ./users/shatteredmint.nix
]; ];

View File

@@ -19,6 +19,6 @@
nvidiaSettings = true; nvidiaSettings = true;
# set specific version # set specific version
package = config.boot.kernelPackages.nvidiaPackages.stable; package = config.boot.kernelPackages.nvidiaPackages.latest;
}; };
} }

17
network-shares.nix Normal file
View File

@@ -0,0 +1,17 @@
{ config, lib, pkgs, ... }:
{
# mount network shares
fileSystems."/mnt/nas/private" = {
device = "dashboard.omv:/ShatteredMINT";
fsType = "nfs";
options = [ "x-systemd.automount" "noauto" ];
};
fileSystems."/mnt/nas/shared" = {
device = "dashboard.omv:/default-nas";
fsType = "nfs";
options = [ "x-systemd.automount" "noauto" ];
};
}

View File

@@ -12,7 +12,8 @@
pkgs.kdePackages.elisa pkgs.kdePackages.elisa
]; ];
# enable flatpak
services.flatpak.enable = true;
# Enable sound. # Enable sound.
services.pipewire = { services.pipewire = {

18
qemu-bridges.nix Normal file
View File

@@ -0,0 +1,18 @@
{ config, libs, pkgs, ... }:
{
networking.bridges.virtbr0.interfaces = [
"enp4s0"
];
boot.kernel.sysctl."net.ipv4.ip_forward" = 1;
networking.interfaces.virtbr0 = {
useDHCP = true;
};
virtualisation.libvirtd = {
enable = true;
allowedBridges = [ "virtbr0" ];
};
}

View File

@@ -6,8 +6,11 @@
users.users.shatteredmint = { users.users.shatteredmint = {
isNormalUser = true; isNormalUser = true;
extraGroups = [ "wheel" "nixos-admins" ]; extraGroups = [ "wheel" "nixos-admins" "cdrom" ];
shell = pkgs.zsh; shell = pkgs.zsh;
openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKT9u43WNMlu3gnu5z9Twt1vkdNdpf6REfEK/OT4qxjK shatteredmint"
];
}; };
@@ -30,7 +33,7 @@
ignoreAllDups = true; ignoreAllDups = true;
}; };
initExtra = '' initContent = ''
bindkey '^?' backward-delete-char bindkey '^?' backward-delete-char
bindkey '\e[3~' delete-char bindkey '\e[3~' delete-char
autoload -Uz vcs_info autoload -Uz vcs_info
@@ -48,20 +51,30 @@
userName = "ShatteredMINT"; userName = "ShatteredMINT";
extraConfig = { extraConfig = {
init.defaultBranch = "main"; init.defaultBranch = "main";
pull.rebase = true;
}; };
}; };
programs.neovim = {
enable = true;
extraPackages = with pkgs; [
wl-clipboard
];
};
home.packages = with pkgs; [ home.packages = with pkgs; [
thunderbird thunderbird
firefox firefox
lazygit lazygit
veracrypt veracrypt
keepassxc keepassxc
yakuake kdePackages.yakuake
cargo cargo
zig zig
clang clang
nil nil
wl-clipboard
makemkv
]; ];
home.sessionPath = [ home.sessionPath = [