]> Git — Sourcephile - julm/julm-nix.git/blob - flake.nix
Add 1 git-crypt collaborator
[julm/julm-nix.git] / flake.nix
1 {
2 inputs.nixpkgs.url = "github:NixOS/nixpkgs/8585991bfb629edda1e42c191bef935d9d70d690";
3 inputs.flake-utils.url = "github:numtide/flake-utils";
4 inputs.home-manager.url = "github:nix-community/home-manager";
5 outputs = inputs: let
6 remoteNixpkgsPatches = import nixpkgs/patches.nix;
7 localNixpkgsPatches = [
8 ];
9 originPkgs = inputs.nixpkgs.legacyPackages."x86_64-linux";
10 nixpkgsPath = originPkgs.applyPatches {
11 name = "nixpkgs-patched";
12 src = inputs.nixpkgs.outPath;
13 patches = map originPkgs.fetchpatch remoteNixpkgsPatches ++ localNixpkgsPatches;
14 postPatch = ''
15 patch=$(printf '%s\n' ${builtins.concatStringsSep " "
16 (map (p: p.sha256) remoteNixpkgsPatches ++ localNixpkgsPatches)} |
17 sort | sha256sum | cut -c -7)
18 echo "+patch-$patch" >.version-suffix
19 '';
20 };
21 lib = originPkgs.lib;
22 in {
23 nixosConfigurations = lib.genAttrs [ "oignon" "patate" ] (hostName:
24 import (nixpkgsPath + "/nixos/lib/eval-config.nix") {
25 #inputs.nixpkgs.lib.nixosSystem {
26 system = "x86_64-linux";
27 extraArgs = {
28 inherit hostName inputs;
29 hosts = inputs.self.nixosConfigurations;
30 };
31 modules = [
32 (import (./hosts + "/${hostName}.nix"))
33 inputs.nixpkgs.nixosModules.notDetected
34 inputs.home-manager.nixosModules.home-manager
35 ({ pkgs, ... }: {
36 nix.registry.nixpkgs.flake = inputs.nixpkgs;
37 nix.package = pkgs.nixFlakes;
38 nix.extraOptions = "experimental-features = nix-command flakes";
39 #nixpkgs.overlays = import nixpkgs/overlays.nix;
40 /*
41 system.nixos.versionSuffix = ".${
42 lib.substring 0 8 (inputs.self.lastModifiedDate or inputs.self.lastModified)}.${
43 inputs.self.shortRev or "dirty"}";
44 system.nixos.revision = lib.mkIf (inputs.self ? rev) inputs.self.rev;
45 */
46 # Let 'nixos-version --json' know about the Git revision of this flake.
47 system.configurationRevision = lib.mkIf (inputs.self ? rev) inputs.self.rev;
48 /*
49 system.configurationRevision =
50 if inputs.self ? rev
51 then inputs.self.rev
52 else throw "Refusing to build from a dirty Git tree!";
53 */
54 })
55 {
56 home-manager.useGlobalPkgs = true;
57 home-manager.useUserPackages = true;
58 }
59 ];
60 });
61 } //
62 inputs.flake-utils.lib.eachDefaultSystem (system:
63 #let pkgs = inputs.nixpkgs.legacyPackages.${system}; in
64 let
65 pkgs = import nixpkgsPath {
66 inherit system;
67 config = {}; # Make the config pure, ignoring user's config.
68 #overlays = import nixpkgs/overlays.nix;
69 }; in {
70 devShell = import ./shell.nix { inherit pkgs; };
71 }
72 );
73 }