diff --git a/.envrc b/.envrc index a1a301f..2c76fa5 100644 --- a/.envrc +++ b/.envrc @@ -1,2 +1 @@ -use flake export BASH_DEFAULT_TIMEOUT_MS=100000000 diff --git a/.gitignore b/.gitignore index 1269213..1b8d10d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,2 @@ *.iso result -/.pre-commit-config.yaml -.direnv diff --git a/flake.lock b/flake.lock index 0b43700..7b4c98b 100644 --- a/flake.lock +++ b/flake.lock @@ -60,22 +60,6 @@ } }, "flake-compat": { - "flake": false, - "locked": { - "lastModified": 1696426674, - "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", - "owner": "edolstra", - "repo": "flake-compat", - "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", - "type": "github" - }, - "original": { - "owner": "edolstra", - "repo": "flake-compat", - "type": "github" - } - }, - "flake-compat_2": { "flake": false, "locked": { "lastModified": 1747046372, @@ -92,34 +76,12 @@ } }, "git-hooks": { - "inputs": { - "flake-compat": "flake-compat", - "gitignore": "gitignore", - "nixpkgs": [ - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1750779888, - "narHash": "sha256-wibppH3g/E2lxU43ZQHC5yA/7kIKLGxVEnsnVK1BtRg=", - "owner": "cachix", - "repo": "git-hooks.nix", - "rev": "16ec914f6fb6f599ce988427d9d94efddf25fe6d", - "type": "github" - }, - "original": { - "owner": "cachix", - "repo": "git-hooks.nix", - "type": "github" - } - }, - "git-hooks_2": { "inputs": { "flake-compat": [ "simple-nixos-mailserver", "flake-compat" ], - "gitignore": "gitignore_2", + "gitignore": "gitignore", "nixpkgs": [ "simple-nixos-mailserver", "nixpkgs" @@ -140,27 +102,6 @@ } }, "gitignore": { - "inputs": { - "nixpkgs": [ - "git-hooks", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1709087332, - "narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=", - "owner": "hercules-ci", - "repo": "gitignore.nix", - "rev": "637db329424fd7e46cf4185293b9cc8c88c95394", - "type": "github" - }, - "original": { - "owner": "hercules-ci", - "repo": "gitignore.nix", - "type": "github" - } - }, - "gitignore_2": { "inputs": { "nixpkgs": [ "simple-nixos-mailserver", @@ -210,11 +151,11 @@ ] }, "locked": { - "lastModified": 1752780124, - "narHash": "sha256-5dn97vIYxn6VozKePOQSDxVCsrl38nDdMJXx86KIJH0=", + "lastModified": 1752544374, + "narHash": "sha256-ReX0NG6nIAEtQQjLqeu1vUU2jjZuMlpymNtb4VQYeus=", "owner": "nix-community", "repo": "home-manager", - "rev": "c718918222bdb104397762dea67e6b397a7927fe", + "rev": "2e00ed310c218127e02ffcf28ddd4e0f669fde3e", "type": "github" }, "original": { @@ -226,11 +167,11 @@ }, "nixos-hardware": { "locked": { - "lastModified": 1752666637, - "narHash": "sha256-P8J72psdc/rWliIvp8jUpoQ6qRDlVzgSDDlgkaXQ0Fw=", + "lastModified": 1752048960, + "narHash": "sha256-gATnkOe37eeVwKKYCsL+OnS2gU4MmLuZFzzWCtaKLI8=", "owner": "NixOS", "repo": "nixos-hardware", - "rev": "d1bfa8f6ccfb5c383e1eba609c1eb67ca24ed153", + "rev": "7ced9122cff2163c6a0212b8d1ec8c33a1660806", "type": "github" }, "original": { @@ -274,11 +215,11 @@ }, "nixpkgsUnstable": { "locked": { - "lastModified": 1752687322, - "narHash": "sha256-RKwfXA4OZROjBTQAl9WOZQFm7L8Bo93FQwSJpAiSRvo=", + "lastModified": 1752480373, + "narHash": "sha256-JHQbm+OcGp32wAsXTE/FLYGNpb+4GLi5oTvCxwSoBOA=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "6e987485eb2c77e5dcc5af4e3c70843711ef9251", + "rev": "62e0f05ede1da0d54515d4ea8ce9c733f12d9f08", "type": "github" }, "original": { @@ -290,11 +231,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1752620740, - "narHash": "sha256-f3pO+9lg66mV7IMmmIqG4PL3223TYMlnlw+pnpelbss=", + "lastModified": 1752436162, + "narHash": "sha256-Kt1UIPi7kZqkSc5HVj6UY5YLHHEzPBkgpNUByuyxtlw=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "32a4e87942101f1c9f9865e04dc3ddb175f5f32e", + "rev": "dfcd5b901dbab46c9c6e80b265648481aafb01f8", "type": "github" }, "original": { @@ -323,7 +264,6 @@ "root": { "inputs": { "agenix": "agenix", - "git-hooks": "git-hooks", "home-manager": "home-manager_2", "nixos-hardware": "nixos-hardware", "nixpkgs": "nixpkgs_2", @@ -334,8 +274,8 @@ "simple-nixos-mailserver": { "inputs": { "blobs": "blobs", - "flake-compat": "flake-compat_2", - "git-hooks": "git-hooks_2", + "flake-compat": "flake-compat", + "git-hooks": "git-hooks", "nixpkgs": "nixpkgs_3", "nixpkgs-25_05": "nixpkgs-25_05" }, diff --git a/flake.nix b/flake.nix index 143389a..8dadb7e 100644 --- a/flake.nix +++ b/flake.nix @@ -9,10 +9,6 @@ }; agenix.url = "github:ryantm/agenix"; simple-nixos-mailserver.url = "gitlab:simple-nixos-mailserver/nixos-mailserver/nixos-25.05"; - git-hooks = { - url = "github:cachix/git-hooks.nix"; - inputs.nixpkgs.follows = "nixpkgs"; - }; }; outputs = @@ -23,107 +19,103 @@ nixos-hardware, agenix, simple-nixos-mailserver, - git-hooks, ... }: let system = "x86_64-linux"; - overlayUnstable = _final: _prev: { + overlayUnstable = final: prev: { unstable = import nixpkgsUnstable { inherit system; config.allowUnfree = true; config.android_sdk.accept_license = true; }; }; - - # Common modules shared across all hosts - commonModules = [ - agenix.nixosModules.default - { - environment.systemPackages = [ agenix.packages.${system}.default ]; - } - { - nixpkgs.overlays = [ overlayUnstable ]; - } - ]; - - # Common home-manager modules - homeManagerModules = [ - home-manager.nixosModules.home-manager - { - home-manager.useGlobalPkgs = true; - home-manager.useUserPackages = true; - } - ]; - - # Helper function to create a host configuration - mkHost = - { - hostPath, - extraModules ? [ ], - includeHomeManager ? true, - specialArgs ? { }, - }: - nixpkgs.lib.nixosSystem { - inherit system specialArgs; - modules = - commonModules - ++ (if includeHomeManager then homeManagerModules else [ ]) - ++ extraModules - ++ [ hostPath ]; - }; in - rec { + { nixosConfigurations = { - nixbox = mkHost { - hostPath = ./hosts/nixbox; + nixbox = nixpkgs.lib.nixosSystem { + inherit system; + modules = [ + agenix.nixosModules.default + { + environment.systemPackages = [ agenix.packages.${system}.default ]; + } + ( + { config, pkgs, ... }: + { + nixpkgs.overlays = [ overlayUnstable ]; + } + ) + home-manager.nixosModules.home-manager + { + home-manager.useGlobalPkgs = true; + home-manager.useUserPackages = true; + } + ./hosts/nixbox + ]; }; - - flynode = mkHost { - hostPath = ./hosts/flynode; - extraModules = [ nixos-hardware.nixosModules.lenovo-thinkpad-z13-gen1 ]; + flynode = nixpkgs.lib.nixosSystem { + inherit system; + modules = [ + agenix.nixosModules.default + { + environment.systemPackages = [ agenix.packages.${system}.default ]; + } + ( + { config, pkgs, ... }: + { + nixpkgs.overlays = [ overlayUnstable ]; + } + ) + nixos-hardware.nixosModules.lenovo-thinkpad-z13-gen1 + home-manager.nixosModules.home-manager + { + home-manager.useGlobalPkgs = true; + home-manager.useUserPackages = true; + } + ./hosts/flynode + ]; }; - - thewordnerd = mkHost { - hostPath = ./hosts/hub; - extraModules = [ simple-nixos-mailserver.nixosModule ]; + thewordnerd = nixpkgs.lib.nixosSystem { + inherit system; specialArgs = { inherit inputs; }; + modules = [ + agenix.nixosModules.default + { + environment.systemPackages = [ agenix.packages.${system}.default ]; + } + ( + { config, pkgs, ... }: + { + nixpkgs.overlays = [ overlayUnstable ]; + } + ) + home-manager.nixosModules.home-manager + { + home-manager.useGlobalPkgs = true; + home-manager.useUserPackages = true; + } + simple-nixos-mailserver.nixosModule + ./hosts/hub + ]; }; - - garden = mkHost { - hostPath = ./hosts/garden; - includeHomeManager = false; + garden = nixpkgs.lib.nixosSystem { + inherit system; specialArgs = { inherit inputs; }; + modules = [ + agenix.nixosModules.default + { + environment.systemPackages = [ agenix.packages.${system}.default ]; + } + ( + { config, pkgs, ... }: + { + nixpkgs.overlays = [ overlayUnstable ]; + } + ) + ./hosts/garden + ]; }; }; - - checks.${system} = { - pre-commit-check = git-hooks.lib.${system}.run { - src = ./.; - hooks = { - # Check formatting of flake.nix - nixfmt-rfc-style = { - enable = true; - files = "^flake\\.nix$"; - }; - # Check for dead code in flake.nix - deadnix = { - enable = true; - files = "^flake\\.nix$"; - }; - # Flake-specific checks - flake-checker.enable = true; - }; - }; - }; - - devShells.${system}.default = - let - pkgs = nixpkgs.legacyPackages.${system}; - in - pkgs.mkShell { - inherit (checks.${system}.pre-commit-check) shellHook; - buildInputs = checks.${system}.pre-commit-check.enabledPackages; - }; }; } diff --git a/hosts/flynode/hardware-configuration.nix b/hosts/flynode/hardware-configuration.nix index 1c2c205..aeb3788 100644 --- a/hosts/flynode/hardware-configuration.nix +++ b/hosts/flynode/hardware-configuration.nix @@ -1,62 +1,47 @@ # 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, - ... -}: +{ config, lib, pkgs, modulesPath, ... }: { - imports = [ - (modulesPath + "/installer/scan/not-detected.nix") - ]; + imports = + [ (modulesPath + "/installer/scan/not-detected.nix") + ]; - boot.initrd.availableKernelModules = [ - "nvme" - "xhci_pci" - "thunderbolt" - "usb_storage" - "sd_mod" - ]; + boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "thunderbolt" "usb_storage" "sd_mod" ]; boot.initrd.kernelModules = [ ]; boot.kernelModules = [ "kvm-amd" ]; boot.extraModulePackages = [ ]; - fileSystems."/" = { - device = "zpool/root"; - fsType = "zfs"; - }; + fileSystems."/" = + { device = "zpool/root"; + fsType = "zfs"; + }; - fileSystems."/home" = { - device = "zpool/home"; - fsType = "zfs"; - }; + fileSystems."/home" = + { device = "zpool/home"; + fsType = "zfs"; + }; - fileSystems."/var" = { - device = "zpool/var"; - fsType = "zfs"; - }; + fileSystems."/var" = + { device = "zpool/var"; + fsType = "zfs"; + }; - fileSystems."/nix" = { - device = "zpool/nix"; - fsType = "zfs"; - }; + fileSystems."/nix" = + { device = "zpool/nix"; + fsType = "zfs"; + }; - fileSystems."/boot" = { - device = "/dev/disk/by-uuid/001D-B2B7"; - fsType = "vfat"; - options = [ - "fmask=0022" - "dmask=0022" + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/001D-B2B7"; + fsType = "vfat"; + options = [ "fmask=0022" "dmask=0022" ]; + }; + + swapDevices = + [ { device = "/dev/disk/by-uuid/c9a2faf8-4e35-4946-a70f-c84d0fa359df"; } ]; - }; - - swapDevices = [ - { device = "/dev/disk/by-uuid/c9a2faf8-4e35-4946-a70f-c84d0fa359df"; } - ]; # 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 diff --git a/hosts/garden/hardware-configuration.nix b/hosts/garden/hardware-configuration.nix index a318f39..b584d72 100644 --- a/hosts/garden/hardware-configuration.nix +++ b/hosts/garden/hardware-configuration.nix @@ -6,20 +6,9 @@ efiInstallAsRemovable = true; device = "nodev"; }; - fileSystems."/boot" = { - device = "/dev/disk/by-uuid/FAAB-A09E"; - fsType = "vfat"; - }; - boot.initrd.availableKernelModules = [ - "ata_piix" - "uhci_hcd" - "xen_blkfront" - "vmw_pvscsi" - ]; + fileSystems."/boot" = { device = "/dev/disk/by-uuid/FAAB-A09E"; fsType = "vfat"; }; + boot.initrd.availableKernelModules = [ "ata_piix" "uhci_hcd" "xen_blkfront" "vmw_pvscsi" ]; boot.initrd.kernelModules = [ "nvme" ]; - fileSystems."/" = { - device = "/dev/sda1"; - fsType = "ext4"; - }; - + fileSystems."/" = { device = "/dev/sda1"; fsType = "ext4"; }; + } diff --git a/hosts/hub/apps/nextcloud.nix b/hosts/hub/apps/nextcloud.nix index 8e51e1e..e0511be 100644 --- a/hosts/hub/apps/nextcloud.nix +++ b/hosts/hub/apps/nextcloud.nix @@ -58,7 +58,7 @@ # The nextcloud-setup service blocks container startup when it needs to perform upgrades, # creating a circular dependency: the network can't be configured until the container is ready, # but the container can't be ready without network access for the upgrade. - # + # # To upgrade Nextcloud when changing major versions: # 1. Uncomment the lines below to disable nextcloud-setup # 2. Run: nixos-rebuild switch diff --git a/hosts/hub/hardware-configuration.nix b/hosts/hub/hardware-configuration.nix index abfc4a3..f5be4cb 100644 --- a/hosts/hub/hardware-configuration.nix +++ b/hosts/hub/hardware-configuration.nix @@ -1,56 +1,43 @@ # 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, - ... -}: +{ config, lib, pkgs, modulesPath, ... }: { - imports = [ - (modulesPath + "/installer/scan/not-detected.nix") - ]; + imports = + [ (modulesPath + "/installer/scan/not-detected.nix") + ]; - boot.initrd.availableKernelModules = [ - "xhci_pci" - "ahci" - "nvme" - ]; + boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" ]; boot.initrd.kernelModules = [ ]; boot.kernelModules = [ "kvm-intel" ]; boot.extraModulePackages = [ ]; - fileSystems."/" = { - device = "zpool/root"; - fsType = "zfs"; - }; + fileSystems."/" = + { device = "zpool/root"; + fsType = "zfs"; + }; - fileSystems."/nix" = { - device = "zpool/nix"; - fsType = "zfs"; - }; + fileSystems."/nix" = + { device = "zpool/nix"; + fsType = "zfs"; + }; - fileSystems."/var" = { - device = "zpool/var"; - fsType = "zfs"; - }; + fileSystems."/var" = + { device = "zpool/var"; + fsType = "zfs"; + }; - fileSystems."/home" = { - device = "zpool/home"; - fsType = "zfs"; - }; + fileSystems."/home" = + { device = "zpool/home"; + fsType = "zfs"; + }; - fileSystems."/boot" = { - device = "/dev/disk/by-uuid/8ADD-D5B1"; - fsType = "vfat"; - options = [ - "fmask=0022" - "dmask=0022" - ]; - }; + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/8ADD-D5B1"; + fsType = "vfat"; + options = [ "fmask=0022" "dmask=0022" ]; + }; swapDevices = [ ]; diff --git a/hosts/nixbox/hardware-configuration.nix b/hosts/nixbox/hardware-configuration.nix index 1bcb0ef..b981b65 100644 --- a/hosts/nixbox/hardware-configuration.nix +++ b/hosts/nixbox/hardware-configuration.nix @@ -1,46 +1,28 @@ # 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, - ... -}: +{ config, lib, pkgs, modulesPath, ... }: { - imports = [ - (modulesPath + "/installer/scan/not-detected.nix") - ]; + imports = + [ (modulesPath + "/installer/scan/not-detected.nix") + ]; - boot.initrd.availableKernelModules = [ - "xhci_pci" - "thunderbolt" - "ahci" - "nvme" - "usbhid" - "usb_storage" - "sd_mod" - "sdhci_pci" - ]; + boot.initrd.availableKernelModules = [ "xhci_pci" "thunderbolt" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod" "sdhci_pci" ]; boot.initrd.kernelModules = [ ]; boot.kernelModules = [ "kvm-intel" ]; boot.extraModulePackages = [ ]; - fileSystems."/" = { - device = "/dev/disk/by-uuid/a0df6959-f878-48d0-aabe-5f46915c1921"; - fsType = "ext4"; - }; + fileSystems."/" = + { device = "/dev/disk/by-uuid/a0df6959-f878-48d0-aabe-5f46915c1921"; + fsType = "ext4"; + }; - fileSystems."/boot" = { - device = "/dev/disk/by-uuid/7EEE-698D"; - fsType = "vfat"; - options = [ - "fmask=0077" - "dmask=0077" - ]; - }; + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/7EEE-698D"; + fsType = "vfat"; + options = [ "fmask=0077" "dmask=0077" ]; + }; swapDevices = [ ]; diff --git a/roles/flatpak.nix b/roles/flatpak.nix index 2f335d3..5014f01 100644 --- a/roles/flatpak.nix +++ b/roles/flatpak.nix @@ -4,4 +4,4 @@ environment.profileRelativeSessionVariables.PATH = [ "$HOME/.local/share/flatpak/exports/bin" ]; -} +} \ No newline at end of file