feat: nix config helper
This commit is contained in:
29
flake.nix
29
flake.nix
@@ -23,13 +23,26 @@
|
||||
};
|
||||
};
|
||||
|
||||
outputs = { self, nixpkgs, home-manager, ... }@inputs: {
|
||||
nixosConfigurations.desktop = nixpkgs.lib.nixosSystem {
|
||||
specialArgs = { inherit inputs; };
|
||||
modules = [
|
||||
inputs.home-manager.nixosModules.default
|
||||
./hosts/desktop/configuration.nix
|
||||
];
|
||||
outputs = { self, nixpkgs, home-manager, ... }@inputs:
|
||||
let
|
||||
create-host = (configs: builtins.listToAttrs (map
|
||||
(c: {
|
||||
name = c;
|
||||
value = nixpkgs.lib.nixosSystem {
|
||||
specialArgs = { inherit inputs; };
|
||||
modules = [
|
||||
inputs.home-manager.nixosModules.default
|
||||
(./. + ("/hosts/" + builtins.replaceStrings [ "@" ] [ "/" ] c) + /configuration.nix)
|
||||
];
|
||||
};
|
||||
})
|
||||
configs));
|
||||
in
|
||||
{
|
||||
nixosConfigurations = (create-host [
|
||||
"desktop@default"
|
||||
"desktop@work"
|
||||
]);
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
15
hosts/desktop/default/configuration.nix
Normal file
15
hosts/desktop/default/configuration.nix
Normal file
@@ -0,0 +1,15 @@
|
||||
{ config, pkgs, inputs, lib, ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
../shared-configuration.nix
|
||||
];
|
||||
|
||||
set-user.users = [
|
||||
{
|
||||
username = "guz";
|
||||
shell = pkgs.zsh;
|
||||
home = import ./home.nix;
|
||||
}
|
||||
];
|
||||
}
|
||||
7
hosts/desktop/default/home.nix
Normal file
7
hosts/desktop/default/home.nix
Normal file
@@ -0,0 +1,7 @@
|
||||
{ config, pkgs, inputs, ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
../shared-home.nix
|
||||
];
|
||||
}
|
||||
@@ -27,13 +27,6 @@
|
||||
|
||||
programs.zsh.enable = true;
|
||||
# Define a user account. Don't forget to set a password with ‘passwd’.
|
||||
set-user.users = [
|
||||
{
|
||||
username = "guz";
|
||||
shell = pkgs.zsh;
|
||||
home = import ./home.nix;
|
||||
}
|
||||
];
|
||||
|
||||
services.flatpak.enable = true;
|
||||
|
||||
15
hosts/desktop/work/configuration.nix
Normal file
15
hosts/desktop/work/configuration.nix
Normal file
@@ -0,0 +1,15 @@
|
||||
{ config, pkgs, inputs, lib, ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
../shared-configuration.nix
|
||||
];
|
||||
|
||||
set-user.users = [
|
||||
{
|
||||
username = "guz";
|
||||
shell = pkgs.zsh;
|
||||
home = import ./home.nix;
|
||||
}
|
||||
];
|
||||
}
|
||||
7
hosts/desktop/work/home.nix
Normal file
7
hosts/desktop/work/home.nix
Normal file
@@ -0,0 +1,7 @@
|
||||
{ config, pkgs, inputs, ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
../shared-home.nix
|
||||
];
|
||||
}
|
||||
Reference in New Issue
Block a user