Multi-host Nix framework
This commit is contained in:
parent
c50ed8a901
commit
3811e38dac
4 changed files with 31 additions and 23 deletions
26
flake.nix
26
flake.nix
|
@ -12,26 +12,8 @@
|
||||||
nixGL.url = "github:nix-community/nixGL";
|
nixGL.url = "github:nix-community/nixGL";
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = { nixpkgs, flake-utils, home-manager, nixGL, ... } @ inputs:
|
outputs = { nixpkgs, ... } @ inputs:
|
||||||
flake-utils.lib.eachSystem (with flake-utils.lib.system; [
|
(import ./modules/hosts.nix inputs) // {
|
||||||
x86_64-linux
|
# TODO devshell config
|
||||||
]) (system:
|
};
|
||||||
let
|
|
||||||
lib = nixpkgs.lib;
|
|
||||||
pkgs = import nixpkgs {
|
|
||||||
inherit system;
|
|
||||||
overlays = [ nixGL.overlay ];
|
|
||||||
};
|
|
||||||
in {
|
|
||||||
packages.homeConfigurations = {
|
|
||||||
goose = home-manager.lib.homeManagerConfiguration {
|
|
||||||
inherit pkgs;
|
|
||||||
modules = [ ./home.nix ];
|
|
||||||
extraSpecialArgs = {
|
|
||||||
inherit inputs;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
4
justfile
4
justfile
|
@ -1,4 +1,6 @@
|
||||||
hm_flags := "--flake .#goose"
|
user := `whoami`
|
||||||
|
hostname := `hostname`
|
||||||
|
hm_flags := "--flake .#" + user + "@" + hostname
|
||||||
|
|
||||||
alias b := build
|
alias b := build
|
||||||
alias inst := install
|
alias inst := install
|
||||||
|
|
24
modules/hosts.nix
Normal file
24
modules/hosts.nix
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
{ nixpkgs, flake-utils, home-manager, nixGL, ... } @ inputs:
|
||||||
|
let
|
||||||
|
getNixOsPkgs = system: import nixpkgs { inherit system; };
|
||||||
|
getPkgs = system: import nixpkgs {
|
||||||
|
inherit system;
|
||||||
|
overlays = [ nixGL.overlay ];
|
||||||
|
};
|
||||||
|
|
||||||
|
makeHostSystem = pkgs: modules: home-manager.lib.homeManagerConfiguration {
|
||||||
|
inherit pkgs;
|
||||||
|
modules = [ ./common.nix ] ++ modules;
|
||||||
|
extraSpecialArgs = {
|
||||||
|
inherit inputs;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
in
|
||||||
|
{
|
||||||
|
packages.x86_64-linux.homeConfigurations = let
|
||||||
|
pkgs = getPkgs "x86_64-linux";
|
||||||
|
makeHost = makeHostSystem pkgs;
|
||||||
|
in {
|
||||||
|
"goose@adventurer" = makeHost [ /*./hosts/adventurer.nix*/ ];
|
||||||
|
};
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue