From 0831fdaeb9121c6cefd6dfd51666caeb33f5d919 Mon Sep 17 00:00:00 2001 From: Aly Raffauf Date: Tue, 11 Jun 2024 14:25:31 -0400 Subject: [PATCH] flake: refactor home manager modules into flake output --- flake.nix | 6 +++++- homeManagerModules/default.nix | 2 +- homeManagerModules/desktop/hyprland/default.nix | 7 +++---- homeManagerModules/desktop/sway/default.nix | 1 - aly.nix => homes/aly.nix | 7 +++---- dustin.nix => homes/dustin.nix | 8 ++++---- hosts/fallarbor/home.nix | 7 ++----- hosts/lavaridge/home.nix | 5 +---- hosts/mauville/home.nix | 7 ++----- hosts/petalburg/home.nix | 5 +---- hosts/rustboro/home.nix | 5 +---- nixosModules/default.nix | 2 ++ nixosModules/user/default.nix | 9 ++++----- 13 files changed, 29 insertions(+), 42 deletions(-) rename aly.nix => homes/aly.nix (99%) rename dustin.nix => homes/dustin.nix (98%) diff --git a/flake.nix b/flake.nix index 0bbe99b3..01e2550b 100644 --- a/flake.nix +++ b/flake.nix @@ -80,6 +80,9 @@ ''; }); + homeManagerModules.default = + import ./homeManagerModules inputs self; + nixosModules.default = import ./nixosModules inputs; @@ -96,8 +99,9 @@ specialArgs = {inherit inputs self;}; modules = [ ./hosts/${host} - self.nixosModules.default inputs.agenix.nixosModules.default + inputs.home-manager.nixosModules.home-manager + self.nixosModules.default ]; } ); diff --git a/homeManagerModules/default.nix b/homeManagerModules/default.nix index d3b70205..389d464b 100644 --- a/homeManagerModules/default.nix +++ b/homeManagerModules/default.nix @@ -1,4 +1,4 @@ -{ +inputs: self: { config, pkgs, lib, diff --git a/homeManagerModules/desktop/hyprland/default.nix b/homeManagerModules/desktop/hyprland/default.nix index 6c687801..4b3f4e59 100644 --- a/homeManagerModules/desktop/hyprland/default.nix +++ b/homeManagerModules/desktop/hyprland/default.nix @@ -2,7 +2,6 @@ pkgs, lib, config, - inputs, ... }: { options = { @@ -54,8 +53,8 @@ xdg.portal = { enable = true; - configPackages = [inputs.nixpkgsUnstable.legacyPackages."${pkgs.system}".xdg-desktop-portal-hyprland]; - extraPortals = [inputs.nixpkgsUnstable.legacyPackages."${pkgs.system}".xdg-desktop-portal-hyprland]; + configPackages = [pkgs.xdg-desktop-portal-hyprland]; + extraPortals = [pkgs.xdg-desktop-portal-hyprland]; }; programs.waybar = { @@ -141,7 +140,7 @@ ]; screenshot = rec { - bin = lib.getExe inputs.nixpkgsUnstable.legacyPackages."${pkgs.system}".hyprshot; + bin = lib.getExe pkgs.hyprshot; folder = "${config.xdg.userDirs.pictures}/screenshots"; screen = "${bin} -m output -o ${folder}"; region = "${bin} -m region -o ${folder}"; diff --git a/homeManagerModules/desktop/sway/default.nix b/homeManagerModules/desktop/sway/default.nix index bf104503..eed23419 100644 --- a/homeManagerModules/desktop/sway/default.nix +++ b/homeManagerModules/desktop/sway/default.nix @@ -2,7 +2,6 @@ pkgs, lib, config, - inputs, ... }: { imports = [./randomWallpaper.nix ./redShift.nix]; diff --git a/aly.nix b/homes/aly.nix similarity index 99% rename from aly.nix rename to homes/aly.nix index d91c33bd..04cbef0a 100644 --- a/aly.nix +++ b/homes/aly.nix @@ -1,12 +1,11 @@ { - inputs, config, - pkgs, + inputs, lib, + pkgs, + self, ... }: { - imports = [./homeManagerModules]; - home = { username = "aly"; homeDirectory = "/home/aly"; diff --git a/dustin.nix b/homes/dustin.nix similarity index 98% rename from dustin.nix rename to homes/dustin.nix index 5632654c..985b2001 100644 --- a/dustin.nix +++ b/homes/dustin.nix @@ -1,11 +1,11 @@ { config, - pkgs, + inputs, lib, + pkgs, + self, ... }: { - imports = [./homeManagerModules]; - home = { username = "dustin"; homeDirectory = "/home/dustin"; @@ -16,8 +16,8 @@ libreoffice-fresh plexamp vlc - xfce.xfce4-taskmanager webcord + xfce.xfce4-taskmanager zoom-us ]; }; diff --git a/hosts/fallarbor/home.nix b/hosts/fallarbor/home.nix index f762bcda..f19cae0c 100644 --- a/hosts/fallarbor/home.nix +++ b/hosts/fallarbor/home.nix @@ -5,11 +5,8 @@ lib, ... }: { - imports = [ - inputs.home-manager.nixosModules.home-manager - ]; home-manager = { - users.aly = import ../../aly.nix; - users.dustin = import ../../dustin.nix; + users.aly = import ../../homes/aly.nix; + users.dustin = import ../../homes/dustin.nix; }; } diff --git a/hosts/lavaridge/home.nix b/hosts/lavaridge/home.nix index b67c5b38..acd2a41b 100644 --- a/hosts/lavaridge/home.nix +++ b/hosts/lavaridge/home.nix @@ -5,9 +5,6 @@ lib, ... }: { - imports = [ - inputs.home-manager.nixosModules.home-manager - ]; home-manager = { sharedModules = [ { @@ -19,6 +16,6 @@ }; } ]; - users.aly = import ../../aly.nix; + users.aly = import ../../homes/aly.nix; }; } diff --git a/hosts/mauville/home.nix b/hosts/mauville/home.nix index 2819db62..d05c5b19 100644 --- a/hosts/mauville/home.nix +++ b/hosts/mauville/home.nix @@ -5,9 +5,6 @@ lib, ... }: { - imports = [ - inputs.home-manager.nixosModules.home-manager - ]; home-manager = { sharedModules = [ { @@ -70,7 +67,7 @@ } ]; users.aly = { - imports = [../../aly.nix]; + imports = [../../homes/aly.nix]; systemd.user = { services.backblaze-sync = { Unit = { @@ -111,6 +108,6 @@ }; }; }; - users.dustin = import ../../dustin.nix; + users.dustin = import ../../homes/dustin.nix; }; } diff --git a/hosts/petalburg/home.nix b/hosts/petalburg/home.nix index 39366800..54604f3f 100644 --- a/hosts/petalburg/home.nix +++ b/hosts/petalburg/home.nix @@ -5,9 +5,6 @@ lib, ... }: { - imports = [ - inputs.home-manager.nixosModules.home-manager - ]; home-manager = { sharedModules = [ { @@ -19,6 +16,6 @@ ''; } ]; - users.aly = import ../../aly.nix; + users.aly = import ../../homes/aly.nix; }; } diff --git a/hosts/rustboro/home.nix b/hosts/rustboro/home.nix index 31a4c1c1..048ac222 100644 --- a/hosts/rustboro/home.nix +++ b/hosts/rustboro/home.nix @@ -5,9 +5,6 @@ lib, ... }: { - imports = [ - inputs.home-manager.nixosModules.home-manager - ]; home-manager = { sharedModules = [ { @@ -37,6 +34,6 @@ }; } ]; - users.aly = import ../../aly.nix; + users.aly = import ../../homes/aly.nix; }; } diff --git a/nixosModules/default.nix b/nixosModules/default.nix index 2270c74f..399c6df7 100644 --- a/nixosModules/default.nix +++ b/nixosModules/default.nix @@ -42,6 +42,8 @@ in { google-chrome = prev.google-chrome.override {commandLineArgs = "--gtk-version=4 --enable-wayland-ime";}; hyprland = inputs.hyprland.packages.${pkgs.system}.hyprland; hyprnome = unstable.hyprnome; + hyprshot = unstable.hyprshot; + xdg-desktop-portal-hyprland = unstable.xdg-desktop-portal-hyprland; obsidian = unstable.obsidian.overrideAttrs (old: { installPhase = builtins.replaceStrings ["--ozone-platform=wayland"] diff --git a/nixosModules/user/default.nix b/nixosModules/user/default.nix index f7fd09b3..57834fe0 100644 --- a/nixosModules/user/default.nix +++ b/nixosModules/user/default.nix @@ -1,9 +1,9 @@ { - pkgs, - lib, config, inputs, - unstable, + lib, + pkgs, + self, ... }: { imports = [ @@ -14,8 +14,7 @@ home-manager = { backupFileExtension = "backup"; - extraSpecialArgs = {inherit inputs unstable;}; - sharedModules = [{imports = [../../homeManagerModules];}]; + sharedModules = [self.homeManagerModules.default]; useGlobalPkgs = true; useUserPackages = true; };