refactor to fix dependency on 'osConfig' arg
This commit is contained in:
11 files changed
+86
-55
No files matched your search
@@ -6,26 +6,26 @@
|
|||||||
];
|
];
|
||||||
|
|
||||||
programs.noctalia.enable = true;
|
programs.noctalia.enable = true;
|
||||||
|
|
||||||
|
home-manager.sharedModules = [
|
||||||
|
{
|
||||||
|
home.activation = {
|
||||||
|
symlinkNoctaliaState = lib.hm.dag.entryAfter ["writeBoundary"] (config.helpers.mkSymlinkActivationScript {
|
||||||
|
target = ".local/state/noctalia/settings.toml";
|
||||||
|
source = "dotfiles/${config.info.hostName}/noctalia/settings.toml";
|
||||||
|
});
|
||||||
|
|
||||||
|
symlinkNoctaliaStatePlugins = lib.hm.dag.entryAfter ["writeBoundary"] (config.helpers.mkSymlinkActivationScript {
|
||||||
|
target = ".local/state/noctalia/plugins";
|
||||||
|
source = "dotfiles/${config.info.hostName}/noctalia/plugins";
|
||||||
|
isDir = true;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
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";
|
||||||
|
}
|
||||||
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
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.activation = {
|
|
||||||
symlinkNoctaliaState = lib.hm.dag.entryAfter ["writeBoundary"] (config.helpers.mkSymlinkActivationScript {
|
|
||||||
target = ".local/state/noctalia/settings.toml";
|
|
||||||
source = "dotfiles/${config.info.hostName}/noctalia/settings.toml";
|
|
||||||
});
|
|
||||||
|
|
||||||
symlinkNoctaliaStatePlugins = lib.hm.dag.entryAfter ["writeBoundary"] (config.helpers.mkSymlinkActivationScript {
|
|
||||||
target = ".local/state/noctalia/plugins";
|
|
||||||
source = "dotfiles/${config.info.hostName}/noctalia/plugins";
|
|
||||||
isDir = true;
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
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 @@
|
|||||||
}
|
}
|
||||||
));
|
));
|
||||||
};
|
};
|
||||||
|
|
||||||
|
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";
|
||||||
|
});
|
||||||
|
}
|
||||||
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
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.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, ... }: {
|
{ 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";
|
options.features.applications.gui.floorp.enable = lib.mkEnableOption "floorp";
|
||||||
|
|
||||||
config = lib.mkIf (config.features.applications.gui.floorp.enable) (
|
config = lib.mkIf (config.features.applications.gui.floorp.enable) (
|
||||||
let
|
let
|
||||||
firefox-addons = with pkgs; inputs.firefox-addons.packages.${system};
|
firefox-addons = with pkgs; inputs.firefox-addons.packages.${system};
|
||||||
in {
|
in {
|
||||||
stylix.targets.floorp.profileNames = [ "default" ];
|
|
||||||
|
|
||||||
programs.floorp = {
|
programs.floorp = {
|
||||||
enable = true;
|
enable = true;
|
||||||
nativeMessagingHosts = [
|
nativeMessagingHosts = [
|
||||||
|
|||||||
@@ -1,10 +1,16 @@
|
|||||||
{ inputs, self, ... }: {
|
{ inputs, self, ... }: {
|
||||||
flake.nixosModules.graphics = { pkgs, config, lib, ... }: {
|
flake.nixosModules.graphics = { pkgs, config, lib, ... }: {
|
||||||
options.features.applications.gui.kitty.enable = lib.mkEnableOption "kitty";
|
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, ... }: {
|
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) {
|
config = lib.mkIf (config.features.applications.gui.kitty.enable) {
|
||||||
programs.kitty = {
|
programs.kitty = {
|
||||||
|
|||||||
@@ -16,11 +16,17 @@
|
|||||||
enable = true;
|
enable = true;
|
||||||
terminal = "kitty";
|
terminal = "kitty";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
home-manager.sharedModules = [
|
||||||
|
{
|
||||||
|
features.applications.gui.nautilus.enable = true;
|
||||||
|
}
|
||||||
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
flake.homeModules.graphics = { pkgs, osConfig, config, lib, ... }: {
|
flake.homeModules.graphics = { pkgs, config, lib, ... }: {
|
||||||
options.features.applications.gui.nautilus.enable = lib.mkOption (config.helpers.inheritOsConfigToHome "features.applications.gui.nautilus.enable");
|
options.features.applications.gui.nautilus.enable = lib.mkEnableOption "nautilus";
|
||||||
|
|
||||||
config = lib.mkIf (config.features.applications.gui.nautilus.enable) {
|
config = lib.mkIf (config.features.applications.gui.nautilus.enable) {
|
||||||
gtk.gtk3.bookmarks = [
|
gtk.gtk3.bookmarks = [
|
||||||
|
|||||||
@@ -1,10 +1,16 @@
|
|||||||
{ inputs, self, ... }: {
|
{ inputs, self, ... }: {
|
||||||
flake.nixosModules.graphics = { config, pkgs, lib, ... }: {
|
flake.nixosModules.graphics = { config, pkgs, lib, ... }: {
|
||||||
options.features.applications.gui.vscode.enable = lib.mkEnableOption "vscode";
|
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, ... }: {
|
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) {
|
config = lib.mkIf (config.features.applications.gui.vscode.enable) {
|
||||||
home.packages = [ pkgs.vscode ];
|
home.packages = [ pkgs.vscode ];
|
||||||
|
|||||||
@@ -9,16 +9,23 @@
|
|||||||
programs.zsh.enable = true;
|
programs.zsh.enable = true;
|
||||||
users.defaultUserShell = pkgs.zsh;
|
users.defaultUserShell = pkgs.zsh;
|
||||||
users.users."grey".shell = 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 = {
|
options.features.shells.zsh = {
|
||||||
enable = lib.mkEnableOption "zsh";
|
enable = lib.mkEnableOption "zsh";
|
||||||
antidote.enable = lib.mkEnableOption "antidote";
|
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;
|
home.shell.enableZshIntegration = true;
|
||||||
|
|
||||||
programs.kitty.shellIntegration.enableZshIntegration = true;
|
programs.kitty.shellIntegration.enableZshIntegration = true;
|
||||||
@@ -26,7 +33,7 @@
|
|||||||
programs.zsh = {
|
programs.zsh = {
|
||||||
enable = true;
|
enable = true;
|
||||||
completionInit = "";
|
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;
|
enable = true;
|
||||||
plugins = [
|
plugins = [
|
||||||
"getantidote/use-omz"
|
"getantidote/use-omz"
|
||||||
|
|||||||
@@ -31,7 +31,7 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
flake.homeModules.global = { pkgs, config, osConfig, lib, ... }: {
|
flake.homeModules.global = { pkgs, config, lib, ... }: {
|
||||||
options.helpers = {
|
options.helpers = {
|
||||||
mkSymlinkActivationScript = lib.mkOption {
|
mkSymlinkActivationScript = lib.mkOption {
|
||||||
type = lib.types.functionTo lib.types.str;
|
type = lib.types.functionTo lib.types.str;
|
||||||
@@ -43,18 +43,6 @@
|
|||||||
'';
|
'';
|
||||||
readOnly = true;
|
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, ... }: {
|
{ inputs, self, ... }: {
|
||||||
flake.homeModules.global = { config, pkgs, osConfig, ... }: {
|
flake.homeModules.global = { config, pkgs, ... }: {
|
||||||
nix.gc = {
|
nix.gc = {
|
||||||
automatic = true;
|
automatic = true;
|
||||||
persistent = true;
|
persistent = true;
|
||||||
dates = "Sun 05:00";
|
dates = "Sun 05:00";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
nixpkgs.config.allowUnfree = true;
|
||||||
|
|
||||||
home = {
|
home = {
|
||||||
stateVersion = config.info.stateVersion;
|
stateVersion = config.info.stateVersion;
|
||||||
|
|
||||||
packages = with pkgs; [
|
packages = with pkgs; [
|
||||||
speedtest-go
|
speedtest-go
|
||||||
] ++ config.features.applications.extraPackages
|
] ++ config.features.applications.extraPackages
|
||||||
++ (if !(builtins.tryEval osConfig).success then [
|
++ (if config.info.isStandalone then [
|
||||||
pkgs.home-manager
|
pkgs.home-manager
|
||||||
] else []);
|
] else []);
|
||||||
|
|
||||||
@@ -24,7 +26,7 @@
|
|||||||
|
|
||||||
xdg = {
|
xdg = {
|
||||||
enable = true;
|
enable = true;
|
||||||
localBinInPath = !(builtins.tryEval osConfig).success;
|
localBinInPath = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
programs = {
|
programs = {
|
||||||
|
|||||||
@@ -49,6 +49,11 @@
|
|||||||
type = lib.types.str;
|
type = lib.types.str;
|
||||||
default = "";
|
default = "";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
isStandalone = lib.mkOption {
|
||||||
|
type = lib.types.bool;
|
||||||
|
default = false;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
features.applications.extraPackages = lib.mkOption {
|
features.applications.extraPackages = lib.mkOption {
|
||||||
|
|||||||
@@ -13,6 +13,7 @@
|
|||||||
rootPath = "/home/grey/flake";
|
rootPath = "/home/grey/flake";
|
||||||
hostName = "takamaki";
|
hostName = "takamaki";
|
||||||
stateVersion = "26.11";
|
stateVersion = "26.11";
|
||||||
|
isStandalone = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
features = {
|
features = {
|
||||||
@@ -26,6 +27,10 @@
|
|||||||
fastfetch.enable = true;
|
fastfetch.enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
gui = {
|
||||||
|
vscode.enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
extraPackages = with pkgs; [
|
extraPackages = with pkgs; [
|
||||||
(writeShellScriptBin "switch-os" ''
|
(writeShellScriptBin "switch-os" ''
|
||||||
sudo efibootmgr --bootnext 0000
|
sudo efibootmgr --bootnext 0000
|
||||||
|
|||||||
Reference in new issue
Block a user