1
0
Fork 0

Change directory structure for home-manager

This commit is contained in:
Ethan Reece 2025-07-17 14:50:52 -05:00
parent 659c6a82a4
commit 450ca7f685
Signed by: me
GPG key ID: DD8CE04D5D8FF832
5 changed files with 31 additions and 75 deletions

View file

@ -22,7 +22,7 @@
); );
}; };
perSystem = { perSystem = {
pre-commit.settings.excludes = [ "home-manager/profiles/asahi/vencord.nix" ]; pre-commit.settings.excludes = [ "home-manager/asahi/vencord.nix" ];
treefmt.settings.global.excludes = [ "home-manager/profiles/asahi/vencord.nix" ]; treefmt.settings.global.excludes = [ "home-manager/asahi/vencord.nix" ];
}; };
} }

View file

@ -22,7 +22,7 @@ in
secrets = { secrets = {
openrouter_api_key = { }; openrouter_api_key = { };
}; };
defaultSopsFile = ../../../sops/secrets.yaml; defaultSopsFile = ../../sops/secrets.yaml;
age.keyFile = /home/${username}/.config/sops/age/keys.txt; age.keyFile = /home/${username}/.config/sops/age/keys.txt;
}; };
# https://nix.catppuccin.com/search/rolling/ # https://nix.catppuccin.com/search/rolling/

View file

@ -3,43 +3,14 @@
# SPDX-License-Identifier: MIT # SPDX-License-Identifier: MIT
{ inputs, withSystem, ... }: { inputs, withSystem, ... }:
let
entries = builtins.attrNames (builtins.readDir ./.);
modules = builtins.filter (dir: builtins.pathExists (./. + "/${dir}/default.nix")) entries;
in
{ {
imports = [ imports = [
inputs.home-manager.flakeModules.home-manager inputs.home-manager.flakeModules.home-manager
./profiles ] ++ builtins.map (name: (./. + "/${name}")) modules;
];
# https://nix-community.github.io/home-manager/options.xhtml
# flake.homeConfigurations = {
# asahi = withSystem "aarch64-linux" (
# { pkgs, ... }:
# inputs.home-manager.lib.homeManagerConfiguration {
# inherit pkgs;
# extraSpecialArgs = { inherit inputs pkgs; };
# modules = [
# { nixpkgs.overlays = [ inputs.nur.overlays.default ]; }
# inputs.lix-module.nixosModules.default
# inputs.sops-nix.homeManagerModules.sops
# inputs.stylix.homeModules.stylix
# inputs.catppuccin.homeModules.catppuccin
# ./home.nix
# ];
# }
# );
# raspi = withSystem "aarch64-linux" (
# { pkgs, ... }:
# inputs.home-manager.lib.homeHamagerConfiguration {
# inherit pkgs;
# extraSpecialArgs = { inherit inputs pkgs; };
# modules = [
# inputs.lix-module.nixosModules.default
# inputs.sops-nix.homeManagerModules.sops
# inputs.stylix.homeModules.stylix
# inputs.catppuccin.homeModules.catppuccin
# ./home.nix
# ];
# }
# );
# };
perSystem = perSystem =
{ config, system, ... }: { config, system, ... }:
let let
@ -54,14 +25,29 @@
{ {
_module.args.pkgs = pkgs; _module.args.pkgs = pkgs;
devshells.default = { devshells.default = {
commands = [ commands =
[
{ {
help = "󰘥 show home-manager documentation"; help = "󰘥 show home-manager documentation";
name = "man-home"; name = "man-home";
command = "${pkgs.man}/bin/man home-configuration.nix"; command = "${pkgs.man}/bin/man home-configuration.nix";
category = " home-manager"; category = " home-manager";
} }
]; ]
++ builtins.concatMap (name: [
{
help = " `home-manager switch` for ${name}";
name = "hm-${name}";
command = "${pkgs.home-manager}/bin/home-manager switch --flake .#${name}";
category = " home-manager (${name})";
}
{
help = "󰸨 `home-manager switch` for ${name} with backup";
name = "hm-${name}-backup";
command = "${pkgs.home-manager}/bin/home-manager switch --flake .#${name} -b backup";
category = " home-manager (${name})";
}
]) modules;
packages = [ pkgs.home-manager ]; packages = [ pkgs.home-manager ];
}; };
}; };

View file

@ -1,30 +0,0 @@
# SPDX-FileCopyrightText: 2025 Ethan Reece <contact@ethanreece.com>
#
# SPDX-License-Identifier: MIT
{ ... }:
let
entries = builtins.attrNames (builtins.readDir ./.);
modules = builtins.filter (dir: builtins.pathExists (./. + "/${dir}/default.nix")) entries;
in
{
imports = builtins.map (name: (./. + "/${name}")) modules;
perSystem =
{ config, pkgs, ... }:
{
devshells.default.commands = builtins.concatMap (name: [
{
help = " `home-manager switch` for ${name}";
name = "hm-${name}";
command = "${pkgs.home-manager}/bin/home-manager switch --flake .#${name}";
category = " home-manager (${name})";
}
{
help = "󰸨 `home-manager switch` for ${name} with backup";
name = "hm-${name}-backup";
command = "${pkgs.home-manager}/bin/home-manager switch --flake .#${name} -b backup";
category = " home-manager (${name})";
}
]) modules;
};
}