refactor to fix dependency on 'osConfig' arg
This commit is contained in:
11 files changed
+86
-55
No files matched your search
@@ -31,7 +31,7 @@
|
||||
};
|
||||
};
|
||||
|
||||
flake.homeModules.global = { pkgs, config, osConfig, lib, ... }: {
|
||||
flake.homeModules.global = { pkgs, config, lib, ... }: {
|
||||
options.helpers = {
|
||||
mkSymlinkActivationScript = lib.mkOption {
|
||||
type = lib.types.functionTo lib.types.str;
|
||||
@@ -43,18 +43,6 @@
|
||||
'';
|
||||
readOnly = true;
|
||||
};
|
||||
|
||||
inheritOsConfigToHome = lib.mkOption {
|
||||
type = lib.types.functionTo lib.types.attrs;
|
||||
default = let
|
||||
safeOsConfig = builtins.tryEval osConfig;
|
||||
in option: {
|
||||
type = if safeOsConfig.success then safeOsConfig.value.helpers.attrByStrPath (safeOsConfig.value.helpers.typeOf (safeOsConfig.value.helpers.attrByStrPath option safeOsConfig.value)) lib.types else null;
|
||||
default = (lib.mkIf (safeOsConfig.success) (safeOsConfig.value.helpers.attrByStrPath option safeOsConfig.value)).content;
|
||||
readOnly = true;
|
||||
};
|
||||
readOnly = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,18 +1,20 @@
|
||||
{ inputs, self, ... }: {
|
||||
flake.homeModules.global = { config, pkgs, osConfig, ... }: {
|
||||
flake.homeModules.global = { config, pkgs, ... }: {
|
||||
nix.gc = {
|
||||
automatic = true;
|
||||
persistent = true;
|
||||
dates = "Sun 05:00";
|
||||
};
|
||||
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
|
||||
home = {
|
||||
stateVersion = config.info.stateVersion;
|
||||
|
||||
packages = with pkgs; [
|
||||
speedtest-go
|
||||
] ++ config.features.applications.extraPackages
|
||||
++ (if !(builtins.tryEval osConfig).success then [
|
||||
++ (if config.info.isStandalone then [
|
||||
pkgs.home-manager
|
||||
] else []);
|
||||
|
||||
@@ -24,7 +26,7 @@
|
||||
|
||||
xdg = {
|
||||
enable = true;
|
||||
localBinInPath = !(builtins.tryEval osConfig).success;
|
||||
localBinInPath = true;
|
||||
};
|
||||
|
||||
programs = {
|
||||
|
||||
@@ -49,6 +49,11 @@
|
||||
type = lib.types.str;
|
||||
default = "";
|
||||
};
|
||||
|
||||
isStandalone = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
};
|
||||
};
|
||||
|
||||
features.applications.extraPackages = lib.mkOption {
|
||||
|
||||
Reference in new issue
Block a user