mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-01-21 15:11: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:
|
hostName:
|
||||||
inputs.nixpkgs.lib.nixosSystem {
|
inputs.nixpkgs.lib.nixosSystem {
|
||||||
specialArgs = { inherit inputs self; };
|
specialArgs = { inherit inputs self; };
|
||||||
modules =
|
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; }; }
|
{ networking = { inherit hostName; }; }
|
||||||
"${self}/hosts/common.nix"
|
"${self}/hosts/common.nix"
|
||||||
"${self}/users/seb/default.nix"
|
"${self}/hosts/${hostName}"
|
||||||
|
"${self}/users/seb"
|
||||||
]
|
]
|
||||||
++ hostFiles
|
++ lib.optional (lib.pathExists "${self}/users/seb/@${hostName}") "${self}/users/seb/@${hostName}";
|
||||||
++ userFiles;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
mkDeployNode = hostname: {
|
mkDeployNode = hostname: {
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,11 @@
|
||||||
{ pkgs, ... }:
|
{ inputs, pkgs, ... }:
|
||||||
{
|
{
|
||||||
|
imports = [
|
||||||
|
./hardware.nix
|
||||||
|
./disko.nix
|
||||||
|
inputs.disko.nixosModules.default
|
||||||
|
];
|
||||||
|
|
||||||
system.stateVersion = "23.11";
|
system.stateVersion = "23.11";
|
||||||
boot.kernelPackages = pkgs.linuxPackages_latest;
|
boot.kernelPackages = pkgs.linuxPackages_latest;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,4 @@
|
||||||
{ inputs, ... }:
|
_: {
|
||||||
{
|
|
||||||
imports = [ inputs.disko.nixosModules.default ];
|
|
||||||
|
|
||||||
nixpkgs.hostPlatform = "x86_64-linux";
|
nixpkgs.hostPlatform = "x86_64-linux";
|
||||||
|
|
||||||
hardware = {
|
hardware = {
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,11 @@
|
||||||
{ pkgs, ... }:
|
{ inputs, pkgs, ... }:
|
||||||
{
|
{
|
||||||
|
imports = [
|
||||||
|
./hardware.nix
|
||||||
|
./disko.nix
|
||||||
|
inputs.disko.nixosModules.default
|
||||||
|
];
|
||||||
|
|
||||||
system.stateVersion = "24.11";
|
system.stateVersion = "24.11";
|
||||||
boot.kernelPackages = pkgs.linuxPackages_latest;
|
boot.kernelPackages = pkgs.linuxPackages_latest;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,6 @@
|
||||||
{ inputs, ... }:
|
{ inputs, ... }:
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [ inputs.nixos-hardware.nixosModules.framework-13-7040-amd ];
|
||||||
inputs.disko.nixosModules.default
|
|
||||||
inputs.nixos-hardware.nixosModules.framework-13-7040-amd
|
|
||||||
];
|
|
||||||
|
|
||||||
nixpkgs.hostPlatform = "x86_64-linux";
|
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";
|
system.stateVersion = "25.05";
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,6 @@
|
||||||
{ modulesPath, inputs, ... }:
|
{ modulesPath, ... }:
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [ "${modulesPath}/profiles/qemu-guest.nix" ];
|
||||||
inputs.disko.nixosModules.default
|
|
||||||
"${modulesPath}/profiles/qemu-guest.nix"
|
|
||||||
];
|
|
||||||
|
|
||||||
nixpkgs.hostPlatform = "x86_64-linux";
|
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";
|
system.stateVersion = "25.05";
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,6 @@
|
||||||
{ modulesPath, inputs, ... }:
|
{ modulesPath, ... }:
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [ "${modulesPath}/profiles/qemu-guest.nix" ];
|
||||||
inputs.disko.nixosModules.default
|
|
||||||
"${modulesPath}/profiles/qemu-guest.nix"
|
|
||||||
];
|
|
||||||
|
|
||||||
nixpkgs.hostPlatform = "x86_64-linux";
|
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";
|
system.stateVersion = "25.05";
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,6 @@
|
||||||
{ modulesPath, inputs, ... }:
|
{ modulesPath, ... }:
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [ "${modulesPath}/profiles/qemu-guest.nix" ];
|
||||||
inputs.disko.nixosModules.default
|
|
||||||
"${modulesPath}/profiles/qemu-guest.nix"
|
|
||||||
];
|
|
||||||
|
|
||||||
nixpkgs.hostPlatform = "x86_64-linux";
|
nixpkgs.hostPlatform = "x86_64-linux";
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue