From 4e456383ba3da6e7542553ccdb1f4801d330d6a1 Mon Sep 17 00:00:00 2001 From: js0ny Date: Mon, 13 Oct 2025 01:14:14 +0100 Subject: [PATCH] nix: multi-host home-manager --- nixcfgs/flake.nix | 110 +++++++++++++---------- nixcfgs/modules/home/gnome-keyrings.nix | 9 ++ nixcfgs/users/js0ny/default.nix | 30 ------- nixcfgs/users/js0ny/programs/default.nix | 16 ---- nixcfgs/users/js0ny/programs/mime.nix | 7 ++ nixcfgs/users/js0ny/zephyrus.nix | 40 +++++++++ nixcfgs/users/js0ny/zephyrus/default.nix | 2 - 7 files changed, 118 insertions(+), 96 deletions(-) create mode 100644 nixcfgs/modules/home/gnome-keyrings.nix delete mode 100644 nixcfgs/users/js0ny/programs/default.nix create mode 100644 nixcfgs/users/js0ny/programs/mime.nix create mode 100644 nixcfgs/users/js0ny/zephyrus.nix delete mode 100644 nixcfgs/users/js0ny/zephyrus/default.nix diff --git a/nixcfgs/flake.nix b/nixcfgs/flake.nix index d728bd3..5b67f92 100644 --- a/nixcfgs/flake.nix +++ b/nixcfgs/flake.nix @@ -22,55 +22,69 @@ nur.url = "github:nix-community/NUR"; }; - outputs = { - self, - nixpkgs, - nix-flatpak, - nix-darwin, - home-manager, - plasma-manager, - nur, - ... - } @ inputs: let - overlays = [ nur.overlays.default ]; - forSystem = system: import nixpkgs { - inherit system overlays; - config.allowUnfree = true; - }; - specialArgs = {inherit inputs;}; - in { - nixosConfigurations.zp = nixpkgs.lib.nixosSystem { - system = "x86_64-linux"; - inherit specialArgs; - modules = [ - nix-flatpak.nixosModules.nix-flatpak - ./hosts/zp - ]; - }; + outputs = + { + self, + nixpkgs, + nix-flatpak, + nix-darwin, + home-manager, + plasma-manager, + nur, + ... + }@inputs: + let + overlays = [ nur.overlays.default ]; + forSystem = + system: + import nixpkgs { + inherit system overlays; + config.allowUnfree = true; + }; + specialArgs = { inherit inputs; }; + in + { + nixosConfigurations.zp = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + inherit specialArgs; + modules = [ + nix-flatpak.nixosModules.nix-flatpak + ./hosts/zp + ]; + }; - nixosConfigurations.zephyrus = nixpkgs.lib.nixosSystem { - system = "x86_64-linux"; - inherit specialArgs; - modules = [ - ./hosts/zephyrus - ]; - }; + nixosConfigurations.zephyrus = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + inherit specialArgs; + modules = [ + ./hosts/zephyrus + ]; + }; - darwinConfigurations."zen" = nix-darwin.lib.darwinSystem { - system = "aarch64-darwin"; - inherit specialArgs; - modules = [ - ./hosts/zen - ]; + darwinConfigurations."zen" = nix-darwin.lib.darwinSystem { + system = "aarch64-darwin"; + inherit specialArgs; + modules = [ + ./hosts/zen + ]; + }; + homeConfigurations.js0ny = home-manager.lib.homeManagerConfiguration { + pkgs = forSystem "x86_64-linux"; + extraSpecialArgs = specialArgs; + modules = [ + ./users/js0ny + plasma-manager.homeModules.plasma-manager + nix-flatpak.homeManagerModules.nix-flatpak + ]; + }; + homeConfigurations."js0ny@zephyrus" = home-manager.lib.homeManagerConfiguration { + pkgs = forSystem "x86_64-linux"; + extraSpecialArgs = specialArgs; + modules = [ + ./users/js0ny/zephyrus.nix + plasma-manager.homeModules.plasma-manager + nix-flatpak.homeManagerModules.nix-flatpak + ]; + }; }; - homeConfigurations.js0ny = home-manager.lib.homeManagerConfiguration { - pkgs = forSystem "x86_64-linux"; - extraSpecialArgs = specialArgs; - modules = [ - ./users/js0ny - plasma-manager.homeModules.plasma-manager - nix-flatpak.homeManagerModules.nix-flatpak - ]; - }; - }; } diff --git a/nixcfgs/modules/home/gnome-keyrings.nix b/nixcfgs/modules/home/gnome-keyrings.nix new file mode 100644 index 0000000..4b27102 --- /dev/null +++ b/nixcfgs/modules/home/gnome-keyrings.nix @@ -0,0 +1,9 @@ +{ pkgs, ... }: + +{ + home.packages = with pkgs; [ + gcr + ]; + + services.gnome-keyring.enable = true; +} diff --git a/nixcfgs/users/js0ny/default.nix b/nixcfgs/users/js0ny/default.nix index cfdd294..2d9127e 100644 --- a/nixcfgs/users/js0ny/default.nix +++ b/nixcfgs/users/js0ny/default.nix @@ -7,31 +7,10 @@ }: { imports = [ - ./packages/cli.nix - ./packages/gui.nix - ./packages/flatpak.nix - ./programs/chromium.nix - ./programs/gnome.nix - ./programs/plasma.nix - ./programs/shell.nix - ./programs/vscode.nix ./programs/git.nix - ./programs/firefox.nix - ./programs/distrobox.nix - # ./programs/floorp.nix - ../../modules/home/dev/c.nix - ../../modules/home/dev/java.nix - ../../modules/home/dev/nix.nix - ../../modules/home/dev/python.nix - ../../modules/home/programs/eza.nix ../../modules/home/programs/fzf.nix ../../modules/home/programs/lsd.nix - ../../modules/home/programs/nvim.nix - # ../../modules/home/programs/rime.nix - ../../modules/home/programs/starship.nix - ../../modules/home/programs/zed-editor.nix ../../modules/home/programs/zoxide.nix - # ./flatpak.nix ]; nixpkgs.config.allowUnfree = true; home.username = "js0ny"; @@ -39,16 +18,7 @@ home.packages = with pkgs; [ home-manager - gcr ]; - services.gnome-keyring.enable = true; - - xdg.mimeApps = { - defaultApplications = { - "application/pdf" = "org.kde.okular.desktop"; - }; - }; - home.stateVersion = "25.05"; } diff --git a/nixcfgs/users/js0ny/programs/default.nix b/nixcfgs/users/js0ny/programs/default.nix deleted file mode 100644 index b163de2..0000000 --- a/nixcfgs/users/js0ny/programs/default.nix +++ /dev/null @@ -1,16 +0,0 @@ -{pkgs, ...}: { - imports = [ - ./shell.nix - ./vscodium.nix - ../../../modules/home/dev/java.nix - ../../../modules/home/dev/python.nix - ../../../modules/home/programs/eza.nix - ../../../modules/home/programs/fzf.nix - ../../../modules/home/programs/lsd.nix - ../../../modules/home/programs/nvim.nix - ../../../modules/home/programs/rime.nix - ../../../modules/home/programs/starship.nix - ../../../modules/home/programs/zed-editor.nix - ../../../modules/home/programs/zoxide.nix - ]; -} diff --git a/nixcfgs/users/js0ny/programs/mime.nix b/nixcfgs/users/js0ny/programs/mime.nix new file mode 100644 index 0000000..a8b56d6 --- /dev/null +++ b/nixcfgs/users/js0ny/programs/mime.nix @@ -0,0 +1,7 @@ +{ + xdg.mimeApps = { + defaultApplications = { + "application/pdf" = "org.kde.okular.desktop"; + }; + }; +} diff --git a/nixcfgs/users/js0ny/zephyrus.nix b/nixcfgs/users/js0ny/zephyrus.nix new file mode 100644 index 0000000..474da64 --- /dev/null +++ b/nixcfgs/users/js0ny/zephyrus.nix @@ -0,0 +1,40 @@ +# ~/.config/nixcfgs/users/js0ny/default.nix +{ + pkgs, + nix-flatpak, + plasma-manager, + ... +}: +{ + imports = [ + ./default.nix + ./packages/cli.nix + ./packages/gui.nix + ./packages/flatpak.nix + ./programs/chromium.nix + ./programs/gnome.nix + ./programs/plasma.nix + ./programs/shell.nix + ./programs/vscode.nix + ./programs/git.nix + ./programs/firefox.nix + ./programs/distrobox.nix + ./programs/mime.nix + # ./programs/floorp.nix + ../../modules/home/gnome-keyrings.nix + ../../modules/home/dev/c.nix + ../../modules/home/dev/java.nix + ../../modules/home/dev/nix.nix + ../../modules/home/dev/python.nix + ../../modules/home/programs/eza.nix + ../../modules/home/programs/fzf.nix + ../../modules/home/programs/lsd.nix + ../../modules/home/programs/nvim.nix + ../../modules/home/programs/starship.nix + ../../modules/home/programs/zoxide.nix + ../../modules/home/programs/zed-editor.nix + # ./flatpak.nix + ]; + + home.stateVersion = "25.05"; +} diff --git a/nixcfgs/users/js0ny/zephyrus/default.nix b/nixcfgs/users/js0ny/zephyrus/default.nix deleted file mode 100644 index 93bcb0b..0000000 --- a/nixcfgs/users/js0ny/zephyrus/default.nix +++ /dev/null @@ -1,2 +0,0 @@ -aaa -d: \ No newline at end of file