From f09dfbc1081aa98175852273061e60e657a56ce2 Mon Sep 17 00:00:00 2001 From: Timo Boomers Date: Sat, 17 May 2025 17:13:43 +0200 Subject: [PATCH] Migrated from default.nix to configuration.nix --- .gitignore | 1 + flake.nix | 127 ++++++------------ .../{default.nix => configuration.nix} | 46 ++----- hosts/p-th-rpi-01/default.nix | 93 ------------- hosts/p-th-rpi-01/hardware-configuration.nix | 29 ---- hosts/p-th-rpi-01/home.nix | 73 ---------- hosts/ti-clt-dsk01/configuration.nix | 60 +++++++++ hosts/ti-clt-dsk01/default.nix | 104 -------------- .../{default.nix => configuration.nix} | 57 +++----- .../{default.nix => configuration.nix} | 37 ++--- hosts/v-th-ctr-01/configuration.nix | 51 +++++++ hosts/v-th-ctr-01/default.nix | 77 ----------- modules/home/default.nix | 12 +- modules/overlays.nix | 5 + modules/system/default.nix | 37 ++++- overlays/default.nix | 18 +++ pkgs/default.nix | 3 + result | 1 + 18 files changed, 265 insertions(+), 566 deletions(-) create mode 100644 .gitignore rename hosts/ch-clt-dsk01/{default.nix => configuration.nix} (58%) delete mode 100644 hosts/p-th-rpi-01/default.nix delete mode 100644 hosts/p-th-rpi-01/hardware-configuration.nix delete mode 100644 hosts/p-th-rpi-01/home.nix create mode 100644 hosts/ti-clt-dsk01/configuration.nix delete mode 100644 hosts/ti-clt-dsk01/default.nix rename hosts/ti-clt-lpt01/{default.nix => configuration.nix} (74%) rename hosts/ti-clt-tbl01/{default.nix => configuration.nix} (67%) delete mode 100644 hosts/v-th-ctr-01/default.nix create mode 100644 modules/overlays.nix create mode 100644 overlays/default.nix create mode 100644 pkgs/default.nix create mode 120000 result diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b2be92b --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +result diff --git a/flake.nix b/flake.nix index 2302edc..f7eb8a9 100644 --- a/flake.nix +++ b/flake.nix @@ -29,150 +29,111 @@ disko.inputs.nixpkgs.follows = "nixpkgs"; }; - outputs = inputs@{ self, nixpkgs, nixpkgs-unstable, home-manager, nix-colors, stylix, nixos-cosmic, sops-nix, disko, ... }: - let - system = "x86_64-linux"; - system-arm = "aarch64-linux"; - overlay-unstable = final: prev: { - unstable = import nixpkgs-unstable { - config.allowUnfree = true; - localSystem = { inherit system; }; - }; - }; - overlay-unstable-arm = final: prev: { - unstable = import nixpkgs-unstable { - config.allowUnfree = true; - localSystem = { inherit system-arm; }; - }; - }; + outputs = { + self, + nixpkgs, + home-manager, + nix-colors, + stylix, + nixos-cosmic, + sops-nix, + disko, + ... + } @ inputs: let + inherit (self) outputs; + systems = [ + "x86_64-linux" + "aarch64-linux" + ]; + forAllSystems = nixpkgs.lib.genAttrs systems; in { + packages = forAllSystems (system: import ./pkgs nixpkgs.legacyPackages.${system} ); + overlays = import ./overlays { inherit inputs; }; + nixosConfigurations = { - # nixos-anywhere --flake .#p-th-rpi-01 --generate-hardware-config nixos-generate-config ./hosts/p-th-rpi-01/hardware-configuration.nix - p-th-rpi-01 = nixpkgs.lib.nixosSystem { - system = "x86_64-linux"; - specialArgs = { inherit inputs; }; - modules = [ - ({ config, pkgs, ... }: { nixpkgs.overlays = [ overlay-unstable ]; }) - - disko.nixosModules.disko - inputs.nixos-hardware.nixosModules.raspberry-pi-4 - - ./hosts/p-th-rpi-01 ]; - }; - ti-clt-lpt01 = nixpkgs.lib.nixosSystem { - system = "x86_64-linux"; - specialArgs = { inherit inputs; }; + specialArgs = { inherit inputs outputs; }; modules = [ - ({ config, pkgs, ... }: { nixpkgs.overlays = [ overlay-unstable ]; }) - inputs.nixos-hardware.nixosModules.framework-13-7040-amd - ./hosts/ti-clt-lpt01 + ./hosts/ti-clt-lpt01/configuration.nix ]; }; ch-clt-dsk01 = nixpkgs.lib.nixosSystem { - system = "x86_64-linux"; - specialArgs = { inherit inputs; }; + specialArgs = { inherit inputs outputs; }; modules = [ - ({ config, pkgs, ... }: { nixpkgs.overlays = [ overlay-unstable ]; }) - - ./hosts/ch-clt-dsk01 + ./hosts/ch-clt-dsk01/configuration.nix ]; }; ti-clt-tbl01 = nixpkgs.lib.nixosSystem { - system = "x86_64-linux"; - specialArgs = { inherit inputs; }; + specialArgs = { inherit inputs outputs; }; modules = [ - ({ config, pkgs, ... }: { nixpkgs.overlays = [ overlay-unstable ]; }) - inputs.nixos-hardware.nixosModules.microsoft-surface-go - ./hosts/ti-clt-tbl01 + ./hosts/ti-clt-tbl01/configuration.nix ]; }; + # Timo's desktop ti-clt-dsk01 = nixpkgs.lib.nixosSystem { - system = "x86_64-linux"; - specialArgs = { inherit inputs; }; + specialArgs = { inherit inputs outputs; }; modules = [ - ({ config, pkgs, ... }: { nixpkgs.overlays = [ overlay-unstable ]; }) - - ./hosts/ti-clt-dsk01 + ./hosts/ti-clt-dsk01/configuration.nix ]; }; v-th-ctr-01 = nixpkgs.lib.nixosSystem { - system = "x86_64-linux"; - specialArgs = { inherit inputs; }; + specialArgs = { inherit inputs outputs; }; modules = [ - ({ config, pkgs, ... }: { nixpkgs.overlays = [ overlay-unstable ]; }) - ./hosts/v-th-ctr-01 + ./hosts/v-th-ctr-01/configuration.nix ]; }; }; homeConfigurations = { + # Timo "xeovalyte@ti-clt-lpt01" = home-manager.lib.homeManagerConfiguration { pkgs = nixpkgs.legacyPackages.x86_64-linux; - extraSpecialArgs = { inherit inputs nix-colors; }; + extraSpecialArgs = { inherit inputs outputs; }; modules = [ - ({ config, pkgs, ... }: { nixpkgs.overlays = [ overlay-unstable ]; }) - ./hosts/ti-clt-lpt01/home.nix ]; }; - "kiiwy@ch-clt-dsk01" = home-manager.lib.homeManagerConfiguration { - pkgs = nixpkgs.legacyPackages.x86_64-linux; - extraSpecialArgs = { inherit inputs nix-colors; }; - modules = [ - ({ config, pkgs, ... }: { nixpkgs.overlays = [ overlay-unstable ]; }) - - ./hosts/ch-clt-dsk01/home.nix - ]; - }; - "xeovalyte@ti-clt-tbl01" = home-manager.lib.homeManagerConfiguration { pkgs = nixpkgs.legacyPackages.x86_64-linux; - extraSpecialArgs = { inherit inputs nix-colors; }; + extraSpecialArgs = { inherit inputs outputs; }; modules = [ - ({ config, pkgs, ... }: { nixpkgs.overlays = [ overlay-unstable ]; }) - ./hosts/ti-clt-tbl01/home.nix ]; }; "xeovalyte@ti-clt-dsk01" = home-manager.lib.homeManagerConfiguration { pkgs = nixpkgs.legacyPackages.x86_64-linux; - extraSpecialArgs = { inherit inputs nix-colors; }; + extraSpecialArgs = { inherit inputs outputs; }; modules = [ - ({ config, pkgs, ... }: { nixpkgs.overlays = [ overlay-unstable ]; }) - ./hosts/ti-clt-dsk01/home.nix ]; }; - "deploy@v-th-ctr-01" = home-manager.lib.homeManagerConfiguration { + # Christa + "kiiwy@ch-clt-dsk01" = home-manager.lib.homeManagerConfiguration { pkgs = nixpkgs.legacyPackages.x86_64-linux; - extraSpecialArgs = { inherit inputs nix-colors; }; + extraSpecialArgs = { inherit inputs outputs; }; modules = [ - ({ config, pkgs, ... }: { nixpkgs.overlays = [ overlay-unstable ]; }) - - ./hosts/v-th-ctr-01/home.nix + ./hosts/ch-clt-dsk01/home.nix ]; }; - "deploy@p-th-rpi-01" = home-manager.lib.homeManagerConfiguration { - pkgs = nixpkgs.legacyPackages.aarch64-linux; - extraSpecialArgs = { inherit inputs nix-colors; }; + # Deploy + "deploy@v-th-ctr-01" = home-manager.lib.homeManagerConfiguration { + pkgs = nixpkgs.legacyPackages.x86_64-linux; + extraSpecialArgs = { inherit inputs outputs; }; modules = [ - ({ config, pkgs, ... }: { nixpkgs.overlays = [ overlay-unstable ]; }) - - ./hosts/p-th-rpi-01/home.nix + ./hosts/v-th-ctr-01/home.nix ]; }; }; diff --git a/hosts/ch-clt-dsk01/default.nix b/hosts/ch-clt-dsk01/configuration.nix similarity index 58% rename from hosts/ch-clt-dsk01/default.nix rename to hosts/ch-clt-dsk01/configuration.nix index 40704c3..766f582 100644 --- a/hosts/ch-clt-dsk01/default.nix +++ b/hosts/ch-clt-dsk01/configuration.nix @@ -6,10 +6,11 @@ ./hardware-configuration.nix # Import modules - ../../modules/system/default.nix + ../../modules/system ]; settings = { + hostname = "ch-clt-dsk01"; display-manager = "gdm"; desktop-environments = { cosmic.enable = false; @@ -37,20 +38,14 @@ }; }; - nix.settings = { - experimental-features = [ "nix-command" "flakes" ]; - - substituters = [ - "https://nix-community.cachix.org" - "https://cosmic.cachix.org/" - ]; - - trusted-public-keys = [ - "cosmic.cachix.org-1:Dya9IyXD4xdBehWjrkPv6rtxpmMdRel02smYzA85dPE=" - ]; + # Users + users.users.kiiwy = { + isNormalUser = true; + description = "Christa Boomers"; + extraGroups = [ "networkmanager" "wheel" "dialout" ]; }; - # Bootloader. + # Bootloader boot.loader.efi.canTouchEfiVariables = true; boot.loader.grub = { enable = true; @@ -59,28 +54,5 @@ configurationLimit = 32; }; - networking.hostName = "ch-clt-dsk01"; # Define your hostname. - - networking.firewall = { - enable = true; - allowedTCPPorts = [ 80 443 53 ]; - allowedUDPPorts = [ 80 443 53 ]; - }; - - users.users.kiiwy = { - isNormalUser = true; - description = "Christa Boomers"; - extraGroups = [ "networkmanager" "wheel" "dialout" ]; - }; - - nix.settings.trusted-users = [ "root" "kiiwy" ]; - - # Prevent system freeze on high load - services.earlyoom = { - enable = true; - }; - - # boot.kernelPackages = pkgs.linuxPackages_latest; - - system.stateVersion = "24.05"; + system.stateVersion = "24.11"; } diff --git a/hosts/p-th-rpi-01/default.nix b/hosts/p-th-rpi-01/default.nix deleted file mode 100644 index 5156e26..0000000 --- a/hosts/p-th-rpi-01/default.nix +++ /dev/null @@ -1,93 +0,0 @@ -{ ... }: - -let - hostname = "p-th-rpi-01"; - username = "deploy"; - authorizedKeys = [ - "" - ]; -in -{ - imports = [ - ./hardware-configuration.nix - - # Import modules - ../../modules/system/default.nix - ]; - - settings = { - display-manager = "none"; - desktop-environments = { - cosmic.enable = false; - hyprland.enable = false; - gnome.enable = false; - }; - applications = { - common.enable = true; - steam.enable = false; - thunar.enable = false; - }; - services = { - docker.enable = false; - podman.enable = true; - quickemu.enable = false; - sunshine.enable = false; - garbage-collection.enable = true; - incus.enable = false; - ssh.enable = true; - }; - hardware = { - fprint.enable = false; - printing.enable = false; - bluetooth.enable = false; - firewall.enable = true; - locale.enable = true; - nvidia.enable = false; - }; - }; - - nix.settings = { - experimental-features = [ "nix-command" "flakes" ]; - - substituters = [ - "https://nix-community.cachix.org" - "https://cosmic.cachix.org/" - ]; - - trusted-public-keys = [ - "cosmic.cachix.org-1:Dya9IyXD4xdBehWjrkPv6rtxpmMdRel02smYzA85dPE=" - ]; - }; - - # Use the extlinux boot loader. (NixOS wants to enable GRUB by default) - boot.loader.grub.enable = false; - # Enables the generation of /boot/extlinux/extlinux.conf - boot.loader.generic-extlinux-compatible.enable = true; - - services.openssh.enable = true; - users.users.root.openssh.authorizedKeys.keys = [ - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIM/FIQBczDV/niK3a2/2kK8BMH/8qBipSdp73C+HKR0e xeovalyte@ti-clt-dsk01" - ]; - - networking.hostName = hostname; # Define your hostname. - - networking.firewall = { - enable = true; - allowedTCPPorts = [ 1080 1443 1053 ]; - allowedUDPPorts = [ 1080 1443 1053 ]; - }; - - networking.hosts = { - "127.0.0.1" = [ "tbmrs.nl" ]; - }; - - users.users.${username} = { - isNormalUser = true; - extraGroups = [ "networkmanager" "wheel" "dialout" ]; - linger = true; - }; - - nix.settings.trusted-users = [ "root" "${username}" ]; - - system.stateVersion = "24.05"; -} diff --git a/hosts/p-th-rpi-01/hardware-configuration.nix b/hosts/p-th-rpi-01/hardware-configuration.nix deleted file mode 100644 index 8d440bc..0000000 --- a/hosts/p-th-rpi-01/hardware-configuration.nix +++ /dev/null @@ -1,29 +0,0 @@ -{ config, lib, pkgs, modulesPath, ... }: - -{ - imports = - [ (modulesPath + "/installer/scan/not-detected.nix") - ]; - - boot.initrd.availableKernelModules = [ "xhci_pci" ]; - boot.initrd.kernelModules = [ ]; - boot.kernelModules = [ ]; - boot.extraModulePackages = [ ]; - - fileSystems."/" = - { device = "/dev/disk/by-uuid/44444444-4444-4444-8888-888888888888"; - fsType = "ext4"; - }; - - swapDevices = [ ]; - - # 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..useDHCP`. - networking.useDHCP = lib.mkDefault true; - # networking.interfaces.end0.useDHCP = lib.mkDefault true; - # networking.interfaces.wlan0.useDHCP = lib.mkDefault true; - - nixpkgs.hostPlatform = lib.mkDefault "aarch64-linux"; -} diff --git a/hosts/p-th-rpi-01/home.nix b/hosts/p-th-rpi-01/home.nix deleted file mode 100644 index d806163..0000000 --- a/hosts/p-th-rpi-01/home.nix +++ /dev/null @@ -1,73 +0,0 @@ -{ pkgs, ... }: - -{ - imports = [ - # Modules - ../../modules/home/default.nix - ]; - - config = { - home = { - username = "deploy"; - homeDirectory = "/home/deploy"; - }; - - settings = { - applications.common.enable = false; - applications.alacritty.enable = false; - applications.devenv.enable = false; - applications.firefox.enable = false; - applications.git.enable = false; - applications.helix.enable = true; - applications.zsh.enable = true; - applications.ssh.enable = true; - applications.thunderbird.enable = false; - applications.yazi.enable = true; - applications.zellij.enable = true; - applications.wezterm.enable = false; - - services.nextcloud-sync.enable = false; - services.podman.enable = true; - services.sops.enable = true; - - theming.fonts.enable = false; - theming.stylix.enable = false; - theming.stylix.wallpaper = "wallpaper-2.png"; - theming.stylix.theme = "da-one-ocean"; - - desktop-environments.hyprland.enable = false; - - containers = { - network.enable = true; - - nginx.enable = false; - caddy.enable = true; - kanidm.enable = false; - forgejo.enable = false; - immich.enable = false; - homepage.enable = false; - uptime-kuma.enable = false; - pingvin-share.enable = false; - vaultwarden.enable = false; - paperless-ngx.enable = false; - beszel.enable = false; - storage.enable = false; - homeassistant.enable = false; - karakeep.enable = false; - vikunja.enable = false; - stalwart.enable = false; - static.enable = true; - }; - }; - - home.packages = with pkgs; [ - unstable.helix - lazygit - ]; - - # Enable home-manager - programs.home-manager.enable = true; - - home.stateVersion = "24.05"; - }; -} diff --git a/hosts/ti-clt-dsk01/configuration.nix b/hosts/ti-clt-dsk01/configuration.nix new file mode 100644 index 0000000..c090f37 --- /dev/null +++ b/hosts/ti-clt-dsk01/configuration.nix @@ -0,0 +1,60 @@ +{ inputs, outputs, ... }: + +{ + imports = [ + ./hardware-configuration.nix + + ../../modules/system + ]; + + settings = { + hostname = "ti-clt-dsk01"; + display-manager = "cosmic-greeter"; + desktop-environments = { + cosmic.enable = true; + hyprland.enable = false; + gnome.enable = false; + }; + applications = { + common.enable = true; + steam.enable = true; + thunar.enable = false; + }; + services = { + docker.enable = true; + quickemu.enable = false; + sunshine.enable = true; + garbage-collection.enable = true; + ssh.enable = true; + }; + hardware = { + fprint.enable = false; + printing.enable = true; + bluetooth.enable = false; + firewall.enable = true; + locale.enable = true; + nvidia.enable = true; + }; + }; + + # Users + users.users.xeovalyte = { + isNormalUser = true; + description = "Timo Boomers"; + extraGroups = [ "wheel" ]; + }; + + # Boot + boot.loader.efi.canTouchEfiVariables = true; + boot.loader.grub = { + enable = true; + efiSupport = true; + device = "nodev"; + }; + + # Networking + networking.interfaces.enp7s0.wakeOnLan.enable = true; + + # state version + system.stateVersion = "24.11"; +} diff --git a/hosts/ti-clt-dsk01/default.nix b/hosts/ti-clt-dsk01/default.nix deleted file mode 100644 index 83a83eb..0000000 --- a/hosts/ti-clt-dsk01/default.nix +++ /dev/null @@ -1,104 +0,0 @@ -{ pkgs, ... }: - -{ - imports = [ - # Include the results of the hardware scan. - ./hardware-configuration.nix - - # Import modules - ../../modules/system/default.nix - ]; - - settings = { - display-manager = "cosmic-greeter"; - desktop-environments = { - cosmic.enable = true; - hyprland.enable = false; - gnome.enable = false; - }; - applications = { - common.enable = true; - steam.enable = true; - thunar.enable = false; - }; - services = { - docker.enable = true; - quickemu.enable = false; - sunshine.enable = true; - garbage-collection.enable = true; - }; - hardware = { - fprint.enable = false; - printing.enable = true; - bluetooth.enable = false; - firewall.enable = true; - locale.enable = true; - nvidia.enable = true; - }; - }; - - networking.firewall = { - allowedTCPPorts = [ 3000 ]; - allowedUDPPorts = [ 3000 ]; - }; - - nix.settings = { - experimental-features = [ "nix-command" "flakes" ]; - - substituters = [ - "https://nix-community.cachix.org" - "https://cosmic.cachix.org/" - ]; - - trusted-public-keys = [ - "cosmic.cachix.org-1:Dya9IyXD4xdBehWjrkPv6rtxpmMdRel02smYzA85dPE=" - "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" - ]; - }; - - # Bootloader. - boot.loader.efi.canTouchEfiVariables = true; - boot.loader.grub = { - enable = true; - efiSupport = true; - device = "nodev"; - }; - - # Networking configuration - networking.hostName = "ti-clt-dsk01"; # Define your hostname. - networking.interfaces.enp7s0.wakeOnLan.enable = true; - - users.users.xeovalyte = { - isNormalUser = true; - description = "Timo Boomers"; - extraGroups = [ "networkmanager" "wheel" "dialout" "fuse" ]; - }; - - nix.settings.trusted-users = [ "root" "xeovalyte" ]; - - networking.hosts = { - "192.168.100.118" = [ - "tbmrs.nl" - "auth.tbmrs.nl" - "git.tbmrs.nl" - "photos.tbmrs.nl" - "home.tbmrs.nl" - "uptime.tbmrs.nl" - "share.tbmrs.nl" - "vault.local.tbmrs.nl" - "paperless.local.tbmrs.nl" - "monitor.local.tbmrs.nl" - "files.tbmrs.nl" - "syncthing.local.tbmrs.nl" - "home-assistant.local.tbmrs.nl" - "karakeep.local.tbmrs.nl" - "vikunja.local.tbmrs.nl" - "mail.tbmrs.nl" - ]; - }; - - services.openssh.enable = true; - - system.stateVersion = "24.05"; - -} diff --git a/hosts/ti-clt-lpt01/default.nix b/hosts/ti-clt-lpt01/configuration.nix similarity index 74% rename from hosts/ti-clt-lpt01/default.nix rename to hosts/ti-clt-lpt01/configuration.nix index 58eda5b..0bbc254 100644 --- a/hosts/ti-clt-lpt01/default.nix +++ b/hosts/ti-clt-lpt01/configuration.nix @@ -6,10 +6,11 @@ ./hardware-configuration.nix # Import modules - ../../modules/system/default.nix + ../../modules/system ]; settings = { + hostname = "ti-clt-dsk01"; display-manager = "cosmic-greeter"; desktop-environments = { cosmic.enable = true; @@ -38,20 +39,24 @@ }; }; - nix.settings = { - experimental-features = [ "nix-command" "flakes" ]; - - substituters = [ - "https://nix-community.cachix.org" - "https://cosmic.cachix.org/" - ]; - - trusted-public-keys = [ - "cosmic.cachix.org-1:Dya9IyXD4xdBehWjrkPv6rtxpmMdRel02smYzA85dPE=" - ]; + # Users + users.users.xeovalyte = { + isNormalUser = true; + description = "Timo Boomers"; + extraGroups = [ "networkmanager" "wheel" "dialout" ]; }; + + # Boot. + boot.loader.efi.canTouchEfiVariables = true; + boot.loader.grub = { + enable = true; + efiSupport = true; + device = "nodev"; + configurationLimit = 32; + }; + boot.kernelPackages = pkgs.linuxPackages_latest; - # Enable host + # Networking networking.hosts = { "127.0.0.1" = [ "tbmrs.nl" @@ -67,37 +72,11 @@ ]; }; - # Bootloader. - boot.loader.efi.canTouchEfiVariables = true; - boot.loader.grub = { - enable = true; - efiSupport = true; - device = "nodev"; - configurationLimit = 32; - }; - - networking.hostName = "ti-clt-lpt01"; # Define your hostname. - networking.firewall = { enable = true; allowedTCPPorts = [ 22 80 443 53 ]; allowedUDPPorts = [ 80 443 53 ]; }; - users.users.xeovalyte = { - isNormalUser = true; - description = "Timo Boomers"; - extraGroups = [ "networkmanager" "wheel" "dialout" ]; - }; - - nix.settings.trusted-users = [ "root" "xeovalyte" ]; - - # Prevent system freeze on high load - services.earlyoom = { - enable = true; - }; - - boot.kernelPackages = pkgs.linuxPackages_latest; - system.stateVersion = "24.05"; } diff --git a/hosts/ti-clt-tbl01/default.nix b/hosts/ti-clt-tbl01/configuration.nix similarity index 67% rename from hosts/ti-clt-tbl01/default.nix rename to hosts/ti-clt-tbl01/configuration.nix index e26c6d5..c368ff8 100644 --- a/hosts/ti-clt-tbl01/default.nix +++ b/hosts/ti-clt-tbl01/configuration.nix @@ -6,10 +6,11 @@ ./hardware-configuration.nix # Import modules - ../../modules/system/default.nix + ../../modules/system ]; settings = { + hostname = "ti-clt-tbl01"; display-manager = "gdm"; desktop-environments = { cosmic.enable = false; @@ -37,17 +38,11 @@ }; }; - nix.settings = { - experimental-features = [ "nix-command" "flakes" ]; - - substituters = [ - "https://nix-community.cachix.org" - "https://cosmic.cachix.org/" - ]; - - trusted-public-keys = [ - "cosmic.cachix.org-1:Dya9IyXD4xdBehWjrkPv6rtxpmMdRel02smYzA85dPE=" - ]; + # Users + users.users.xeovalyte = { + isNormalUser = true; + description = "Timo Boomers"; + extraGroups = [ "networkmanager" "wheel" "dialout" ]; }; # Bootloader. @@ -58,24 +53,8 @@ device = "nodev"; configurationLimit = 32; }; - - networking.hostName = "ti-clt-tbl01"; # Define your hostname. - - users.users.xeovalyte = { - isNormalUser = true; - description = "Timo Boomers"; - extraGroups = [ "networkmanager" "wheel" "dialout" ]; - }; - - nix.settings.trusted-users = [ "root" "xeovalyte" ]; - - # Prevent system freeze on high load - services.earlyoom = { - enable = true; - }; - boot.kernelPackages = lib.mkForce pkgs.linuxPackages_latest; - system.stateVersion = "24.05"; + system.stateVersion = "24.11"; } diff --git a/hosts/v-th-ctr-01/configuration.nix b/hosts/v-th-ctr-01/configuration.nix index d2c230a..4bf5125 100644 --- a/hosts/v-th-ctr-01/configuration.nix +++ b/hosts/v-th-ctr-01/configuration.nix @@ -9,14 +9,65 @@ # Include the default incus configuration. "${modulesPath}/virtualisation/lxc-container.nix" # Include the container-specific autogenerated configuration. + ../../modules/system/default.nix ]; + settings = { + hostname = "v-th-ctr-01"; + display-manager = "none"; + desktop-environments = { + cosmic.enable = false; + hyprland.enable = false; + gnome.enable = false; + }; + applications = { + common.enable = true; + steam.enable = false; + thunar.enable = false; + }; + services = { + docker.enable = false; + podman.enable = true; + quickemu.enable = false; + sunshine.enable = false; + garbage-collection.enable = true; + incus.enable = false; + ssh.enable = true; + }; + hardware = { + fprint.enable = false; + printing.enable = false; + bluetooth.enable = false; + firewall.enable = true; + locale.enable = true; + nvidia.enable = false; + }; + }; + + users.users.deploy = { + isNormalUser = true; + description = "Deploy"; + extraGroups = [ "networkmanager" "wheel" "dialout" ]; + linger = true; + }; + + # networking networking = { dhcpcd.enable = false; useDHCP = false; useHostResolvConf = false; }; + networking.hosts = { + "127.0.0.1" = [ "tbmrs.nl" ]; + }; + + networking.firewall = { + enable = true; + allowedTCPPorts = [ 1080 1443 1053 ]; + allowedUDPPorts = [ 1080 1443 1053 ]; + }; + systemd.network = { enable = true; networks."50-eth0" = { diff --git a/hosts/v-th-ctr-01/default.nix b/hosts/v-th-ctr-01/default.nix deleted file mode 100644 index c571632..0000000 --- a/hosts/v-th-ctr-01/default.nix +++ /dev/null @@ -1,77 +0,0 @@ -{ ... }: - -{ - imports = [ - ./configuration.nix - - # Import modules - ../../modules/system/default.nix - ]; - - settings = { - display-manager = "none"; - desktop-environments = { - cosmic.enable = false; - hyprland.enable = false; - gnome.enable = false; - }; - applications = { - common.enable = true; - steam.enable = false; - thunar.enable = false; - }; - services = { - docker.enable = false; - podman.enable = true; - quickemu.enable = false; - sunshine.enable = false; - garbage-collection.enable = true; - incus.enable = false; - ssh.enable = true; - }; - hardware = { - fprint.enable = false; - printing.enable = false; - bluetooth.enable = false; - firewall.enable = true; - locale.enable = true; - nvidia.enable = false; - }; - }; - - nix.settings = { - experimental-features = [ "nix-command" "flakes" ]; - - substituters = [ - "https://nix-community.cachix.org" - "https://cosmic.cachix.org/" - ]; - - trusted-public-keys = [ - "cosmic.cachix.org-1:Dya9IyXD4xdBehWjrkPv6rtxpmMdRel02smYzA85dPE=" - ]; - }; - - networking.hostName = "v-th-ctr-01"; # Define your hostname. - - networking.firewall = { - enable = true; - allowedTCPPorts = [ 1080 1443 1053 ]; - allowedUDPPorts = [ 1080 1443 1053 ]; - }; - - networking.hosts = { - "127.0.0.1" = [ "tbmrs.nl" ]; - }; - - users.users.deploy = { - isNormalUser = true; - description = "Deploy"; - extraGroups = [ "networkmanager" "wheel" "dialout" ]; - linger = true; - }; - - nix.settings.trusted-users = [ "root" "deploy" ]; - - system.stateVersion = "24.05"; -} diff --git a/modules/home/default.nix b/modules/home/default.nix index ae73463..b877917 100644 --- a/modules/home/default.nix +++ b/modules/home/default.nix @@ -1,4 +1,4 @@ -{ ... }: +{ inputs, outputs, config, lib, ... }: { imports = [ @@ -46,4 +46,14 @@ ./containers/stalwart.nix ./containers/static.nix ]; + + config = { + nixpkgs = { + overlays = [ + outputs.overlays.unstable-packages + outputs.overlays.additions + outputs.overlays.modifications + ]; + }; + }; } diff --git a/modules/overlays.nix b/modules/overlays.nix new file mode 100644 index 0000000..e79c637 --- /dev/null +++ b/modules/overlays.nix @@ -0,0 +1,5 @@ +{ ... }: + +{ + +} diff --git a/modules/system/default.nix b/modules/system/default.nix index 9e3183f..e859e67 100644 --- a/modules/system/default.nix +++ b/modules/system/default.nix @@ -1,4 +1,4 @@ -{ ... }: +{ outputs, config, lib, ... }: { imports = [ @@ -27,4 +27,39 @@ ./display-managers/default.nix ]; + + options = { + settings.hostname = lib.mkOption { + type = lib.types.str; + description = '' + Set hostname of the system + ''; + }; + }; + + config = { + nixpkgs = { + overlays = [ + outputs.overlays.unstable-packages + outputs.overlays.additions + outputs.overlays.modifications + ]; + }; + + nix.settings = { + experimental-features = [ "nix-command" "flakes" ]; + + substituters = [ + "https://nix-community.cachix.org" + "https://cosmic.cachix.org/" + ]; + + trusted-public-keys = [ + "cosmic.cachix.org-1:Dya9IyXD4xdBehWjrkPv6rtxpmMdRel02smYzA85dPE=" + "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" + ]; + }; + + networking.hostName = config.settings.hostname; + }; } diff --git a/overlays/default.nix b/overlays/default.nix new file mode 100644 index 0000000..4fe8672 --- /dev/null +++ b/overlays/default.nix @@ -0,0 +1,18 @@ +{ inputs, ...}: { + # This one brings our custom packages from the 'pkgs' directory + additions = final: prev: import ../pkgs final.pkgs; + + # This one contains whatever you want to overlay + # You can change versions, add patches, set compilation flags, anything really. + # https://nixos.wiki/wiki/Overlays + modifications = final: prev: { + }; + + unstable-packages = final: _prev: { + unstable = import inputs.nixpkgs-unstable { + system = final.system; + config.allowUnfree = false; + }; + }; +} + diff --git a/pkgs/default.nix b/pkgs/default.nix new file mode 100644 index 0000000..fef9303 --- /dev/null +++ b/pkgs/default.nix @@ -0,0 +1,3 @@ +pkgs: { + +} diff --git a/result b/result new file mode 120000 index 0000000..1a7526a --- /dev/null +++ b/result @@ -0,0 +1 @@ +/nix/store/3knszx9hlgf4lwnkjqqlm72na4jwps92-home-manager-generation \ No newline at end of file