parent
b586b7d2b5
commit
dfc4bab334
|
@ -1,4 +1,15 @@
|
|||
{ config, pkgs, ... }:
|
||||
{ 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")
|
||||
|
@ -24,24 +35,11 @@
|
|||
home-manager.useGlobalPkgs = true;
|
||||
|
||||
home-manager.users.simon = { lib, pkgs, ... }: {
|
||||
# FIXME: those options are duplicates from the system configuration
|
||||
options.sbruder = {
|
||||
gui.enable = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = config.sbruder.gui.enable;
|
||||
description = "Whether to enable gui";
|
||||
};
|
||||
gui.enable = inheritOption "sbruder.gui.enable";
|
||||
unfree = {
|
||||
allowAssets = lib.mkOption {
|
||||
default = config.sbruder.unfree.allowAssets;
|
||||
type = lib.types.bool;
|
||||
description = "Allow restricted selection of unfree assets to be installed.";
|
||||
};
|
||||
allowSoftware = lib.mkOption {
|
||||
default = config.sbruder.unfree.allowSoftware;
|
||||
type = lib.types.bool;
|
||||
description = "Allow restricted selection of unfree software to be installed.";
|
||||
};
|
||||
allowAssets = inheritOption "sbruder.unfree.allowAssets";
|
||||
allowSoftware = inheritOption "sbruder.unfree.allowSoftware";
|
||||
};
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue