diff options
| author | seth <[email protected]> | 2023-03-08 02:57:57 -0500 |
|---|---|---|
| committer | seth <[email protected]> | 2023-03-08 15:32:06 -0500 |
| commit | fa7a407bda1b26b413702287f227629af0798f55 (patch) | |
| tree | 38cc9ae1791939a0f92a3f03d37a0249e62cdf1a /flake.nix | |
| parent | 729db074dc1b93cab10b43119197c8e02a452405 (diff) | |
another major refactor
Diffstat (limited to 'flake.nix')
| -rw-r--r-- | flake.nix | 90 |
1 files changed, 18 insertions, 72 deletions
@@ -24,85 +24,31 @@ outputs = inputs @ { nixpkgs, nixpkgsUnstable, - getchoo, - home-manager, - lanzaboote, - nixos-hardware, - nixos-wsl, - nur, ... }: let - supportedSystems = ["x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin"]; + supportedSystems = ["x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin"]; forAllSystems = nixpkgs.lib.genAttrs supportedSystems; - nixpkgsFor = forAllSystems (system: import nixpkgs {inherit system;}); - util = import ./util {inherit inputs home-manager;}; - inherit (util) host user; - - seth = { - specialArgs ? {}, - pkgs ? nixpkgsUnstable, - }: - forAllSystems (system: import ./users/seth {inherit pkgs specialArgs system user;}); - in { - homeConfigurations = forAllSystems (system: { - inherit ((seth {}).${system}.hm) seth; - }); + mkPkgsFor = pkgs: forAllSystems (system: import pkgs {inherit system;}); + channels = { + nixpkgs = mkPkgsFor nixpkgs; + nixpkgsUnstable = mkPkgsFor nixpkgsUnstable; + }; - nixosConfigurations = - (host.mkHost rec { - name = "glados"; - specialArgs = { - desktop = "gnome"; - standalone = false; - wsl = false; - }; - version = "23.05"; - pkgs = nixpkgsUnstable; - modules = - [ - nixos-hardware.nixosModules.common-cpu-amd-pstate - nixos-hardware.nixosModules.common-gpu-nvidia-nonprime - nixos-hardware.nixosModules.common-pc-ssd - lanzaboote.nixosModules.lanzaboote - nur.nixosModules.nur + util = import ./util { + inherit (nixpkgs) lib; + inherit inputs; + }; + inherit (util.host) mapHosts; + inherit (util.user) mapHMUsers; - { - nixpkgs.overlays = [nur.overlay getchoo.overlays.default]; - nix.registry.getchoo.flake = getchoo; - } - ] - ++ (seth {inherit specialArgs pkgs;}).x86_64-linux.system; - }) - // (host.mkHost rec { - name = "glados-wsl"; - specialArgs = { - desktop = ""; - standalone = false; - wsl = true; - }; - version = "23.05"; - pkgs = nixpkgsUnstable; - modules = - [ - nixos-wsl.nixosModules.wsl - { - wsl = { - enable = true; - defaultUser = "seth"; - nativeSystemd = true; - wslConf.network.hostname = "glados-wsl"; - startMenuLaunchers = false; - interop.includePath = false; - }; + users = import ./users {inherit inputs;}; + hosts = import ./hosts {inherit inputs;}; + in { + homeConfigurations = forAllSystems (system: mapHMUsers (users.users {inherit system;})); - nixpkgs.overlays = [getchoo.overlays.default]; - nix.registry.getchoo.flake = getchoo; - } - ] - ++ (seth {inherit specialArgs pkgs;}).x86_64-linux.system; - }); + nixosConfigurations = mapHosts hosts; - formatter = forAllSystems (system: nixpkgsFor.${system}.alejandra); + formatter = forAllSystems (system: channels.nixpkgs.${system}.alejandra); }; } |
