From 565bfa66d8f4af795448bf92ef51db9687d88979 Mon Sep 17 00:00:00 2001 From: notohh Date: Fri, 12 May 2023 05:27:17 -0400 Subject: [PATCH] refactor: move nixosSystems out of flake --- flake.nix | 54 +---------------------------------- hosts/systems.nix | 71 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 72 insertions(+), 53 deletions(-) create mode 100644 hosts/systems.nix diff --git a/flake.nix b/flake.nix index 9701d2b..444bc51 100755 --- a/flake.nix +++ b/flake.nix @@ -27,7 +27,6 @@ ... } @ inputs: let system = "x86_64-linux"; - lib = nixpkgs.lib; pkgs = import nixpkgs { inherit system; }; @@ -47,57 +46,6 @@ }; deploy = import ./hosts/deploy.nix inputs; formatter.${system} = pkgs.alejandra; - nixosConfigurations = { - tsuki = lib.nixosSystem { - inherit system; - modules = [ - ./hosts/tsuki - home-manager.nixosModules.home-manager - { - home-manager = { - useGlobalPkgs = true; - useUserPackages = true; - extraSpecialArgs = {inherit inputs;}; - users.notoh = { - imports = [ - hyprland.homeManagerModules.default - ./hosts/tsuki/home.nix - ]; - }; - }; - } - ]; - }; - hime = lib.nixosSystem { - inherit system; - modules = [ - ./hosts/hime - home-manager.nixosModules.home-manager - { - home-manager = { - useGlobalPkgs = true; - useUserPackages = true; - users.oh = {imports = [./hosts/hime/home.nix];}; - }; - } - ]; - }; - sutakku = lib.nixosSystem { - inherit system; - modules = [ - ./hosts/sutakku - home-manager.nixosModules.home-manager - { - home-manager = { - useGlobalPkgs = true; - useUserPackages = true; - users.oh = { - imports = [./hosts/sutakku/home.nix]; - }; - }; - } - ]; - }; - }; + nixosConfigurations = import ./hosts/systems.nix inputs; }; } diff --git a/hosts/systems.nix b/hosts/systems.nix new file mode 100644 index 0000000..3f1dd5e --- /dev/null +++ b/hosts/systems.nix @@ -0,0 +1,71 @@ +inputs: let + system = "x86_64-linux"; + inherit (inputs.nixpkgs.lib) nixosSystem; +in { + tsuki = nixosSystem { + inherit system; + modules = [ + ./tsuki + inputs.home-manager.nixosModules.home-manager + { + home-manager = { + useGlobalPkgs = true; + useUserPackages = true; + extraSpecialArgs = {inherit inputs;}; + users.notoh = { + imports = [ + inputs.hyprland.homeManagerModules.default + ./tsuki/home.nix + ]; + }; + }; + } + ]; + }; + hime = nixosSystem { + inherit system; + modules = [ + ./hime + inputs.home-manager.nixosModules.home-manager + { + home-manager = { + useGlobalPkgs = true; + useUserPackages = true; + users.oh = {imports = [./hime/home.nix];}; + }; + } + ]; + }; + sutakku = nixosSystem { + inherit system; + modules = [ + ./sutakku + inputs.home-manager.nixosModules.home-manager + { + home-manager = { + useGlobalPkgs = true; + useUserPackages = true; + users.oh = { + imports = [./sutakku/home.nix]; + }; + }; + } + ]; + }; + sakura = nixosSystem { + inherit system; + modules = [ + ./sakura + inputs.home-manager.nixosModules.home-manager + { + home-manager = { + useGlobalPkgs = true; + useUserPackages = true; + users.notoh = { + imports = [./sakura/home.nix]; + }; + }; + } + ]; + }; +}