From 3bba2a1694ec713b8055b8748527b20c5eb45e4a Mon Sep 17 00:00:00 2001 From: arunoruto Date: Mon, 14 Oct 2024 04:54:28 +0200 Subject: [PATCH] Reorganize the flake a bit and clean up --- .github/README.md | 1 + flake.nix | 26 +++++++++----------------- modules/home-manager/home.nix | 20 +------------------- modules/home-manager/module.nix | 20 -------------------- 4 files changed, 11 insertions(+), 56 deletions(-) delete mode 100644 modules/home-manager/module.nix diff --git a/.github/README.md b/.github/README.md index 14b4ccf..67c1618 100644 --- a/.github/README.md +++ b/.github/README.md @@ -92,3 +92,4 @@ To clean up such systems, you can use the following commands: ## Credits - [use-the-fork](https://github.com/use-the-fork) helped me to [move](https://www.reddit.com/r/NixOS/comments/1eely7a/access_homemanager_config_from_my_nixos_config/) from a standalone config for home-manager to using it as a module +- [u/paulgdp](https://www.reddit.com/user/paulgdp/) gave [advice](https://www.reddit.com/r/NixOS/comments/19c5een/comment/kiwxy8b/?utm_source=share&utm_medium=web3x&utm_name=web3xcss&utm_term=1&utm_content=share_button) on how `nixosConfig` is an attribute of `args` if the config is used in NixOS, used in `modules/home-manager/imports.nix` diff --git a/flake.nix b/flake.nix index aad1c78..3f7f451 100644 --- a/flake.nix +++ b/flake.nix @@ -130,7 +130,7 @@ nixos-modules = [ nixpkgs-config nur.nixosModules.nur - stylix-config + # stylix-config { theming = { inherit scheme; @@ -144,21 +144,21 @@ # neorg-overlay.overlays.default # ]; # } - nur.hmModules.nur # nixvim.homeManagerModules.nixvim - inputs.stylix.homeManagerModules.stylix - stylix-config - # { - # stylix.image = nixpkgs.lib.mkDefault ./home-manager/desktop/default-wallpaper.png; - # #stylix.targets.nixvim.enable = nixpkgs.lib.mkDefault false; - # } + nur.hmModules.nur ./modules/home-manager/home.nix + inputs.stylix.homeManagerModules.stylix { theming = { inherit scheme; inherit image; }; } + # stylix-config + # { + # stylix.image = nixpkgs.lib.mkDefault ./home-manager/desktop/default-wallpaper.png; + # #stylix.targets.nixvim.enable = nixpkgs.lib.mkDefault false; + # } ]; in { nixosConfigurations = { @@ -223,8 +223,6 @@ ./hosts/kyuubi home-manager.nixosModules.home-manager ./homes - # ./nixos/hosts/kyuubi/configuration.nix - # home-manager.nixosModules.home-manager ]; }; @@ -300,13 +298,7 @@ mar = home-manager.lib.homeManagerConfiguration { inherit pkgs; - modules = - home-manager-modules; - # ++ [ - # { - # pc.enable = false; - # } - # ]; + modules = home-manager-modules; extraSpecialArgs = { inherit inputs; user = "mar"; diff --git a/modules/home-manager/home.nix b/modules/home-manager/home.nix index 95b1ac7..68b86a8 100644 --- a/modules/home-manager/home.nix +++ b/modules/home-manager/home.nix @@ -1,28 +1,10 @@ -{ - # lib, - user, - ... -}: { +{user, ...}: { imports = [ ./hosts - # ./pc - # ./theming ./environment.nix ./imports.nix - ./module.nix ]; - # pc.enable = - # lib.mkDefault - # ( - # if (args ? nixosConfig) - # then osConfig.gui.enable - # else false - # ); - # theming.enable = - # if (args ? nixosConfig) - # then lib.mkDefault osConfig.gui.enable - # else false; environment.enable = true; # Allow unfree software diff --git a/modules/home-manager/module.nix b/modules/home-manager/module.nix deleted file mode 100644 index 7ba3249..0000000 --- a/modules/home-manager/module.nix +++ /dev/null @@ -1,20 +0,0 @@ -args @ { - osConfig, - lib, - ... -}: { - # imports = [ - # ./standalone.nix - # ]; - config = lib.mkIf (args ? nixosConfig) { - hostname = osConfig.networking.hostName; - keyboard = { - layout = osConfig.services.xserver.xkb.layout; - variant = osConfig.services.xserver.xkb.variant; - }; - theming = { - image = osConfig.theming.image; - scheme = osConfig.theming.scheme; - }; - }; -}