diff --git a/flake-module.nix b/flake-module.nix deleted file mode 100644 index 72fd9ef..0000000 --- a/flake-module.nix +++ /dev/null @@ -1,52 +0,0 @@ -# An opinionated module that creates flake outputs based on a known directory structure. -# -# cf. Convention over configuration -# -# TODO: Upstream this in some fashion. To srid/nixos-flake? -# cf. https://github.com/juspay/nix-dev-home/issues/86 -{ inputs, self, ... }: -let - inherit (inputs.nixpkgs) lib; - forAllNixFiles = dir: f: - lib.pipe dir [ - builtins.readDir - (lib.filterAttrs (_: type: type == "regular")) - (lib.mapAttrs' (fn: _: - let name = lib.removeSuffix ".nix" fn; in - lib.nameValuePair name (f "${dir}/${fn}") - )) - ]; -in -{ - flake = { - darwinConfigurations = - forAllNixFiles "${self}/configurations/darwin" - (fn: self.nixos-flake.lib.mkMacosSystem { home-manager = true; } fn); - - nixosConfigurations = - forAllNixFiles "${self}/configurations/nixos" - (fn: self.nixos-flake.lib.mkLinuxSystem { home-manager = true; } fn); - - darwinModules = - forAllNixFiles "${self}/modules/darwin" - (fn: fn); - - nixosModules = - forAllNixFiles "${self}/modules/nixos" - (fn: fn); - - homeModules = - forAllNixFiles "${self}/modules/home" - (fn: fn); - - overlays = - forAllNixFiles "${self}/overlays" - (fn: import fn self.nixos-flake.lib.specialArgsFor.common); - }; - - perSystem = { pkgs, ... }: { - legacyPackages.homeConfigurations = - forAllNixFiles "${self}/configurations/home" - (fn: self.nixos-flake.lib.mkHomeConfiguration pkgs fn); - }; -} diff --git a/flake.lock b/flake.lock index 639e09d..65cf5bd 100644 --- a/flake.lock +++ b/flake.lock @@ -691,15 +691,16 @@ }, "nixos-flake": { "locked": { - "lastModified": 1727477509, - "narHash": "sha256-XJ9uyX56tEj5ketnpaGRJ25RLUctDReh44tRySh2yEA=", + "lastModified": 1727741402, + "narHash": "sha256-dUtUaG8norNNdqX9UM/31/fbpkiyBf4iKLr02agjEcI=", "owner": "srid", "repo": "nixos-flake", - "rev": "f76d630f1d3a271ae9af118b54e9493d231236ea", + "rev": "82752b478b4ae17248983a4cbc6a7dbd0acb71a1", "type": "github" }, "original": { "owner": "srid", + "ref": "autoWire", "repo": "nixos-flake", "type": "github" } diff --git a/flake.nix b/flake.nix index 55632ab..11eefbf 100644 --- a/flake.nix +++ b/flake.nix @@ -10,7 +10,7 @@ home-manager.url = "github:nix-community/home-manager"; home-manager.inputs.nixpkgs.follows = "nixpkgs"; nixos-hardware.url = "github:NixOS/nixos-hardware"; - nixos-flake.url = "github:srid/nixos-flake"; + nixos-flake.url = "github:srid/nixos-flake/autoWire"; # https://github.com/srid/nixos-flake/pull/74 disko.url = "github:nix-community/disko"; disko.inputs.nixpkgs.follows = "nixpkgs"; ragenix.url = "github:yaxitech/ragenix"; @@ -39,12 +39,9 @@ imports = (with builtins; map (fn: ./modules/flake-parts/${fn}) - (attrNames (readDir ./modules/flake-parts))) ++ - [ - ./flake-module.nix - ]; + (attrNames (readDir ./modules/flake-parts))); - perSystem = { self', pkgs, lib, system, ... }: { + perSystem = { lib, system, ... }: { # Make our overlay available to the devShell # "Flake parts does not yet come with an endorsed module that initializes the pkgs argument."" # So we must do this manually; https://flake.parts/overlays#consuming-an-overlay diff --git a/modules/flake-parts/nixos-flake.nix b/modules/flake-parts/nixos-flake.nix index 0ca4957..5cc766b 100644 --- a/modules/flake-parts/nixos-flake.nix +++ b/modules/flake-parts/nixos-flake.nix @@ -1,7 +1,8 @@ { inputs, ... }: { imports = [ - inputs.nixos-flake.flakeModule + inputs.nixos-flake.flakeModules.default + inputs.nixos-flake.flakeModules.autoWire ]; perSystem = { self', ... }: { packages.default = self'.packages.activate;