mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-01-21 12:51:34 +01:00
Simplify host imports
This commit is contained in:
parent
7a250a2ea8
commit
de18f587c7
11 changed files with 50 additions and 50 deletions
|
|
@ -9,28 +9,13 @@ let
|
|||
hostName:
|
||||
inputs.nixpkgs.lib.nixosSystem {
|
||||
specialArgs = { inherit inputs self; };
|
||||
modules =
|
||||
let
|
||||
hostFiles =
|
||||
"${self}/hosts/${hostName}"
|
||||
|> lib.filesystem.listFilesRecursive
|
||||
|> lib.filter (lib.hasSuffix ".nix");
|
||||
|
||||
userFiles =
|
||||
"${self}/users"
|
||||
|> builtins.readDir
|
||||
|> lib.filterAttrs (_: type: type == "directory")
|
||||
|> lib.attrNames
|
||||
|> map (user: "${self}/users/${user}/@${hostName}/default.nix")
|
||||
|> lib.filter (path: lib.pathExists path);
|
||||
in
|
||||
[
|
||||
{ networking = { inherit hostName; }; }
|
||||
"${self}/hosts/common.nix"
|
||||
"${self}/users/seb/default.nix"
|
||||
]
|
||||
++ hostFiles
|
||||
++ userFiles;
|
||||
modules = [
|
||||
{ networking = { inherit hostName; }; }
|
||||
"${self}/hosts/common.nix"
|
||||
"${self}/hosts/${hostName}"
|
||||
"${self}/users/seb"
|
||||
]
|
||||
++ lib.optional (lib.pathExists "${self}/users/seb/@${hostName}") "${self}/users/seb/@${hostName}";
|
||||
};
|
||||
|
||||
mkDeployNode = hostname: {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,11 @@
|
|||
{ pkgs, ... }:
|
||||
{ inputs, pkgs, ... }:
|
||||
{
|
||||
imports = [
|
||||
./hardware.nix
|
||||
./disko.nix
|
||||
inputs.disko.nixosModules.default
|
||||
];
|
||||
|
||||
system.stateVersion = "23.11";
|
||||
boot.kernelPackages = pkgs.linuxPackages_latest;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,4 @@
|
|||
{ inputs, ... }:
|
||||
{
|
||||
imports = [ inputs.disko.nixosModules.default ];
|
||||
|
||||
_: {
|
||||
nixpkgs.hostPlatform = "x86_64-linux";
|
||||
|
||||
hardware = {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,11 @@
|
|||
{ pkgs, ... }:
|
||||
{ inputs, pkgs, ... }:
|
||||
{
|
||||
imports = [
|
||||
./hardware.nix
|
||||
./disko.nix
|
||||
inputs.disko.nixosModules.default
|
||||
];
|
||||
|
||||
system.stateVersion = "24.11";
|
||||
boot.kernelPackages = pkgs.linuxPackages_latest;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,9 +1,6 @@
|
|||
{ inputs, ... }:
|
||||
{
|
||||
imports = [
|
||||
inputs.disko.nixosModules.default
|
||||
inputs.nixos-hardware.nixosModules.framework-13-7040-amd
|
||||
];
|
||||
imports = [ inputs.nixos-hardware.nixosModules.framework-13-7040-amd ];
|
||||
|
||||
nixpkgs.hostPlatform = "x86_64-linux";
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,11 @@
|
|||
{ config, ... }:
|
||||
{ config, inputs, ... }:
|
||||
{
|
||||
imports = [
|
||||
./hardware.nix
|
||||
./disko.nix
|
||||
inputs.disko.nixosModules.default
|
||||
];
|
||||
|
||||
system.stateVersion = "25.05";
|
||||
|
||||
meta = {
|
||||
|
|
|
|||
|
|
@ -1,9 +1,6 @@
|
|||
{ modulesPath, inputs, ... }:
|
||||
{ modulesPath, ... }:
|
||||
{
|
||||
imports = [
|
||||
inputs.disko.nixosModules.default
|
||||
"${modulesPath}/profiles/qemu-guest.nix"
|
||||
];
|
||||
imports = [ "${modulesPath}/profiles/qemu-guest.nix" ];
|
||||
|
||||
nixpkgs.hostPlatform = "x86_64-linux";
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,11 @@
|
|||
{ config, ... }:
|
||||
{ config, inputs, ... }:
|
||||
{
|
||||
imports = [
|
||||
./hardware.nix
|
||||
./disko.nix
|
||||
inputs.disko.nixosModules.default
|
||||
];
|
||||
|
||||
system.stateVersion = "25.05";
|
||||
|
||||
meta = {
|
||||
|
|
|
|||
|
|
@ -1,9 +1,6 @@
|
|||
{ modulesPath, inputs, ... }:
|
||||
{ modulesPath, ... }:
|
||||
{
|
||||
imports = [
|
||||
inputs.disko.nixosModules.default
|
||||
"${modulesPath}/profiles/qemu-guest.nix"
|
||||
];
|
||||
imports = [ "${modulesPath}/profiles/qemu-guest.nix" ];
|
||||
|
||||
nixpkgs.hostPlatform = "x86_64-linux";
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,11 @@
|
|||
{ config, ... }:
|
||||
{ config, inputs, ... }:
|
||||
{
|
||||
imports = [
|
||||
./hardware.nix
|
||||
./disko.nix
|
||||
inputs.disko.nixosModules.default
|
||||
];
|
||||
|
||||
system.stateVersion = "25.05";
|
||||
|
||||
meta = {
|
||||
|
|
|
|||
|
|
@ -1,9 +1,6 @@
|
|||
{ modulesPath, inputs, ... }:
|
||||
{ modulesPath, ... }:
|
||||
{
|
||||
imports = [
|
||||
inputs.disko.nixosModules.default
|
||||
"${modulesPath}/profiles/qemu-guest.nix"
|
||||
];
|
||||
imports = [ "${modulesPath}/profiles/qemu-guest.nix" ];
|
||||
|
||||
nixpkgs.hostPlatform = "x86_64-linux";
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue