mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-01-21 18:41:34 +01:00
Auto import host files
This commit is contained in:
parent
cd4e3ab2c1
commit
3ce9e298d4
5 changed files with 8 additions and 23 deletions
|
|
@ -10,6 +10,12 @@ let
|
||||||
specialArgs = { inherit inputs self; };
|
specialArgs = { inherit inputs self; };
|
||||||
modules =
|
modules =
|
||||||
let
|
let
|
||||||
|
hostFiles =
|
||||||
|
"${self}/hosts/${hostName}"
|
||||||
|
|> builtins.readDir
|
||||||
|
|> lib.filterAttrs (fileName: type: (fileName |> lib.hasSuffix ".nix") && type == "regular")
|
||||||
|
|> builtins.attrNames
|
||||||
|
|> map (fileName: "${self}/hosts/${hostName}/${fileName}");
|
||||||
userFiles =
|
userFiles =
|
||||||
"${self}/users"
|
"${self}/users"
|
||||||
|> builtins.readDir
|
|> builtins.readDir
|
||||||
|
|
@ -20,7 +26,8 @@ let
|
||||||
in
|
in
|
||||||
lib.flatten [
|
lib.flatten [
|
||||||
{ networking = { inherit hostName; }; }
|
{ networking = { inherit hostName; }; }
|
||||||
"${self}/hosts/${hostName}"
|
"${self}/hosts/shared.nix"
|
||||||
|
hostFiles
|
||||||
userFiles
|
userFiles
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,4 @@
|
||||||
{
|
{
|
||||||
imports = [
|
|
||||||
../shared.nix
|
|
||||||
./hardware.nix
|
|
||||||
./disko.nix
|
|
||||||
];
|
|
||||||
|
|
||||||
system.stateVersion = "24.11";
|
system.stateVersion = "24.11";
|
||||||
|
|
||||||
myConfig = {
|
myConfig = {
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,5 @@
|
||||||
{ pkgs, ... }:
|
{ pkgs, ... }:
|
||||||
{
|
{
|
||||||
imports = [
|
|
||||||
../shared.nix
|
|
||||||
./hardware.nix
|
|
||||||
./disko.nix
|
|
||||||
];
|
|
||||||
|
|
||||||
system.stateVersion = "24.11";
|
system.stateVersion = "24.11";
|
||||||
boot.kernelPackages = pkgs.linuxPackages_latest;
|
boot.kernelPackages = pkgs.linuxPackages_latest;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,5 @@
|
||||||
{ pkgs, ... }:
|
{ pkgs, ... }:
|
||||||
{
|
{
|
||||||
imports = [
|
|
||||||
../shared.nix
|
|
||||||
./hardware.nix
|
|
||||||
./disko.nix
|
|
||||||
];
|
|
||||||
|
|
||||||
system.stateVersion = "23.11";
|
system.stateVersion = "23.11";
|
||||||
boot.kernelPackages = pkgs.linuxPackages_latest;
|
boot.kernelPackages = pkgs.linuxPackages_latest;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,5 @@
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
../shared.nix
|
|
||||||
./hardware.nix
|
|
||||||
./disko.nix
|
|
||||||
|
|
||||||
./containers/docker
|
./containers/docker
|
||||||
./containers/nspawn
|
./containers/nspawn
|
||||||
];
|
];
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue