diff options
| author | seth <[email protected]> | 2023-10-30 04:22:32 -0400 |
|---|---|---|
| committer | seth <[email protected]> | 2023-10-30 09:46:15 +0000 |
| commit | 10b0df38b4286237b56ff9177f8d4c5676bfb5c1 (patch) | |
| tree | ab298c74339bf9bc41571fa88746ecd9c522fbdf /systems/default.nix | |
| parent | 4c2c60a4f2b14c1e6ffaffe5e301dc31ac4fed0f (diff) | |
tree-wide: refactor
i went overboard on modules. this is much comfier
Diffstat (limited to 'systems/default.nix')
| -rw-r--r-- | systems/default.nix | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/systems/default.nix b/systems/default.nix new file mode 100644 index 0000000..6807a71 --- /dev/null +++ b/systems/default.nix @@ -0,0 +1,73 @@ +{ + lib, + inputs, + self, + withSystem, + ... +}: let + /* + basic nixosSystem/darwinSystem wrapper; can override + the exact builder by supplying an argument + */ + mapSystems = builder: + lib.mapAttrs (name: args: + (args.builder or builder) ( + (lib.filterAttrs (n: _: n != "builder") args) # use builder but don't include it in output + // { + modules = args.modules ++ [./${name}]; + specialArgs = {inherit inputs self;}; + } + )); + + mapDarwin = mapSystems inputs.darwin.lib.darwinSystem; + mapNixOS = mapSystems inputs.nixpkgs.lib.nixosSystem; + inherit (import ./common.nix {inherit inputs self;}) darwin nixos server; +in { + flake = { + darwinConfigurations = mapDarwin { + caroline = { + system = "x86_64-darwin"; + modules = darwin; + }; + }; + + nixosConfigurations = mapNixOS { + glados = { + system = "x86_64-linux"; + modules = + [ + inputs.lanzaboote.nixosModules.lanzaboote + ] + ++ nixos; + }; + + glados-wsl = { + system = "x86_64-linux"; + modules = + [ + inputs.nixos-wsl.nixosModules.wsl + ] + ++ nixos; + }; + + atlas = { + builder = inputs.nixpkgs-stable.lib.nixosSystem; + system = "aarch64-linux"; + modules = + [ + inputs.guzzle_api.nixosModules.default + ] + ++ server; + }; + }; + + openwrtConfigurations.turret = withSystem "x86_64-linux" ({pkgs, ...}: + pkgs.callPackage ./turret { + inherit (inputs) openwrt-imagebuilder; + }); + }; + + perSystem = {system, ...}: { + apps = (inputs.nixinate.nixinate.${system} self).nixinate; + }; +} |
