home: init
This commit is contained in:
parent
3a57a0dee7
commit
d9c7ea6255
3 changed files with 58 additions and 0 deletions
56
home/default.nix
Normal file
56
home/default.nix
Normal file
|
@ -0,0 +1,56 @@
|
||||||
|
{
|
||||||
|
lib,
|
||||||
|
self,
|
||||||
|
self',
|
||||||
|
config,
|
||||||
|
inputs,
|
||||||
|
inputs',
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
inherit (lib.modules) mkIf mkDefault;
|
||||||
|
inherit (lib.attrsets) genAttrs;
|
||||||
|
inherit (lib.options) mkEnableOption;
|
||||||
|
in {
|
||||||
|
options.olympus.system.useHomeManager =
|
||||||
|
mkEnableOption "Whether to use home-manager or not"
|
||||||
|
// {
|
||||||
|
default = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf config.olympus.system.useHomeManager {
|
||||||
|
home-manager = {
|
||||||
|
verbose = true;
|
||||||
|
useUserPackages = true;
|
||||||
|
useGlobalPkgs = true;
|
||||||
|
backupFileExtension = "bak";
|
||||||
|
|
||||||
|
users = genAttrs config.olympus.system.users (name: ./${name});
|
||||||
|
|
||||||
|
extraSpecialArgs = {
|
||||||
|
inherit
|
||||||
|
self
|
||||||
|
self'
|
||||||
|
inputs
|
||||||
|
inputs'
|
||||||
|
;
|
||||||
|
};
|
||||||
|
|
||||||
|
# we should define grauntied common modules here
|
||||||
|
sharedModules = [
|
||||||
|
inputs.beapkgs.homeManagerModules.default
|
||||||
|
|
||||||
|
(self + /modules/home/default.nix)
|
||||||
|
|
||||||
|
{
|
||||||
|
home.stateVersion = config.system.stateVersion;
|
||||||
|
|
||||||
|
# reload system units when changing configs
|
||||||
|
systemd.user.startServices = mkDefault "sd-switch"; # or "legacy" if "sd-switch" breaks again
|
||||||
|
|
||||||
|
# let HM manage itself when in standalone mode
|
||||||
|
programs.home-manager.enable = true;
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
1
home/pingu/default.nix
Normal file
1
home/pingu/default.nix
Normal file
|
@ -0,0 +1 @@
|
||||||
|
{}
|
1
modules/home/default.nix
Normal file
1
modules/home/default.nix
Normal file
|
@ -0,0 +1 @@
|
||||||
|
{}
|
Loading…
Add table
Reference in a new issue