Decouple system from flake
This commit is contained in:
parent
73844fcf66
commit
45935b999e
52
flake.nix
52
flake.nix
@ -12,38 +12,44 @@
|
|||||||
outputs =
|
outputs =
|
||||||
inputs@{ self, nixpkgs, nixos-unstable, home-manager, vim-extra-plugins }:
|
inputs@{ self, nixpkgs, nixos-unstable, home-manager, vim-extra-plugins }:
|
||||||
let
|
let
|
||||||
system = "x86_64-linux";
|
x64System = "x86_64-linux";
|
||||||
|
|
||||||
pkgs = import nixpkgs {
|
wrapPkgsSystem = { system }:
|
||||||
inherit system;
|
import nixpkgs rec {
|
||||||
config.allowUnfree = true;
|
inherit system;
|
||||||
overlays = [
|
unstable = wrapUnstablePkgsSystem { inherit system; };
|
||||||
(final: prev: { inherit unstable; })
|
config.allowUnfree = true;
|
||||||
vim-extra-plugins.overlays.default
|
overlays = [
|
||||||
];
|
(final: prev: { inherit unstable; })
|
||||||
|
vim-extra-plugins.overlays.default
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
wrapUnstablePkgsSystem = { system }:
|
||||||
|
import nixos-unstable {
|
||||||
|
inherit system;
|
||||||
|
config.allowUnfree = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
pkgsX64 = wrapPkgsSystem { system = x64System; };
|
||||||
|
unstableX64 = wrapPkgsSystem { system = x64System; };
|
||||||
|
|
||||||
|
utilsX64 = import ./lib {
|
||||||
|
inherit nixpkgs nixos-unstable home-manager;
|
||||||
|
pkgs = pkgsX64;
|
||||||
|
unstable = unstableX64;
|
||||||
|
system = x64System;
|
||||||
};
|
};
|
||||||
|
|
||||||
unstable = import nixos-unstable {
|
|
||||||
inherit system;
|
|
||||||
config.allowUnfree = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
utils = import ./lib {
|
|
||||||
inherit pkgs unstable nixpkgs nixos-unstable home-manager;
|
|
||||||
};
|
|
||||||
|
|
||||||
inherit (utils) host;
|
|
||||||
inherit (utils) user;
|
|
||||||
in {
|
in {
|
||||||
nixosConfigurations = {
|
nixosConfigurations = {
|
||||||
architect = host.mkHost {
|
architect = utilsX64.host.mkHost {
|
||||||
name = "architect";
|
name = "architect";
|
||||||
users = [{
|
users = [{
|
||||||
user = "giulio";
|
user = "giulio";
|
||||||
roles = [ ];
|
roles = [ ];
|
||||||
}];
|
}];
|
||||||
};
|
};
|
||||||
gAluminum = host.mkHost {
|
gAluminum = utilsX64.host.mkHost {
|
||||||
name = "gAluminum";
|
name = "gAluminum";
|
||||||
users = [{
|
users = [{
|
||||||
user = "giulio";
|
user = "giulio";
|
||||||
@ -51,7 +57,7 @@
|
|||||||
}];
|
}];
|
||||||
roles = [ "gnome" ];
|
roles = [ "gnome" ];
|
||||||
};
|
};
|
||||||
proxy = host.mkHost {
|
proxy = utilsX64.host.mkHost {
|
||||||
name = "proxy";
|
name = "proxy";
|
||||||
users = [ ];
|
users = [ ];
|
||||||
};
|
};
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{ pkgs, unstable, nixpkgs, nixos-unstable, home-manager, ... }: rec {
|
{ pkgs, unstable, nixpkgs, nixos-unstable, home-manager, system, ... }: rec {
|
||||||
user = import ./user.nix { inherit pkgs unstable; };
|
user = import ./user.nix { inherit pkgs unstable system; };
|
||||||
host = import ./host.nix {
|
host = import ./host.nix {
|
||||||
inherit pkgs nixpkgs unstable nixos-unstable home-manager user;
|
inherit pkgs nixpkgs unstable nixos-unstable home-manager user system;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -1,10 +1,8 @@
|
|||||||
{ pkgs, nixpkgs, nixos-unstable, unstable, home-manager, user, ... }:
|
{ pkgs, nixpkgs, nixos-unstable, unstable, home-manager, user, system, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
mkHost = { name, users, roles ? [ ], imports ? [ ] }:
|
mkHost = { name, users, roles ? [ ], imports ? [ ] }:
|
||||||
let
|
let
|
||||||
system = "x86_64-linux";
|
|
||||||
|
|
||||||
mkRole = role: import (../roles + "/${role}.nix");
|
mkRole = role: import (../roles + "/${role}.nix");
|
||||||
|
|
||||||
users_mod = (map (u:
|
users_mod = (map (u:
|
||||||
|
Loading…
Reference in New Issue
Block a user