{ description = "Home Manager configuration for noah"; inputs = { # Specify the source of Home Manager and Nixpkgs. nixpkgs.url = "github:nixos/nixpkgs/nixos-25.11"; nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable"; nixos-wsl = { url = "github:nix-community/NixOS-WSL/main"; inputs.nixpkgs.follows = "nixpkgs"; }; determinite = { url = "https://flakehub.com/f/DeterminateSystems/determinate/3"; inputs.nixpkgs.follows = "nixpkgs"; }; home-manager = { url = "github:nix-community/home-manager/release-25.11"; inputs.nixpkgs.follows = "nixpkgs"; }; pre-commit-hooks = { url = "github:cachix/git-hooks.nix"; inputs.nixpkgs.follows = "nixpkgs"; }; agenix = { url = "github:ryantm/agenix"; inputs.nixpkgs.follows = "nixpkgs"; }; }; outputs = { self, nixpkgs, nixpkgs-unstable, nixos-wsl, determinite, home-manager, pre-commit-hooks, agenix, ... }@inputs: let supportedSystems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ]; forAllSystems = nixpkgs.lib.genAttrs supportedSystems; basicSystem = { system ? "x86_64-linux", modules ? [ ], useUnstable ? false, extraGroups ? [ ], overlays ? [ ], enableNFTables ? true, }: let unstable = import nixpkgs-unstable { inherit system overlays; config.allowUnfree = true; }; in inputs.nixpkgs.lib.nixosSystem { inherit system; specialArgs = { inherit inputs extraGroups enableNFTables; } // nixpkgs.lib.optionalAttrs useUnstable { inherit unstable; }; modules = [ determinite.nixosModules.default ./common.nix ./users.nix ./services.nix agenix.nixosModules.default home-manager.nixosModules.home-manager { home-manager.useGlobalPkgs = true; home-manager.useUserPackages = true; home-manager.users.noah = ./default-home.nix; home-manager.extraSpecialArgs = { inherit inputs; } // nixpkgs.lib.optionalAttrs useUnstable { inherit unstable; }; } ] ++ modules; }; in { # incomplete nixosConfigurations.odin = basicSystem { extraGroups = [ "libvirtd" "qemu-libvirtd" "docker" ]; useUnstable = true; modules = [ ./host-specific/odin/configuration.nix ]; }; nixosConfigurations.shizuri = basicSystem { useUnstable = true; modules = [ ./host-specific/shizuri/configuration.nix ]; }; nixosConfigurations.misaki = basicSystem { useUnstable = true; extraGroups = [ "render" "nats" "litterbox" "httpd" ]; modules = [ ./host-specific/misaki/configuration.nix ]; overlays = [ (final: prev: { # Override the version of Plex installed to be the latest plexRaw = prev.plexRaw.overrideAttrs rec { version = "1.43.0.10389-8be686aa6"; src = final.fetchurl { url = "https://downloads.plex.tv/plex-media-server-new/${version}/debian/plexmediaserver_${version}_amd64.deb"; sha256 = "0HjB8Ggekwl5dKwM1Kh51Ic25t3V6veKbuzM7czrpeg="; }; }; ## Override the json object that contains verions and hashes for Immich #immich = prev.immich.override { sourcesJSON = ./overrides/immich-sources.json; }; ## Fix errors wit numpy version failing to resolve in the immich ML package #immich-machine-learning = prev.immich-machine-learning.overrideAttrs # (finalAttrs: prevAttrs: { # pythonRelaxDeps = prevAttrs.pythonRelaxDeps ++ [ "numpy" ]; # }); }) ]; }; nixosConfigurations.touma-wsl = basicSystem { useUnstable = true; modules = [ ./host-specific/touma-wsl.nix nixos-wsl.nixosModules.default ]; enableNFTables = false; }; nixosConfigurations.edge = basicSystem { useUnstable = true; modules = [ ./host-specific/edge/configuration.nix ]; }; homeConfigurations."noah-aleister" = home-manager.lib.homeManagerConfiguration { pkgs = import nixpkgs { system = "aarch64-darwin"; config.allowUnfree = true; }; # Specify your home configuration modules here, for example, # the path to your home.nix. modules = [ ./host-specific/aleister-noah.nix agenix.homeManagerModules.default ]; # Optionally use extraSpecialArgs # to pass through arguments to home.nix extraSpecialArgs = { unstable = import nixpkgs-unstable { system = "aarch64-darwin"; config.allowUnfree = true; }; }; }; homeConfigurations."noah" = let system = "x86_64-linux"; pkgs = import nixpkgs { inherit system; config.allowUnfree = true; }; unstable = import nixpkgs-unstable { inherit system; config.allowUnfree = true; }; in home-manager.lib.homeManagerConfiguration { inherit pkgs; # Specify your home configuration modules here, for example, # the path to your home.nix. modules = [ ./default-home.nix { nix.package = pkgs.nix; } ]; # Optionally use extraSpecialArgs # to pass through arguments to home.nix extraSpecialArgs = { inherit unstable; inputs = inputs; }; }; checks = forAllSystems (system: { pre-commit-check = pre-commit-hooks.lib.${system}.run { src = ./.; # If your hooks are intrusive, avoid running on each commit with a default_states like this: # default_stages = ["manual" "push"]; hooks = { nixfmt-rfc-style.enable = true; nil.enable = true; luacheck.enable = true; }; }; }); devShells = forAllSystems (system: { default = nixpkgs.legacyPackages.${system}.mkShell { inherit (self.checks.${system}.pre-commit-check) shellHook; buildInputs = [ nixpkgs.legacyPackages.${system}.nixfmt-rfc-style ] ++ self.checks.${system}.pre-commit-check.enabledPackages; }; }); formatter = forAllSystems (system: inputs.nixpkgs.legacyPackages.${system}.nixfmt-rfc-style); }; }