{ description = "NixOS configurations for my machines"; inputs = { nixpkgs.url = github:nixos/nixpkgs; nixos-hardware = { url = github:nixos/nixos-hardware; inputs.nixpkgs.follows = "nixpkgs"; }; home-manager = { url = github:nix-community/home-manager; inputs.nixpkgs.follows = "nixpkgs"; }; sops-nix = { url = github:Mic92/sops-nix; inputs.nixpkgs.follows = "nixpkgs"; }; }; outputs = inputs @ { self, nixpkgs, nixos-hardware, home-manager, sops-nix, ... }: let system = "x86_64-linux"; homeManagerConfFor = config: { ... }: { imports = [ config ]; }; jacobHome = homeManagerConfFor ./home/jacob.nix; jacobHomeMod = { home-manager = { useGlobalPkgs = true; useUserPackages = true; users.jacob = jacobHome; }; }; mkNixosSystem = extraModules: nixpkgs.lib.nixosSystem { inherit system; # see https://dataswamp.org/~solene/2022-07-20-nixos-flakes-command-sync-with-system.html specialArgs = { inherit inputs; }; modules = [ home-manager.nixosModules.home-manager jacobHomeMod sops-nix.nixosModules.sops ] ++ extraModules; }; in { homeManagerConfigurations = { jacob = jacobHome; }; nixosConfigurations = { # Thinkpad T470 laptop buck = mkNixosSystem [ nixos-hardware.nixosModules.lenovo-thinkpad-t470s ./machines/buck/configuration.nix ]; # ThinkCentre M700 mini-pc (server) pedro = mkNixosSystem [ nixos-hardware.nixosModules.common-pc-hdd nixos-hardware.nixosModules.common-cpu-intel-cpu-only ./machines/pedro/configuration.nix ]; }; }; }