{ description = "Alex's NotFiles"; inputs = { nixpkgs.url = "github:nixos/nixpkgs/nixos-26.05"; home-manager = { url = "github:nix-community/home-manager/release-26.05"; inputs.nixpkgs.follows = "nixpkgs"; }; # macOS system management (paired with nixpkgs 26.05). nix-darwin = { url = "github:nix-darwin/nix-darwin/nix-darwin-26.05"; inputs.nixpkgs.follows = "nixpkgs"; }; globalprotect-openconnect.url = "github:yuezk/GlobalProtect-openconnect"; plasma-manager = { url = "github:nix-community/plasma-manager"; inputs.nixpkgs.follows = "nixpkgs"; inputs.home-manager.follows = "home-manager"; }; nix4vscode = { url = "github:nix-community/nix4vscode"; inputs.nixpkgs.follows = "nixpkgs"; }; onedark-yazi = { url = "github:BennyOe/onedark.yazi"; flake = false; }; }; outputs = { self, nixpkgs, home-manager, nix-darwin, globalprotect-openconnect, ... }@inputs: let linuxSystem = "x86_64-linux"; # Systems this repo is edited/built on: the Linux hosts and the mac. # devShells are produced for each so `direnv`/`nix develop` works on all. systems = [ "x86_64-linux" "aarch64-darwin" ]; forAllSystems = nixpkgs.lib.genAttrs systems; # Home Manager wiring shared by the NixOS (Linux) hosts. # plasma-manager is Linux-only, so it lives here rather than in the # darwin block below. nixosHome = { home-manager = { useGlobalPkgs = true; useUserPackages = true; backupFileExtension = "backup"; users.alex = import ./home/alex; extraSpecialArgs = { inherit inputs; isDarwin = false; }; sharedModules = [ inputs.plasma-manager.homeModules.plasma-manager ]; }; }; in { nixosConfigurations = { # To add a new Linux machine, duplicate this block and change the name. whitegrizzly = nixpkgs.lib.nixosSystem { system = linuxSystem; specialArgs = { inherit inputs; }; modules = [ ./hosts/whitegrizzly home-manager.nixosModules.home-manager nixosHome ]; }; oreo = nixpkgs.lib.nixosSystem { system = linuxSystem; specialArgs = { inherit inputs; }; modules = [ ./hosts/oreo home-manager.nixosModules.home-manager nixosHome ]; }; }; darwinConfigurations = { seasoned = nix-darwin.lib.darwinSystem { specialArgs = { inherit inputs; }; modules = [ ./hosts/seasoned home-manager.darwinModules.home-manager { home-manager = { useGlobalPkgs = true; useUserPackages = true; backupFileExtension = "backup"; users.alex = import ./home/alex; extraSpecialArgs = { inherit inputs; isDarwin = true; }; }; } ]; }; }; # Maintenance shell for working on this repo: formatter, linters, and # generation/closure inspectors. Kept out of every host's global profile # and auto-loaded by direnv via the repo-root .envrc (`use flake`). devShells = forAllSystems ( system: let pkgs = nixpkgs.legacyPackages.${system}; in { default = pkgs.mkShellNoCC { name = "notfiles-dev"; packages = with pkgs; [ nixfmt # RFC 166 formatter statix # lint / anti-pattern detection deadnix # find unused (dead) bindings nvd # diff two system generations / profiles nix-tree # interactively explore a closure nix-output-monitor # `nom` — readable build output ]; }; } ); }; }