Unified home and system modules!

This commit is contained in:
marc
2022-11-19 11:58:21 +01:00
parent cfcc374a69
commit 890b05d352
45 changed files with 389 additions and 566 deletions

View File

@@ -6,12 +6,7 @@ with lib.my;
options = with types; {
user = mkOpt attrs {};
home = {
packages = mkOpt' (listOf package) [] "Packages to be installed at user level";
file = mkOpt' attrs {} "Files to place directly in $HOME" ;
configFile = mkOpt' attrs {} "Files to place in $XDG_CONFIG_HOME";
dataFile = mkOpt' attrs {} "Files to place in $XDG_DATA_HOME";
};
hm = mkOpt attrs {};
env = mkOption {
# env = { PATH = ["$PATH" ./test]; TEST = "test"; }
@@ -36,26 +31,6 @@ with lib.my;
uid = 1000;
};
home-manager = {
# extraSpecialArgs = { inherit inputs; };
useGlobalPkgs = true;
useUserPackages = true;
users.${config.user.name} = {
home = {
file = mkAliasDefinitions options.home.file;
packages = mkAliasDefinitions options.home.packages;
# Necessary for home-manager to work with flakes, otherwise it will
# look for a nixpkgs channel.
stateVersion = config.system.stateVersion;
};
xdg = {
configFile = mkAliasDefinitions options.home.configFile;
dataFile = mkAliasDefinitions options.home.dataFile;
};
};
};
users.users.${config.user.name} = mkAliasDefinitions options.user;
nix.settings = let users = [ "root" config.user.name ]; in {
@@ -63,6 +38,16 @@ with lib.my;
allowed-users = users;
};
hm.home.stateVersion = config.system.stateVersion;
home-manager = {
# extraSpecialArgs = { inherit inputs; };
useGlobalPkgs = true;
useUserPackages = true;
users.${config.user.name} = mkAliasDefinitions options.hm;
};
env.PATH = [ "$PATH" ];
environment.extraInit =