{ inputs.nixpkgs.url = "github:NixOS/nixpkgs/b69f140a8028e4718bde4e5082f8df38e50b7971"; inputs.flake-utils.url = "github:numtide/flake-utils"; outputs = inputs: let remoteNixpkgsPatches = [ /* { meta.description = "nixos-install: add support for inputs"; url = "https://github.com/NixOS/nixpkgs/pull/95194.diff"; sha256 = "sha256-R6LAHDM8FNQxsql5fiV16aDapKtZ7H/Q04pz1wjnSqQ"; } */ ]; localNixpkgsPatches = [ ]; originPkgs = inputs.nixpkgs.legacyPackages."x86_64-linux"; nixpkgsPath = originPkgs.applyPatches { name = "nixpkgs-patched"; src = inputs.nixpkgs.outPath; patches = map originPkgs.fetchpatch remoteNixpkgsPatches ++ localNixpkgsPatches; postPatch = '' patch=$(printf '%s\n' ${builtins.concatStringsSep " " (map (p: p.sha256) remoteNixpkgsPatches ++ localNixpkgsPatches)} | sort | sha256sum | cut -c -7) echo "+patch-$patch" >.version-suffix ''; }; lib = originPkgs.lib; in { nixosConfigurations.oignon = let machineName = "oignon"; in #import (nixpkgsPath + "/nixos/lib/eval-config.nix") { inputs.nixpkgs.lib.nixosSystem { system = "x86_64-linux"; extraArgs = { inherit machineName inputs; machines = inputs.self.nixosConfigurations; }; modules = [ ({ pkgs, ... }: { nix.registry.nixpkgs.flake = inputs.nixpkgs; nix.package = pkgs.nixFlakes; nix.extraOptions = "experimental-features = nix-command flakes"; #nixpkgs.overlays = import nixpkgs/overlays.nix; /* system.nixos.versionSuffix = ".${ lib.substring 0 8 (inputs.self.lastModifiedDate or inputs.self.lastModified)}.${ inputs.self.shortRev or "dirty"}"; system.nixos.revision = lib.mkIf (inputs.self ? rev) inputs.self.rev; */ # Let 'nixos-version --json' know about the Git revision of this flake. system.configurationRevision = lib.mkIf (inputs.self ? rev) inputs.self.rev; /* system.configurationRevision = if inputs.self ? rev then inputs.self.rev else throw "Refusing to build from a dirty Git tree!"; */ }) (import (./machines + "/${machineName}.nix")) inputs.nixpkgs.nixosModules.notDetected ]; }; } // inputs.flake-utils.lib.eachDefaultSystem (system: #let pkgs = inputs.nixpkgs.legacyPackages.${system}; in let pkgs = import nixpkgsPath { inherit system; config = {}; # Make the config pure, ignoring user's config. #overlays = import nixpkgs/overlays.nix; }; in { devShell = import ./shell.nix { inherit pkgs; }; } ); }