Simon Bruder
c1283b6ffa
Fixes #27 This adds the `sbruder.full` option (enabled by default), which disables some otherwise enabled packages/modules when disabled. When setting it to false on a full gui system it reduces the size of the system closure by over 50%. It is intended for systems with low (main) disk space.
54 lines
1.3 KiB
Nix
54 lines
1.3 KiB
Nix
{ config, options, pkgs, ... }:
|
||
let
|
||
# hacky way of inheriting a nixos option into home manager
|
||
inheritOption = name:
|
||
let
|
||
path = pkgs.lib.splitString "." name;
|
||
option = pkgs.lib.getAttrFromPath path options;
|
||
value = pkgs.lib.getAttrFromPath path config;
|
||
in
|
||
# setting `value` doesn’t work (always is default value in other modules)
|
||
option // { default = value; };
|
||
in
|
||
{
|
||
imports = [
|
||
(import "${(import ../../nix/sources.nix).home-manager}/nixos")
|
||
];
|
||
|
||
users.users.simon = {
|
||
isNormalUser = true;
|
||
extraGroups = [
|
||
"adbusers"
|
||
"dialout"
|
||
"libvirtd"
|
||
"lp"
|
||
"networkmanager"
|
||
"video"
|
||
"wheel"
|
||
];
|
||
openssh.authorizedKeys.keys = config.sbruder.pubkeys.trustedKeys;
|
||
initialPassword = "foobar"; # for vm
|
||
};
|
||
|
||
home-manager.useUserPackages = true;
|
||
home-manager.useGlobalPkgs = true;
|
||
|
||
home-manager.users.simon = { lib, pkgs, ... }: {
|
||
options.sbruder = {
|
||
full = inheritOption "sbruder.full";
|
||
gui.enable = inheritOption "sbruder.gui.enable";
|
||
games.enable = inheritOption "sbruder.games.enable";
|
||
unfree = {
|
||
allowAssets = inheritOption "sbruder.unfree.allowAssets";
|
||
allowSoftware = inheritOption "sbruder.unfree.allowSoftware";
|
||
};
|
||
};
|
||
|
||
imports = [ ./modules ];
|
||
|
||
config = {
|
||
home.stateVersion = "20.09";
|
||
};
|
||
};
|
||
}
|