diff options
| -rw-r--r-- | flake.nix | 33 | 
1 files changed, 29 insertions, 4 deletions
@@ -11,6 +11,26 @@    inputs.nix.inputs.nixpkgs.follows = "nixpkgs";    outputs = { self, nixpkgs, nixpkgs-unstable, nix, nixos-hardware, home-manager }: +    let +      system = "x86_64-linux"; + +      pkgs-module = {config, ...}: +        let +          cfg = config.nixpkgs; + +          unstable-overlay = final: prev: { +            unstable = import nixpkgs-unstable { +              inherit (cfg) config localSystem crossSystem; +            }; +          }; +        in { +        nixpkgs.pkgs = import nixpkgs { +          inherit (cfg) config localSystem crossSystem; +          overlays = cfg.overlays ++ [ unstable-overlay ]; +        }; +      }; + +    in      {        nixosConfigurations = let          mkConfig = { hostName @@ -18,23 +38,28 @@                     , system ? "x86_64-linux" }: {            name = hostName;            value = nixpkgs.lib.nixosSystem { -            system = "x86_64-linux"; +            inherit system; +              modules =                [ +                pkgs-module                  module                  nixpkgs.nixosModules.notDetected                  ({config, pkgs, ...}: {                    # Let 'nixos-version --json' know about the Git revision                    # of this flake.                    system.configurationRevision = -                    if self ? rev then self.rev else "DIRTY"; +                    let +                      lastModified = final.substring 0 8 (self.lastModifiedDate or self.lastModified or "19700101"); +                    in +                    "${lastModified}.${self.shortRev or "dirty"}";                    nixpkgs.overlays = [                      # Add unstable packages.                      (final: prev: {                        my-extras = { -                        inherit nixpkgs; -                        inherit nixpkgs-unstable; +                        # inherit nixpkgs; +                        # inherit nixpkgs-unstable;                          inherit nixos-hardware;                        };                      })  | 
