Move home-manager portion into separate module
This commit is contained in:
parent
fd987fc50a
commit
10d3dc205c
7 changed files with 89 additions and 54 deletions
1
.envrc
1
.envrc
|
@ -1,2 +1,3 @@
|
|||
watch_dir ./base
|
||||
watch_file ./home-manager/default.nix
|
||||
use flake
|
||||
|
|
68
flake.nix
68
flake.nix
|
@ -33,6 +33,7 @@
|
|||
treefmt-nix.url = "github:numtide/treefmt-nix";
|
||||
};
|
||||
outputs =
|
||||
# https://flake.parts/options/flake-parts.html
|
||||
inputs@{ flake-parts, ... }:
|
||||
flake-parts.lib.mkFlake { inherit inputs; } (
|
||||
{ withSystem, ... }:
|
||||
|
@ -40,62 +41,24 @@
|
|||
systems = [ "aarch64-linux" ];
|
||||
imports = [
|
||||
./base
|
||||
inputs.home-manager.flakeModules.home-manager
|
||||
./home-manager
|
||||
];
|
||||
flake = {
|
||||
# https://nix-community.github.io/home-manager/options.xhtml
|
||||
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/home.nix
|
||||
];
|
||||
}
|
||||
);
|
||||
};
|
||||
};
|
||||
perSystem =
|
||||
{ system, ... }:
|
||||
let
|
||||
pkgs = import inputs.nixpkgs {
|
||||
inherit system;
|
||||
overlays = [
|
||||
inputs.nur.overlays.default
|
||||
inputs.nixgl.overlays.default
|
||||
];
|
||||
};
|
||||
in
|
||||
{ pkgs, system, ... }:
|
||||
# let
|
||||
# pkgs = import inputs.nixpkgs {
|
||||
# inherit system;
|
||||
# overlays = [
|
||||
# inputs.nur.overlays.default
|
||||
# inputs.nixgl.overlays.default
|
||||
# ];
|
||||
# };
|
||||
# in
|
||||
{
|
||||
_module.args.pkgs = pkgs;
|
||||
# _module.args.pkgs = pkgs;
|
||||
# https://flake.parts/options/devshell.html
|
||||
devshells.default = {
|
||||
commands = [
|
||||
{
|
||||
help = " `home-manager switch` for asahi";
|
||||
name = "hm-asahi";
|
||||
command = "${pkgs.home-manager}/bin/home-manager switch --flake .#asahi";
|
||||
category = " home-manager (Asahi)";
|
||||
}
|
||||
{
|
||||
help = " `home-manager switch` for asahi with backup";
|
||||
name = "hm-asahi-backup";
|
||||
command = "${pkgs.home-manager}/bin/home-manager switch --flake .#asahi -b backup";
|
||||
category = " home-manager (Asahi)";
|
||||
}
|
||||
{
|
||||
help = " show home-manager documentation";
|
||||
name = "man-home";
|
||||
command = "${pkgs.man}/bin/man home-configuration.nix";
|
||||
category = " home-manager";
|
||||
}
|
||||
{
|
||||
help = " generate age key";
|
||||
name = "age-generate-key";
|
||||
|
@ -105,14 +68,13 @@
|
|||
{
|
||||
help = " edit secrets.yaml";
|
||||
name = "sops-edit";
|
||||
command = "${pkgs.sops}/bin/sops edit ./home/secrets/secrets.yaml";
|
||||
command = "${pkgs.sops}/bin/sops edit ./home-manager/secrets/secrets.yaml";
|
||||
category = " SOPS";
|
||||
}
|
||||
];
|
||||
packages = [
|
||||
pkgs.age
|
||||
pkgs.forgejo-cli
|
||||
pkgs.home-manager
|
||||
pkgs.sops
|
||||
];
|
||||
devshell = {
|
||||
|
@ -123,8 +85,6 @@
|
|||
name = "Laptop Configuration";
|
||||
};
|
||||
};
|
||||
pre-commit.settings.excludes = [ "home/vencord.nix" ];
|
||||
treefmt.settings.global.excludes = [ "home/vencord.nix" ];
|
||||
};
|
||||
}
|
||||
);
|
||||
|
|
74
home-manager/default.nix
Normal file
74
home-manager/default.nix
Normal file
|
@ -0,0 +1,74 @@
|
|||
{
|
||||
flake-parts-lib,
|
||||
inputs,
|
||||
withSystem,
|
||||
...
|
||||
}:
|
||||
{
|
||||
imports = [ inputs.home-manager.flakeModules.home-manager ];
|
||||
options = {
|
||||
perSystem = flake-parts-lib.mkPerSystemOption (
|
||||
{ config, system, ... }:
|
||||
{
|
||||
config =
|
||||
let
|
||||
pkgs = import inputs.nixpkgs {
|
||||
inherit system;
|
||||
overlays = [
|
||||
inputs.nur.overlays.default
|
||||
inputs.nixgl.overlays.default
|
||||
];
|
||||
};
|
||||
in
|
||||
{
|
||||
_module.args.pkgs = pkgs;
|
||||
devshells.default = {
|
||||
commands = [
|
||||
{
|
||||
help = " `home-manager switch` for asahi";
|
||||
name = "hm-asahi";
|
||||
command = "${pkgs.home-manager}/bin/home-manager switch --flake .#asahi";
|
||||
category = " home-manager (Asahi)";
|
||||
}
|
||||
{
|
||||
help = " `home-manager switch` for asahi with backup";
|
||||
name = "hm-asahi-backup";
|
||||
command = "${pkgs.home-manager}/bin/home-manager switch --flake .#asahi -b backup";
|
||||
category = " home-manager (Asahi)";
|
||||
}
|
||||
{
|
||||
help = " show home-manager documentation";
|
||||
name = "man-home";
|
||||
command = "${pkgs.man}/bin/man home-configuration.nix";
|
||||
category = " home-manager";
|
||||
}
|
||||
];
|
||||
packages = [ pkgs.home-manager ];
|
||||
};
|
||||
pre-commit.settings.excludes = [ "home-manager/vencord.nix" ];
|
||||
treefmt.settings.global.excludes = [ "home-manager/vencord.nix" ];
|
||||
};
|
||||
}
|
||||
);
|
||||
};
|
||||
config = {
|
||||
# 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
|
||||
];
|
||||
}
|
||||
);
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Reference in a new issue