2 inputs.nixpkgs.url = "github:NixOS/nixpkgs/8585991bfb629edda1e42c191bef935d9d70d690";
3 inputs.flake-utils.url = "github:numtide/flake-utils";
5 remoteNixpkgsPatches = import nixpkgs/patches.nix;
6 localNixpkgsPatches = [
8 originPkgs = inputs.nixpkgs.legacyPackages."x86_64-linux";
9 nixpkgsPath = originPkgs.applyPatches {
10 name = "nixpkgs-patched";
11 src = inputs.nixpkgs.outPath;
12 patches = map originPkgs.fetchpatch remoteNixpkgsPatches ++ localNixpkgsPatches;
14 patch=$(printf '%s\n' ${builtins.concatStringsSep " "
15 (map (p: p.sha256) remoteNixpkgsPatches ++ localNixpkgsPatches)} |
16 sort | sha256sum | cut -c -7)
17 echo "+patch-$patch" >.version-suffix
22 nixosConfigurations.oignon =
23 let machineName = "oignon"; in
24 import (nixpkgsPath + "/nixos/lib/eval-config.nix") {
25 #inputs.nixpkgs.lib.nixosSystem {
26 system = "x86_64-linux";
28 inherit machineName inputs;
29 machines = inputs.self.nixosConfigurations;
33 nix.registry.nixpkgs.flake = inputs.nixpkgs;
34 nix.package = pkgs.nixFlakes;
35 nix.extraOptions = "experimental-features = nix-command flakes";
36 #nixpkgs.overlays = import nixpkgs/overlays.nix;
38 system.nixos.versionSuffix = ".${
39 lib.substring 0 8 (inputs.self.lastModifiedDate or inputs.self.lastModified)}.${
40 inputs.self.shortRev or "dirty"}";
41 system.nixos.revision = lib.mkIf (inputs.self ? rev) inputs.self.rev;
43 # Let 'nixos-version --json' know about the Git revision of this flake.
44 system.configurationRevision = lib.mkIf (inputs.self ? rev) inputs.self.rev;
46 system.configurationRevision =
49 else throw "Refusing to build from a dirty Git tree!";
52 (import (./machines + "/${machineName}.nix"))
53 inputs.nixpkgs.nixosModules.notDetected
57 inputs.flake-utils.lib.eachDefaultSystem (system:
58 #let pkgs = inputs.nixpkgs.legacyPackages.${system}; in
60 pkgs = import nixpkgsPath {
62 config = {}; # Make the config pure, ignoring user's config.
63 #overlays = import nixpkgs/overlays.nix;
65 devShell = import ./shell.nix { inherit pkgs; };