all repos — dotfiles @ ea333c82d09f370b1a0a8e9a1f87e9570571043f

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