{ description = "FredOS NixOS configuration"; inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-26.05"; home-manager = { url = "github:nix-community/home-manager/release-26.05"; inputs.nixpkgs.follows = "nixpkgs"; }; zen-browser = { url = "github:0xc000022070/zen-browser-flake"; # no nixpkgs.follows: zen needs ffmpeg_9, only in unstable inputs.home-manager.follows = "home-manager"; }; nix-cachyos-kernel.url = "github:xddxdd/nix-cachyos-kernel/release"; lanzaboote = { url = "github:nix-community/lanzaboote/v1.2.0"; inputs.nixpkgs.follows = "nixpkgs"; }; proton-cachyos-nix.url = "github:powerofthe69/proton-cachyos-nix"; loupe = { url = "git+https://forg.gregersen.it/lazzexus/Loupe"; inputs.nixpkgs.follows = "nixpkgs"; }; # Source only, not this flake's outputs: nixpkgs' redlib predates the wreq # switch and Reddit 403s its rustls TLS fingerprint (see services/redlib.nix). redlib = { url = "github:redlib-org/redlib"; flake = false; }; stardew-tracker = { url = "git+https://forg.gregersen.it/rope/stardew-tracker"; inputs.nixpkgs.follows = "nixpkgs"; }; stylix = { url = "github:nix-community/stylix/release-26.05"; inputs.nixpkgs.follows = "nixpkgs"; }; }; outputs = { self , nixpkgs , home-manager , zen-browser , nix-cachyos-kernel , stylix , proton-cachyos-nix , stardew-tracker , ... } @ inputs: let system = "x86_64-linux"; baseModules = hostname: [ ./hosts/${hostname}.nix ./common.nix home-manager.nixosModules.home-manager stylix.nixosModules.stylix stardew-tracker.nixosModules.default ./settings/stylix.nix ]; mkHost = hostname: extraModules: nixpkgs.lib.nixosSystem { inherit system; specialArgs = { inherit inputs; }; modules = baseModules hostname ++ extraModules; }; in { # Everything FredOS-Gaming is, minus the hardware — for anyone who wants # to run this config on their own machine. They import this module next # to their own hardware-configuration.nix from their own flake (readme.md # has the snippet). `_module.args` stands in for mkHost's specialArgs, # which a plain module can't set. nixosModules.gaming = { lib, ... }: { imports = baseModules "FredOS-Gaming"; _module.args.inputs = inputs; # Hostname gates every FredOS-Gaming module, so it has to keep matching. # These four otherwise live in hosts/hardware/FredOS-Gaming.nix, which # is exactly the file a guest replaces. networking.hostName = "FredOS-Gaming"; nixpkgs.hostPlatform = lib.mkDefault system; system.stateVersion = lib.mkDefault "25.11"; boot.loader.systemd-boot.enable = lib.mkDefault true; boot.loader.efi.canTouchEfiVariables = lib.mkDefault true; # nordhammer.it is my build server and those are my SSH keys; neither # belongs on someone else's machine. nix.distributedBuilds = lib.mkForce false; users.users.fred.openssh.authorizedKeys.keys = lib.mkForce [ ]; }; nixosConfigurations = { FredOS-Gaming = mkHost "FredOS-Gaming" [ inputs.lanzaboote.nixosModules.lanzaboote ./hosts/hardware/FredOS-Gaming.nix ]; FredOS-Mediaserver = mkHost "FredOS-Mediaserver" [ ./hosts/hardware/FredOS-Mediaserver.nix ]; FredOS-Macbook = mkHost "FredOS-Macbook" [ ./hosts/hardware/FredOS-Macbook.nix ]; FredOS-Kayla = mkHost "FredOS-Kayla" [ ./hosts/hardware/FredOS-Kayla.nix ]; # i686 netbook: no common.nix/stylix/home-manager (see hosts/FredOS-Eee.nix). FredOS-Eee = nixpkgs.lib.nixosSystem { modules = [ ./hosts/FredOS-Eee.nix ./hosts/hardware/FredOS-Eee.nix ]; }; # Live rescue USB with Claude Code; standalone like the Eee. FredOS-Rescue = nixpkgs.lib.nixosSystem { modules = [ ./hosts/FredOS-Rescue.nix ]; }; }; packages.${system}.rescue-iso = self.nixosConfigurations.FredOS-Rescue.config.system.build.isoImage; }; }