Skip to content

Commit

Permalink
Merge pull request #2 from TheMaxMur/develop
Browse files Browse the repository at this point in the history
Update master
  • Loading branch information
TheMaxMur authored Sep 1, 2024
2 parents 619af93 + b98df1b commit a35c629
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 14 deletions.
4 changes: 0 additions & 4 deletions hosts.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
nixos = {
pcbox = {
hostname = "pcbox";
username = "maxmur";
platform = "x86_64-linux";
stateVersion = "24.11";
Expand All @@ -10,7 +9,6 @@
};

nbox = {
hostname = "nbox";
username = "maxmur";
platform = "x86_64-linux";
stateVersion = "24.11";
Expand All @@ -19,7 +17,6 @@
};

rasp = {
hostname = "rasp";
username = "maxmur";
platform = "aarch64-linux";
stateVersion = "24.11";
Expand All @@ -29,7 +26,6 @@

darwin = {
macbox = {
hostname = "macbox";
username = "maxmur";
platform = "aarch64-darwin";
stateVersion = 6;
Expand Down
16 changes: 6 additions & 10 deletions lib/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,8 @@ let
commonModules = "${self}/modules";

# Helper function for generating host configs
mkHost =
{ hostname ? "nixos"
, username ? "user"
mkHost = hostname:
{ username ? "user"
, stateVersion ? "24.05"
, platform ? "x86_64-linux"
, isWorkstation ? false
Expand Down Expand Up @@ -59,9 +58,8 @@ let
};

# Helper function for generating darwin host configs
mkHostDarwin =
{ hostname ? "mac"
, username ? "user"
mkHostDarwin = hostname:
{ username ? "user"
, stateVersion ? 6
, platform ? "aarch64-darwin"
}:
Expand All @@ -83,12 +81,10 @@ let
"${homeConfiguration}"
];
};

genConfig = hosts: mkFunc: builtins.mapAttrs (_: mkFunc) hosts;
in {
forAllSystems = inputs.nixpkgs.lib.systems.flakeExposed;

genNixos = hosts: genConfig hosts mkHost;
genDarwin = hosts: genConfig hosts mkHostDarwin;
genNixos = builtins.mapAttrs mkHost;
genDarwin = builtins.mapAttrs mkHostDarwin;
}

0 comments on commit a35c629

Please sign in to comment.