configurations for my servers and desktops
nix nixos flake dots dotfiles

chore: cleanup

+106 -147
+76 -65
flake.nix
··· 1 1 { 2 - description = "Darwin and NixOS system configurations"; 3 - 4 2 inputs = { 5 - agenix.url = "github:ryantm/agenix"; 6 - home-manager.url = "github:nix-community/home-manager"; 7 - home-manager-stable.url = "github:nix-community/home-manager/release-25.11"; 8 - mac-app-util.url = "github:hraban/mac-app-util"; 9 - nix-darwin.url = "github:nix-darwin/nix-darwin/master"; 10 - nixos-wsl.url = "github:nix-community/NixOS-WSL/main"; 11 3 nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; 12 4 nixpkgs-stable.url = "github:NixOS/nixpkgs/nixos-25.11"; 13 5 nixpkgs-tlp-pr.url = "github:NixOS/nixpkgs/pull/473626/head"; 14 - 15 - home-manager.inputs.nixpkgs.follows = "nixpkgs"; 16 - home-manager-stable.inputs.nixpkgs.follows = "nixpkgs-stable"; 17 - nix-darwin.inputs.nixpkgs.follows = "nixpkgs"; 6 + home-manager = { 7 + url = "github:nix-community/home-manager"; 8 + inputs.nixpkgs.follows = "nixpkgs"; 9 + }; 10 + home-manager-stable = { 11 + url = "github:nix-community/home-manager/release-25.11"; 12 + inputs.nixpkgs.follows = "nixpkgs-stable"; 13 + }; 14 + nix-darwin = { 15 + url = "github:nix-darwin/nix-darwin"; 16 + inputs.nixpkgs.follows = "nixpkgs"; 17 + }; 18 + mac-app-util.url = "github:hraban/mac-app-util"; 19 + nixos-wsl.url = "github:nix-community/NixOS-WSL"; 20 + agenix.url = "github:ryantm/agenix"; 18 21 }; 19 22 20 - outputs = inputs: { 21 - darwinConfigurations.neo = inputs.nix-darwin.lib.darwinSystem { 22 - specialArgs = inputs; 23 - modules = [ 24 - ./modules/common 25 - ./modules/darwin 26 - ./hosts/neo 27 - inputs.home-manager.darwinModules.home-manager 28 - inputs.mac-app-util.darwinModules.default 29 - { 30 - home-manager = { 31 - sharedModules = [inputs.mac-app-util.homeManagerModules.default]; 32 - }; 33 - } 34 - ]; 23 + outputs = { 24 + self, 25 + nixpkgs, 26 + nixpkgs-stable, 27 + nixpkgs-tlp-pr, 28 + nix-darwin, 29 + home-manager, 30 + home-manager-stable, 31 + mac-app-util, 32 + nixos-wsl, 33 + agenix, 34 + }: let 35 + commonModules = [./modules/common]; 36 + in { 37 + darwinConfigurations.neo = nix-darwin.lib.darwinSystem { 38 + modules = 39 + commonModules 40 + ++ [ 41 + ./modules/darwin 42 + ./hosts/neo 43 + home-manager.darwinModules.home-manager 44 + mac-app-util.darwinModules.default 45 + {home-manager.sharedModules = [mac-app-util.homeManagerModules.default];} 46 + ]; 35 47 }; 36 48 37 - nixosConfigurations.trinity = inputs.nixpkgs-tlp-pr.lib.nixosSystem { 38 - specialArgs = inputs; 39 - modules = [ 40 - ./modules/common 41 - ./modules/nixos 42 - ./hosts/trinity 43 - inputs.home-manager.nixosModules.home-manager 44 - ]; 45 - }; 49 + nixosConfigurations = { 50 + trinity = nixpkgs-tlp-pr.lib.nixosSystem { 51 + modules = 52 + commonModules 53 + ++ [ 54 + ./modules/nixos 55 + ./hosts/trinity 56 + home-manager.nixosModules.home-manager 57 + ]; 58 + }; 46 59 47 - nixosConfigurations.bluepill = inputs.nixpkgs-stable.lib.nixosSystem { 48 - specialArgs = inputs; 49 - modules = [ 50 - ./modules/common 51 - ./modules/nixos 52 - ./hosts/bluepill 53 - inputs.agenix.nixosModules.default 54 - inputs.home-manager-stable.nixosModules.home-manager 55 - { 56 - nixpkgs.overlays = [ 57 - (final: prev: { 58 - tailscale = inputs.nixpkgs.legacyPackages.${prev.stdenv.hostPlatform.system}.tailscale; 59 - }) 60 + bluepill = nixpkgs-stable.lib.nixosSystem { 61 + modules = 62 + commonModules 63 + ++ [ 64 + ./modules/nixos 65 + ./hosts/bluepill 66 + agenix.nixosModules.default 67 + home-manager-stable.nixosModules.home-manager 68 + { 69 + nixpkgs.overlays = [ 70 + (final: prev: { 71 + tailscale = nixpkgs.legacyPackages.${prev.stdenv.hostPlatform.system}.tailscale; 72 + }) 73 + ]; 74 + } 60 75 ]; 61 - } 62 - ]; 63 - }; 76 + }; 64 77 65 - nixosConfigurations.tank-wsl = inputs.nixpkgs.lib.nixosSystem { 66 - specialArgs = inputs; 67 - modules = [ 68 - ./modules/common 69 - ./modules/nixos 70 - ./hosts/tank-wsl 71 - inputs.home-manager.nixosModules.home-manager 72 - inputs.nixos-wsl.nixosModules.default 73 - ]; 78 + tank-wsl = nixpkgs.lib.nixosSystem { 79 + modules = 80 + commonModules 81 + ++ [ 82 + ./modules/nixos 83 + ./hosts/tank-wsl 84 + home-manager.nixosModules.home-manager 85 + nixos-wsl.nixosModules.default 86 + ]; 87 + }; 74 88 }; 75 89 76 - formatter = { 77 - aarch64-darwin = inputs.nixpkgs.legacyPackages.aarch64-darwin.alejandra; 78 - x86_64-linux = inputs.nixpkgs.legacyPackages.x86_64-linux.alejandra; 79 - }; 90 + formatter = nixpkgs.lib.genAttrs ["aarch64-darwin" "x86_64-linux"] (system: nixpkgs.legacyPackages.${system}.alejandra); 80 91 }; 81 92 }
-8
hosts/bluepill/default.nix
··· 1 1 {pkgs, ...}: { 2 2 imports = [ 3 3 ./hardware.nix 4 - ./services/fwupd.nix 5 4 ./services/homepage.nix 6 5 ./services/jellyfin.nix 7 6 ./services/mikusmp67.nix ··· 10 9 ./services/restic.nix 11 10 ./services/samba.nix 12 11 ./services/slskd.nix 13 - ./services/ssh.nix 14 - ./services/tailscale.nix 15 12 ./services/transmission.nix 16 13 ]; 17 - 18 - boot.loader = { 19 - systemd-boot.enable = true; 20 - efi.canTouchEfiVariables = true; 21 - }; 22 14 23 15 networking.hostName = "bluepill"; 24 16
+1 -7
hosts/bluepill/hardware.nix
··· 1 - # Do not modify this file! It was generated by ‘nixos-generate-config’ 2 - # and may be overwritten by future invocations. Please make changes 3 - # to /etc/nixos/configuration.nix instead. 4 1 { 5 2 config, 6 3 lib, 7 - pkgs, 8 4 modulesPath, 9 5 ... 10 6 }: { 11 - imports = [ 12 - (modulesPath + "/installer/scan/not-detected.nix") 13 - ]; 7 + imports = [(modulesPath + "/installer/scan/not-detected.nix")]; 14 8 15 9 boot.initrd.availableKernelModules = ["nvme" "xhci_pci" "ahci" "xhci_pci_renesas" "usbhid" "sd_mod"]; 16 10 boot.initrd.kernelModules = [];
hosts/bluepill/services/fwupd.nix modules/nixos/services/fwupd.nix
-1
hosts/bluepill/services/jellyfin.nix
··· 8 8 openFirewall = true; 9 9 }; 10 10 11 - # enable nvidia shit 12 11 hardware.graphics.enable = true; 13 12 services.xserver.videoDrivers = ["nvidia"]; 14 13 hardware.nvidia = {
-10
hosts/bluepill/services/ssh.nix
··· 1 - {...}: { 2 - services = { 3 - openssh = { 4 - enable = true; 5 - settings.PasswordAuthentication = false; 6 - }; 7 - 8 - fail2ban.enable = true; 9 - }; 10 - }
hosts/bluepill/services/tailscale.nix modules/nixos/services/tailscale.nix
+1 -7
hosts/tank-wsl/default.nix
··· 1 - { 2 - config, 3 - lib, 4 - pkgs, 5 - ... 6 - }: { 1 + {...}: { 7 2 wsl.enable = true; 8 3 wsl.defaultUser = "devin"; 9 - 10 4 system.stateVersion = "25.05"; 11 5 }
+1 -13
hosts/trinity/default.nix
··· 1 - { 2 - config, 3 - pkgs, 4 - ... 5 - }: { 1 + {pkgs, ...}: { 6 2 imports = [ 7 3 ./hardware.nix 8 - ./services/fwupd.nix 9 4 ./services/power.nix 10 - ./services/ssh.nix 11 - ./services/tailscale.nix 12 5 ]; 13 - 14 - boot.loader = { 15 - systemd-boot.enable = true; 16 - efi.canTouchEfiVariables = true; 17 - }; 18 6 19 7 networking.hostName = "trinity"; 20 8 networking.networkmanager.enable = true;
+1 -7
hosts/trinity/hardware.nix
··· 1 - # Do not modify this file! It was generated by ‘nixos-generate-config’ 2 - # and may be overwritten by future invocations. Please make changes 3 - # to /etc/nixos/configuration.nix instead. 4 1 { 5 2 config, 6 3 lib, 7 - pkgs, 8 4 modulesPath, 9 5 ... 10 6 }: { 11 - imports = [ 12 - (modulesPath + "/installer/scan/not-detected.nix") 13 - ]; 7 + imports = [(modulesPath + "/installer/scan/not-detected.nix")]; 14 8 15 9 boot.initrd.availableKernelModules = ["xhci_pci" "ahci" "usbhid" "sd_mod" "rtsx_pci_sdmmc"]; 16 10 boot.initrd.kernelModules = [];
-3
hosts/trinity/services/fwupd.nix
··· 1 - {...}: { 2 - services.fwupd.enable = true; 3 - }
-1
hosts/trinity/services/ssh.nix modules/nixos/services/ssh.nix
··· 4 4 enable = true; 5 5 settings.PasswordAuthentication = false; 6 6 }; 7 - 8 7 fail2ban.enable = true; 9 8 }; 10 9 }
-3
hosts/trinity/services/tailscale.nix
··· 1 - {...}: { 2 - services.tailscale.enable = true; 3 - }
+1 -6
modules/darwin/default.nix
··· 1 1 {lib, ...}: { 2 - system = { 3 - stateVersion = 6; 4 - configurationRevision = null; 5 - primaryUser = "devin"; 6 - }; 7 - 2 + system.stateVersion = 6; 8 3 nixpkgs.hostPlatform = lib.mkDefault "aarch64-darwin"; 9 4 10 5 homebrew = {
+11
modules/nixos/default.nix
··· 1 1 {lib, ...}: { 2 + imports = [ 3 + ./services/fwupd.nix 4 + ./services/ssh.nix 5 + ./services/tailscale.nix 6 + ]; 7 + 2 8 system.stateVersion = lib.mkDefault "24.11"; 3 9 nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; 10 + 11 + boot.loader = { 12 + systemd-boot.enable = lib.mkDefault true; 13 + efi.canTouchEfiVariables = lib.mkDefault true; 14 + }; 4 15 5 16 zramSwap.enable = true; 6 17 time.timeZone = lib.mkDefault "America/Nassau";
+14 -16
modules/users/devin.nix
··· 1 - { 2 - lib, 3 - pkgs, 4 - ... 5 - }: let 1 + {pkgs, ...}: let 2 + isDarwin = pkgs.stdenv.isDarwin; 6 3 homeDir = 7 - if pkgs.stdenv.isDarwin 4 + if isDarwin 8 5 then "/Users/devin" 9 6 else "/home/devin"; 10 7 in { ··· 13 10 home = homeDir; 14 11 shell = pkgs.fish; 15 12 } 16 - // lib.optionalAttrs (!pkgs.stdenv.isDarwin) { 17 - isNormalUser = true; 18 - extraGroups = ["networkmanager" "wheel"]; 19 - } 20 - // lib.optionalAttrs pkgs.stdenv.isDarwin { 21 - uid = 501; 22 - }; 13 + // ( 14 + if isDarwin 15 + then {uid = 501;} 16 + else { 17 + isNormalUser = true; 18 + extraGroups = ["networkmanager" "wheel"]; 19 + } 20 + ); 23 21 24 22 home-manager.users.devin = {pkgs, ...}: { 25 23 home = { ··· 57 55 58 56 git = { 59 57 enable = true; 60 - settings = { 61 - user.name = "intergrav"; 62 - user.email = "devin@devins.page"; 58 + userName = "intergrav"; 59 + userEmail = "devin@devins.page"; 60 + extraConfig = { 63 61 credential.helper = "!gh auth git-credential"; 64 62 pull.rebase = true; 65 63 rebase.autoStash = true;