all repos — dotfiles @ 414bdaa034cc1498dff6590adb5af7473c991fb5

my *nix dotfiles

flake.nix (view raw)

  1{
  2  description = "icy's nixos config";
  3
  4  inputs = {
  5    nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
  6    nixpkgs-master.url = "github:NixOS/nixpkgs/master";
  7
  8    nixos-hardware.url = "github:nixos/nixos-hardware";
  9
 10    home-manager = {
 11      url = "github:nix-community/home-manager";
 12      inputs.nixpkgs.follows = "nixpkgs";
 13    };
 14
 15    darwin = {
 16      url = "github:lnl7/nix-darwin/master";
 17      inputs.nixpkgs.follows = "nixpkgs";
 18    };
 19
 20    prompt = {
 21      url = "git+https://git.peppe.rs/cli/prompt";
 22      inputs.nixpkgs.follows = "nixpkgs";
 23    };
 24
 25    nix-snapshotter = {
 26      url = "github:pdtpartners/nix-snapshotter";
 27      inputs.nixpkgs.follows = "nixpkgs";
 28    };
 29
 30    nix-your-shell = {
 31      url = "github:MercuryTechnologies/nix-your-shell";
 32      inputs.nixpkgs.follows = "nixpkgs";
 33    };
 34
 35    zed = {
 36      url = "github:zed-industries/zed";
 37      inputs.nixpkgs.follows = "nixpkgs";
 38    };
 39  };
 40
 41  outputs =
 42    { self
 43    , nixpkgs
 44    , nixpkgs-master
 45    , nixos-hardware
 46    , nix-your-shell
 47    , home-manager
 48    , prompt
 49    , # zed,
 50      darwin
 51    , ...
 52    }@inputs:
 53
 54    let
 55      supportedSystems = [
 56        "x86_64-linux"
 57        "x86_64-darwin"
 58        "aarch64-linux"
 59        "aarch64-darwin"
 60      ];
 61      forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
 62    in
 63    {
 64
 65      darwinConfigurations = {
 66        kvothe = darwin.lib.darwinSystem {
 67          system = "aarch64-darwin";
 68          modules = [
 69            {
 70              imports = [ ./hosts/kvothe/configuration.nix ];
 71              _module.args.self = self;
 72              nixpkgs.overlays = [
 73                nix-your-shell.overlays.default
 74                prompt.overlay
 75              ];
 76            }
 77            home-manager.darwinModules.home-manager
 78            {
 79              home-manager.useGlobalPkgs = true;
 80              home-manager.useUserPackages = true;
 81              home-manager.users.icy = {
 82                imports = [ ./darwin/home.nix ];
 83                _module.args.self = self;
 84                _module.args.host = "kvothe";
 85                _module.args.inputs = inputs;
 86              };
 87            }
 88          ];
 89        };
 90      };
 91
 92      nixosConfigurations = {
 93        wyndle = nixpkgs.lib.nixosSystem {
 94          system = "x86_64-linux";
 95          modules = [
 96            {
 97              imports = [ ./hosts/wyndle/configuration.nix ];
 98              _module.args.self = self;
 99              nixpkgs.overlays = [
100                nix-your-shell.overlays.default
101                prompt.overlay
102              ];
103            }
104            home-manager.nixosModules.home-manager
105            {
106              home-manager.useGlobalPkgs = true;
107              home-manager.useUserPackages = true;
108              home-manager.users.icy = {
109                imports = [ ./home.nix ];
110                _module.args.self = self;
111                _module.args.host = "wyndle";
112                _module.args.inputs = inputs;
113              };
114            }
115          ];
116        };
117      };
118
119      nixosConfigurations = {
120        sini = nixpkgs.lib.nixosSystem {
121          system = "x86_64-linux";
122          modules = [
123            ({
124              config = {
125                nix.registry.nixpkgs.flake = nixpkgs;
126              };
127            })
128            (
129              { config, pkgs, ... }:
130              {
131                services.pixelfed.package = nixpkgs-master.legacyPackages."x86_64-linux".pixelfed;
132                services.pixelfed.phpPackage = nixpkgs-master.legacyPackages."x86_64-linux".php82;
133              }
134            )
135            # ({ pkgs, ... }: {
136            #   imports = [ nix-snapshotter.nixosModules.default ];
137            #   nixpkgs.overlays = [ nix-snapshotter.overlays.default ];
138            # })
139            {
140              imports = [ ./hosts/sini/configuration.nix ];
141              _module.args.self = self;
142            }
143          ];
144        };
145      };
146
147      nixosConfigurations = {
148        denna = nixpkgs.lib.nixosSystem {
149          system = "x86_64-linux";
150          modules = [
151            ({
152              config = {
153                nix.registry.nixpkgs.flake = nixpkgs;
154              };
155            })
156            {
157              imports = [ ./hosts/denna/configuration.nix ];
158              _module.args.self = self;
159            }
160          ];
161        };
162      };
163
164      nixosConfigurations = {
165        iso = nixpkgs.lib.nixosSystem {
166          system = "x86_64-linux";
167          modules = [
168            ({
169              config = {
170                nix.registry.nixpkgs.flake = nixpkgs;
171              };
172            })
173            {
174              imports = [ ./hosts/iso/configuration.nix ];
175              _module.args.self = self;
176            }
177          ];
178        };
179      };
180
181      devShells = forAllSystems (
182        system:
183        let
184          nixpkgsFor = forAllSystems (system: import nixpkgs { inherit system; });
185          pkgs = nixpkgsFor.${system};
186        in
187        {
188          default = pkgs.mkShell {
189            nativeBuildInputs = with pkgs; [
190              nixd
191              nixfmt-rfc-style
192            ];
193          };
194        }
195      );
196    };
197}