mirror of
https://github.com/JulienMalka/snowfield.git
synced 2025-03-28 14:50:55 +01:00
Refactored machines
This commit is contained in:
parent
1c6b3c4a33
commit
f7b980f413
6 changed files with 15 additions and 38 deletions
40
flake.lock
generated
40
flake.lock
generated
|
@ -31,21 +31,6 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"hardware": {
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1639986101,
|
|
||||||
"narHash": "sha256-Ow0+pkY7qMw6lMAvR1mEdUT9svJnrkbaRoqp4bkMTpg=",
|
|
||||||
"owner": "NixOS",
|
|
||||||
"repo": "nixos-hardware",
|
|
||||||
"rev": "3f92db38374b2977aea8daf4c4fe2fa0eddbd60c",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "NixOS",
|
|
||||||
"repo": "nixos-hardware",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"home-manager": {
|
"home-manager": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
|
@ -125,11 +110,11 @@
|
||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1639876010,
|
"lastModified": 1639966735,
|
||||||
"narHash": "sha256-naGsoUfsY92NaIGiFI8XFXBnesw8BQGe694xcfaLMDI=",
|
"narHash": "sha256-FmVGFiyqE+pjQUTCTY0H75hqrnBnbEf3VVRB4dsd4KI=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "395879c28386e1abf20c7ecacd45880759548391",
|
"rev": "d87b72206aadebe6722944f541f55d33fd7046fb",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -157,11 +142,11 @@
|
||||||
},
|
},
|
||||||
"nixpkgs_3": {
|
"nixpkgs_3": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1639891440,
|
"lastModified": 1639989170,
|
||||||
"narHash": "sha256-FJxa6ObwOQKZy3VhwN5bJRzX+MV/Yq9WLHK/4jlPKrs=",
|
"narHash": "sha256-REf0rqdJs6XIPo/zc/FhJMecggjEXi45QyiV207y30Y=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "e6377ff35544226392b49fa2cf05590f9f0c4b43",
|
"rev": "86453059bf8312f0f5bf1fe8a2f52da2be664489",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -173,11 +158,11 @@
|
||||||
},
|
},
|
||||||
"nur": {
|
"nur": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1639990555,
|
"lastModified": 1640022719,
|
||||||
"narHash": "sha256-O8BvwcDT+htaYP4ujsNjx+hX5mxPwtfNJii5OYLOoHY=",
|
"narHash": "sha256-QgqV98KfELeuO76jWwmgL5s3vcmfVq5YtiPC7bQuWwQ=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "NUR",
|
"repo": "NUR",
|
||||||
"rev": "7dd4caa60877e32dcdb5f24cf212133c98e7f163",
|
"rev": "9f9a80de1be8ab246b5eafd00de948a05a55b798",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -187,7 +172,6 @@
|
||||||
},
|
},
|
||||||
"root": {
|
"root": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"hardware": "hardware",
|
|
||||||
"home-manager": "home-manager",
|
"home-manager": "home-manager",
|
||||||
"homepage": "homepage",
|
"homepage": "homepage",
|
||||||
"neovim-nightly-overlay": "neovim-nightly-overlay",
|
"neovim-nightly-overlay": "neovim-nightly-overlay",
|
||||||
|
@ -198,11 +182,11 @@
|
||||||
},
|
},
|
||||||
"unstable": {
|
"unstable": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1639876010,
|
"lastModified": 1639966735,
|
||||||
"narHash": "sha256-naGsoUfsY92NaIGiFI8XFXBnesw8BQGe694xcfaLMDI=",
|
"narHash": "sha256-FmVGFiyqE+pjQUTCTY0H75hqrnBnbEf3VVRB4dsd4KI=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "395879c28386e1abf20c7ecacd45880759548391",
|
"rev": "d87b72206aadebe6722944f541f55d33fd7046fb",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
|
@ -16,10 +16,6 @@
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
hardware = {
|
|
||||||
url = "github:NixOS/nixos-hardware";
|
|
||||||
};
|
|
||||||
|
|
||||||
unstable = {
|
unstable = {
|
||||||
url = "github:NixOS/nixpkgs/nixos-unstable";
|
url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||||
};
|
};
|
||||||
|
@ -40,7 +36,7 @@
|
||||||
})
|
})
|
||||||
(builtins.attrNames (builtins.readDir ./modules)));
|
(builtins.attrNames (builtins.readDir ./modules)));
|
||||||
|
|
||||||
nixosConfigurations = builtins.mapAttrs (name: value: (mkMachine name value self.nixosModules)) (importConfig ./machines);
|
nixosConfigurations = builtins.mapAttrs (name: value: (mkMachine name value self.nixosModules)) (importConfig ./machines);
|
||||||
hydraJobs = (nixpkgs.lib.mapAttrs' (name: config:
|
hydraJobs = (nixpkgs.lib.mapAttrs' (name: config:
|
||||||
nixpkgs.lib.nameValuePair "nixos-${name}"
|
nixpkgs.lib.nameValuePair "nixos-${name}"
|
||||||
config.config.system.build.toplevel) self.nixosConfigurations);
|
config.config.system.build.toplevel) self.nixosConfigurations);
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
{ nixpkgs, home-manager, nixpkgs-unstable, inputs }:
|
{ nixpkgs, home-manager, nixpkgs-unstable, inputs }:
|
||||||
with builtins;
|
with builtins;
|
||||||
|
|
||||||
let mapAttrNames = f: set:
|
let
|
||||||
listToAttrs (map (attr: { name = f attr; value = set.${attr}; }) (attrNames set));
|
|
||||||
overlay-unstable = final: prev: {
|
overlay-unstable = final: prev: {
|
||||||
unstable = nixpkgs-unstable.legacyPackages.x86_64-linux;
|
unstable = nixpkgs-unstable.legacyPackages.x86_64-linux;
|
||||||
};
|
};
|
||||||
|
@ -48,8 +47,6 @@ in
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
importConfig = with builtins; path: (mapAttrs (name: value: import (path + "/${name}/default.nix")) (readDir path));
|
||||||
importConfig = path: (mapAttrNames (name: nixpkgs.lib.removeSuffix ".nix" name)) ((builtins.mapAttrs (name: value: import (path + "/${name}")) (builtins.readDir path)));
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue