Better nix flake configuration

This commit is contained in:
Filippo Berto 2022-10-04 14:44:56 +02:00
parent 4627af9181
commit 4fca5c8cb1
No known key found for this signature in database
GPG key ID: FE98AE5EC52B1056
6 changed files with 22 additions and 48 deletions

View file

@ -20,7 +20,7 @@
nix-rice = {
url = "github:bertof/nix-rice";
inputs = {
inxpkgs.follows = "nixpkgs-u";
nixpkgs.follows = "nixpkgs-u";
flake-utils.follows = "flake-utils";
};
};
@ -86,6 +86,13 @@
};
pkgs = s: import nixpkgs (nixpkgsSettings s);
pkgs-u = s: import nixpkgs-u (nixpkgsSettings s);
nixModule = system: { pkgs, ... }: {
nixpkgs = nixpkgsSettings { inherit system; };
nix = {
package = pkgs.unstable.nixVersions.stable;
extraOptions = "experimental-features = nix-command flakes";
};
};
homeManagerSettings = {
home-manager = {
useGlobalPkgs = true;
@ -126,7 +133,7 @@
odinIntelBuilder = { extraModules ? [ ] }:
nixpkgs.lib.nixosSystem rec {
system = "x86_64-linux";
modules = [{ nixpkgs = nixpkgsSettings { inherit system; }; }]
modules = [ (nixModule system) ]
++ commonBaseModules ++ odinBaseModules ++ odinIntelModules
++ (homeManagerModules { bertof = import ./odin/hm.nix; })
++ extraModules;
@ -134,7 +141,7 @@
odinNvidiaBuilder = { extraModules ? [ ] }:
nixpkgs.lib.nixosSystem rec {
system = "x86_64-linux";
modules = [{ nixpkgs = nixpkgsSettings { inherit system; }; }]
modules = [ (nixModule system) ]
++ commonBaseModules ++ odinBaseModules ++ odinNvidiaModules
++ (homeManagerModules { bertof = import ./odin/hm.nix; })
++ extraModules;
@ -153,7 +160,7 @@
thorBuilder = { extraModules ? [ ] }:
nixpkgs.lib.nixosSystem rec {
system = "x86_64-linux";
modules = [{ nixpkgs = nixpkgsSettings { inherit system; }; }]
modules = [ (nixModule system) ]
++ commonBaseModules ++ thorBaseModules
++ (homeManagerModules { bertof = import ./thor/hm.nix; })
++ extraModules;
@ -168,7 +175,7 @@
lokiBuilder = { extraModules ? [ ] }:
nixpkgs.lib.nixosSystem rec {
system = "x86_64-linux";
modules = [{ nixpkgs = nixpkgsSettings { inherit system; }; }]
modules = [ (nixModule system) ]
++ commonBaseModules ++ lokiBaseModules
++ (homeManagerModules { bertof = import ./loki/hm.nix; })
++ extraModules;