aboutsummaryrefslogtreecommitdiff
path: root/flake/hosts.nix
diff options
context:
space:
mode:
Diffstat (limited to 'flake/hosts.nix')
-rw-r--r--flake/hosts.nix103
1 files changed, 44 insertions, 59 deletions
diff --git a/flake/hosts.nix b/flake/hosts.nix
index d855a4a..41e983d 100644
--- a/flake/hosts.nix
+++ b/flake/hosts.nix
@@ -15,7 +15,6 @@ let
mkIf
nixosSystem
readDir
- replaceStrings
substring
;
@@ -33,37 +32,25 @@ let
mapHosts = foldl' (
hosts: system:
hosts
- // (mapAttrs' (
- filename: _:
- let
- name = replaceStrings [ ".nix" ] [ "" ] filename;
- in
- {
- inherit name;
- value = {
- inherit system;
- hostconf = "${self}/machines/nixos/${system}/${filename}";
- };
- }
- ) (builtins.readDir "${self}/machines/nixos/${system}"))
+ // (mapAttrs' (name: _: {
+ inherit name;
+ value = {
+ inherit system;
+ hostconf = "${self}/machines/nixos/${system}/${name}";
+ };
+ }) (builtins.readDir "${self}/machines/nixos/${system}"))
) { };
mapMacs = foldl' (
hosts: system:
hosts
- // (mapAttrs' (
- filename: _:
- let
- name = replaceStrings [ ".nix" ] [ "" ] filename;
- in
- {
- inherit name;
- value = {
- inherit system;
- hostconf = "${self}/machines/darwin/${system}/${filename}";
- };
- }
- ) (builtins.readDir "${self}/machines/darwin/${system}"))
+ // (mapAttrs' (name: _: {
+ inherit name;
+ value = {
+ inherit system;
+ hostconf = "${self}/machines/darwin/${system}/${name}";
+ };
+ }) (builtins.readDir "${self}/machines/darwin/${system}"))
) { };
defaultModules = [
@@ -105,22 +92,21 @@ let
inherit self;
inherit inputs;
};
- modules =
- [
- { inherit adminUser; }
- {
- nixpkgs.pkgs = pkgs;
- nixpkgs.hostPlatform = system;
- system.stateVersion = 5;
- environment.systemPackages = [
- pkgs.git
- ];
- }
- ]
- ++ darwinDefaultModules
- ++ [
- hostconf
- ];
+ modules = [
+ { inherit adminUser; }
+ {
+ nixpkgs.pkgs = pkgs;
+ nixpkgs.hostPlatform = system;
+ system.stateVersion = 5;
+ environment.systemPackages = [
+ pkgs.git
+ ];
+ }
+ ]
+ ++ darwinDefaultModules
+ ++ [
+ hostconf
+ ];
}
);
}
@@ -155,22 +141,21 @@ let
}) nixosConfigurations;
inherit inputs;
};
- modules =
- [
- { inherit adminUser; }
- {
- system.configurationRevision = mkIf (self ? rev) self.rev;
- system.nixos.versionSuffix = mkForce "git.${substring 0 11 inputs.nixpkgs.rev}";
- nixpkgs.pkgs = pkgs;
- environment.systemPackages = [
- pkgs.git
- ];
- }
- ]
- ++ defaultModules
- ++ [
- hostconf
- ];
+ modules = [
+ { inherit adminUser; }
+ {
+ system.configurationRevision = mkIf (self ? rev) self.rev;
+ system.nixos.versionSuffix = mkForce "git.${substring 0 11 inputs.nixpkgs.rev}";
+ nixpkgs.pkgs = pkgs;
+ environment.systemPackages = [
+ pkgs.git
+ ];
+ }
+ ]
+ ++ defaultModules
+ ++ [
+ hostconf
+ ];
}
);
}