refactor to fix dependency on 'osConfig' arg
This commit is contained in:
11 files changed
+67
-36
No files matched your search
@@ -6,11 +6,9 @@
|
||||
];
|
||||
|
||||
programs.noctalia.enable = true;
|
||||
};
|
||||
};
|
||||
|
||||
flake.homeModules.graphics = { lib, pkgs, osConfig, config, ... }: {
|
||||
config = lib.mkIf (builtins.tryEval osConfig).success (lib.mkIf ((osConfig.components.shells == "noctalia")||(builtins.elem "noctalia" osConfig.components.shells)) {
|
||||
home-manager.sharedModules = [
|
||||
{
|
||||
home.activation = {
|
||||
symlinkNoctaliaState = lib.hm.dag.entryAfter ["writeBoundary"] (config.helpers.mkSymlinkActivationScript {
|
||||
target = ".local/state/noctalia/settings.toml";
|
||||
@@ -26,6 +24,8 @@
|
||||
|
||||
xdg.configFile."noctalia/settings.toml".source = "${self}/dotfiles/${config.info.hostName}/noctalia/settings.toml";
|
||||
xdg.configFile."noctalia/plugins".source = "${self}/dotfiles/${config.info.hostName}/noctalia/plugins";
|
||||
});
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -36,15 +36,15 @@
|
||||
}
|
||||
));
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
flake.homeModules.graphics = { lib, osConfig, config, ... }: {
|
||||
config = lib.mkIf (builtins.tryEval osConfig).success (lib.mkIf ((osConfig.components.windowManagers == "niri")||(builtins.elem "niri" osConfig.components.windowManagers)) {
|
||||
home-manager.sharedModules = [
|
||||
{
|
||||
home.activation.symlinkNiriConfig = lib.hm.dag.entryAfter ["writeBoundary"] (config.helpers.mkSymlinkActivationScript {
|
||||
target = ".config/niri/config.kdl";
|
||||
source = "dotfiles/${config.info.hostName}/niri.kdl";
|
||||
});
|
||||
});
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,13 +1,19 @@
|
||||
{ inputs, self, ... }: {
|
||||
flake.homeModules.graphics = { pkgs, lib, config, osConfig, ... }: {
|
||||
flake.nixosModules.graphics = { pkgs, lib, config, ... }: {
|
||||
home-manager.sharedModules = lib.mkIf (config.features.nixos.stylix.enable) [
|
||||
({ config, lib, ... }: {
|
||||
stylix.targets.floorp.profileNames = lib.mkIf (config.features.applications.gui.floorp.enable) [ "default" ];
|
||||
})
|
||||
];
|
||||
};
|
||||
|
||||
flake.homeModules.graphics = { pkgs, lib, config, ... }: {
|
||||
options.features.applications.gui.floorp.enable = lib.mkEnableOption "floorp";
|
||||
|
||||
config = lib.mkIf (config.features.applications.gui.floorp.enable) (
|
||||
let
|
||||
firefox-addons = with pkgs; inputs.firefox-addons.packages.${system};
|
||||
in {
|
||||
stylix.targets.floorp.profileNames = [ "default" ];
|
||||
|
||||
programs.floorp = {
|
||||
enable = true;
|
||||
nativeMessagingHosts = [
|
||||
|
||||
@@ -1,10 +1,16 @@
|
||||
{ inputs, self, ... }: {
|
||||
flake.nixosModules.graphics = { pkgs, config, lib, ... }: {
|
||||
options.features.applications.gui.kitty.enable = lib.mkEnableOption "kitty";
|
||||
|
||||
config.home-manager.sharedModules = lib.mkIf (config.features.applications.gui.kitty.enable) [
|
||||
{
|
||||
features.applications.gui.kitty.enable = true;
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
flake.homeModules.graphics = { pkgs, config, lib, ... }: {
|
||||
options.features.applications.gui.kitty.enable = lib.mkOption (config.helpers.inheritOsConfigToHome "features.applications.gui.kitty.enable");
|
||||
options.features.applications.gui.kitty.enable = lib.mkEnableOption "kitty";
|
||||
|
||||
config = lib.mkIf (config.features.applications.gui.kitty.enable) {
|
||||
programs.kitty = {
|
||||
|
||||
@@ -16,11 +16,17 @@
|
||||
enable = true;
|
||||
terminal = "kitty";
|
||||
};
|
||||
|
||||
home-manager.sharedModules = [
|
||||
{
|
||||
features.applications.gui.nautilus.enable = true;
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
flake.homeModules.graphics = { pkgs, osConfig, config, lib, ... }: {
|
||||
options.features.applications.gui.nautilus.enable = lib.mkOption (config.helpers.inheritOsConfigToHome "features.applications.gui.nautilus.enable");
|
||||
flake.homeModules.graphics = { pkgs, config, lib, ... }: {
|
||||
options.features.applications.gui.nautilus.enable = lib.mkEnableOption "nautilus";
|
||||
|
||||
config = lib.mkIf (config.features.applications.gui.nautilus.enable) {
|
||||
gtk.gtk3.bookmarks = [
|
||||
|
||||
@@ -1,10 +1,16 @@
|
||||
{ inputs, self, ... }: {
|
||||
flake.nixosModules.graphics = { config, pkgs, lib, ... }: {
|
||||
options.features.applications.gui.vscode.enable = lib.mkEnableOption "vscode";
|
||||
|
||||
config.home-manager.sharedModules = lib.mkIf (config.features.applications.gui.vscode.enable) [
|
||||
{
|
||||
features.applications.gui.vscode.enable = true;
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
flake.homeModules.graphics = { config, pkgs, lib, ... }: {
|
||||
options.features.applications.gui.vscode.enable = lib.mkOption (config.helpers.inheritOsConfigToHome "features.applications.gui.vscode.enable");
|
||||
options.features.applications.gui.vscode.enable = lib.mkEnableOption "vscode";
|
||||
|
||||
config = lib.mkIf (config.features.applications.gui.vscode.enable) {
|
||||
home.packages = [ pkgs.vscode ];
|
||||
|
||||
@@ -9,16 +9,23 @@
|
||||
programs.zsh.enable = true;
|
||||
users.defaultUserShell = pkgs.zsh;
|
||||
users.users."grey".shell = pkgs.zsh;
|
||||
|
||||
home-manager.sharedModules = [
|
||||
{
|
||||
features.shells.zsh.enable = true;
|
||||
features.shells.zsh.antidote.enable = lib.mkIf (config.features.shells.zsh.antidote.enable) true;
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
flake.homeModules.global = { pkgs, osConfig, config, lib, ... }: {
|
||||
flake.homeModules.global = { pkgs, config, lib, ... }: {
|
||||
options.features.shells.zsh = {
|
||||
enable = lib.mkEnableOption "zsh";
|
||||
antidote.enable = lib.mkEnableOption "antidote";
|
||||
};
|
||||
|
||||
config = (if (builtins.tryEval osConfig).success then (lib.mkIf (osConfig.features.shells.zsh.enable || config.features.shells.zsh.enable)) else (lib.mkIf (config.features.shells.zsh.enable))) {
|
||||
config = lib.mkIf (config.features.shells.zsh.enable) {
|
||||
home.shell.enableZshIntegration = true;
|
||||
|
||||
programs.kitty.shellIntegration.enableZshIntegration = true;
|
||||
@@ -26,7 +33,7 @@
|
||||
programs.zsh = {
|
||||
enable = true;
|
||||
completionInit = "";
|
||||
antidote = (if (builtins.tryEval osConfig).success then (lib.mkIf (osConfig.features.shells.zsh.antidote.enable || config.features.shells.zsh.antidote.enable)) else (lib.mkIf (config.features.shells.zsh.antidote.enable))) {
|
||||
antidote = lib.mkIf (config.features.shells.zsh.antidote.enable) {
|
||||
enable = true;
|
||||
plugins = [
|
||||
"getantidote/use-omz"
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
rootPath = "/home/grey/flake";
|
||||
hostName = "takamaki";
|
||||
stateVersion = "26.11";
|
||||
isStandalone = true;
|
||||
};
|
||||
|
||||
features = {
|
||||
@@ -26,6 +27,10 @@
|
||||
fastfetch.enable = true;
|
||||
};
|
||||
|
||||
gui = {
|
||||
vscode.enable = true;
|
||||
};
|
||||
|
||||
extraPackages = with pkgs; [
|
||||
(writeShellScriptBin "switch-os" ''
|
||||
sudo efibootmgr --bootnext 0000
|
||||
|
||||
Reference in new issue
Block a user