create shared niri config, refactor generic feature modules
This commit is contained in:
23 files changed
+353
-410
No files matched your search
@@ -16,8 +16,6 @@
|
||||
flake.homeModules.graphics = { pkgs, config, lib, inputs, ... }: {
|
||||
config = lib.mkIf ((config.components.shells == "noctalia")||(builtins.elem "noctalia" config.components.shells)) {
|
||||
home = {
|
||||
packages = lib.mkIf (config.info.isStandalone) [ inputs.noctalia.packages.${pkgs.stdenv.hostPlatform.system}.default ];
|
||||
|
||||
activation = {
|
||||
linkNoctaliaState = lib.hm.dag.entryAfter ["writeBoundary"] (inputs.helpers.mkSymlinkActivationScript {
|
||||
target = "${config.home.homeDirectory}/.local/state/noctalia/settings.toml";
|
||||
|
||||
@@ -1,88 +1,66 @@
|
||||
{ inputs, self, ... }: {
|
||||
imports = [ ./niri.nix ];
|
||||
|
||||
flake.nixosModules.graphics = { config, pkgs, lib, ... }: {
|
||||
# override niri source to use https://github.com/barrulus/biri
|
||||
config = lib.mkIf (builtins.elem "biri" config.components.windowManagers) {
|
||||
environment.systemPackages = with pkgs; [
|
||||
xdg-desktop-portal-gnome
|
||||
wl-clipboard
|
||||
libsecret
|
||||
cage
|
||||
wev
|
||||
qalculate-qt
|
||||
];
|
||||
|
||||
features.applications.gui.nautilus.enable = true;
|
||||
|
||||
services.upower.enable = true;
|
||||
|
||||
services.udisks2.enable = true;
|
||||
|
||||
programs.niri = {
|
||||
enable = true;
|
||||
useNautilus = true;
|
||||
# override niri source to use https://github.com/barrulus/biri
|
||||
package = self.packages.${pkgs.stdenv.hostPlatform.system}.biri;
|
||||
};
|
||||
programs.niri.package = self.packages.${pkgs.stdenv.hostPlatform.system}.biri;
|
||||
|
||||
home-manager.users.${config.info.userName} = lib.mkIf (config.features.nixos.home-manager.enable) {
|
||||
components.windowManagers = [ "niri" ];
|
||||
components.windowManagers = [ "biri" ];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
flake.homeModules.graphics = { config, pkgs, lib, inputs, ... }: {
|
||||
home = lib.mkIf ((config.components.windowManagers == "biri")||(builtins.elem "biri" config.components.windowManagers)) {
|
||||
activation.linkNiriConfig = lib.hm.dag.entryAfter ["writeBoundary"] (inputs.helpers.mkSymlinkActivationScript {
|
||||
target = "${config.xdg.configHome}/niri/config.kdl";
|
||||
source = "${config.info.rootPath}/dotfiles/${config.info.hostName}/niri.kdl";
|
||||
});
|
||||
};
|
||||
|
||||
features.applications.shellScripts = {
|
||||
niri-scratch-workspace-toggle = ''
|
||||
if niri msg --json workspaces-with-hidden | jq -e '.[] | select(.name=="x") | .is_hidden' >/dev/null; then
|
||||
niri msg action unhide-workspace --focus=false "x"
|
||||
OUTPUT=$(niri msg --json focused-output | jq '.name' | sed 's/"//g')
|
||||
niri msg action move-workspace-to-monitor --reference "x" "$OUTPUT"
|
||||
niri msg action focus-workspace "x"
|
||||
else
|
||||
niri msg action hide-workspace "x"
|
||||
fi
|
||||
'';
|
||||
|
||||
niri-listen-for-scratch-workspace-change = ''
|
||||
niri msg --json event-stream | while read -r event; do
|
||||
if echo $event | jq -e '.WorkspaceActivated.focused' >/dev/null; then
|
||||
if niri msg --json workspaces | jq -e '.[] | select(.name=="x") | .is_active==false' >/dev/null; then
|
||||
niri msg action hide-workspace "x"
|
||||
fi
|
||||
elif echo $event | jq -e '.WorkspacesChanged.workspaces.[] | select(.name=="x") | .is_active==false' >/dev/null; then
|
||||
config = lib.mkIf (builtins.elem "biri" config.components.windowManagers) {
|
||||
features.applications.shellScripts = {
|
||||
niri-scratch-workspace-toggle = ''
|
||||
if niri msg --json workspaces-with-hidden | jq -e '.[] | select(.name=="x") | .is_hidden' >/dev/null; then
|
||||
niri msg action unhide-workspace --focus=false "x"
|
||||
OUTPUT=$(niri msg --json focused-output | jq '.name' | sed 's/"//g')
|
||||
niri msg action move-workspace-to-monitor --reference "x" "$OUTPUT"
|
||||
niri msg action focus-workspace "x"
|
||||
else
|
||||
niri msg action hide-workspace "x"
|
||||
fi
|
||||
done
|
||||
'';
|
||||
'';
|
||||
|
||||
niri-toggle-dwt = ''
|
||||
niri msg action toggle-dwt
|
||||
cd ${config.xdg.stateHome}
|
||||
if [ -f ./niri.json ]; then
|
||||
if jq -e '.dwt' niri.json >/dev/null; then
|
||||
NEW_JSON=$(jq '.dwt = false' niri.json)
|
||||
echo "$NEW_JSON" > niri.json
|
||||
niri-listen-for-scratch-workspace-change = ''
|
||||
niri msg --json event-stream | while read -r event; do
|
||||
if echo $event | jq -e '.WorkspaceActivated.focused' >/dev/null; then
|
||||
if niri msg --json workspaces | jq -e '.[] | select(.name=="x") | .is_active==false' >/dev/null; then
|
||||
niri msg action hide-workspace "x"
|
||||
fi
|
||||
elif echo $event | jq -e '.WorkspacesChanged.workspaces.[] | select(.name=="x") | .is_active==false' >/dev/null; then
|
||||
niri msg action hide-workspace "x"
|
||||
fi
|
||||
done
|
||||
'';
|
||||
|
||||
niri-toggle-dwt = ''
|
||||
niri msg action toggle-dwt
|
||||
cd ${config.xdg.stateHome}
|
||||
if [ -f ./niri.json ]; then
|
||||
if jq -e '.dwt' niri.json >/dev/null; then
|
||||
NEW_JSON=$(jq '.dwt = false' niri.json)
|
||||
echo "$NEW_JSON" > niri.json
|
||||
else
|
||||
NEW_JSON=$(jq '.dwt = true' niri.json)
|
||||
echo "$NEW_JSON" > niri.json
|
||||
fi
|
||||
else
|
||||
NEW_JSON=$(jq '.dwt = true' niri.json)
|
||||
echo "$NEW_JSON" > niri.json
|
||||
echo '{"dwt": false}' | jq '.' > niri.json
|
||||
fi
|
||||
else
|
||||
echo '{"dwt": false}' | jq '.' > niri.json
|
||||
fi
|
||||
NEW_STATE=$(jq '.dwt' niri.json)
|
||||
noctalia msg notification-show "Touchpad DWT toggled $NEW_STATE"
|
||||
'';
|
||||
PRETTY_STATE=$(if jq -e '.dwt' niri.json >/dev/null; then echo "on"; else echo "off"; fi)
|
||||
notify-send -e -a "niri-toggle-dwt script" "Toggled DWT $PRETTY_STATE"
|
||||
'';
|
||||
|
||||
niri-clear-state = ''
|
||||
cd ${config.xdg.stateHome}
|
||||
rm niri.json
|
||||
'';
|
||||
niri-clear-state = ''
|
||||
cd ${config.xdg.stateHome}
|
||||
rm niri.json
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
{ inputs, self, ... }: {
|
||||
flake.nixosModules.graphics = { config, pkgs, lib, ... }: {
|
||||
config = lib.mkIf (builtins.elem "niri" config.components.windowManagers) {
|
||||
config = lib.mkIf (builtins.elem "niri" config.components.windowManagers || builtins.elem "biri" config.components.windowManagers) {
|
||||
environment.systemPackages = with pkgs; [
|
||||
xdg-desktop-portal-gnome
|
||||
wl-clipboard
|
||||
@@ -10,8 +10,6 @@
|
||||
qalculate-qt
|
||||
];
|
||||
|
||||
features.applications.gui.nautilus.enable = true;
|
||||
|
||||
services.upower.enable = true;
|
||||
|
||||
services.udisks2.enable = true;
|
||||
@@ -19,20 +17,6 @@
|
||||
programs.niri = {
|
||||
enable = true;
|
||||
useNautilus = true;
|
||||
# override niri source to use https://github.com/niri-wm/niri/pull/3642
|
||||
package = (pkgs.niri.overrideAttrs (finalAttrs: prevAttrs: {
|
||||
cargoHash = "sha256-HypBB3PL4nVFMNH2+jEK0+dG9dJ920nHi8GwRoeH/v4=";
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "niri-wm";
|
||||
repo = "niri";
|
||||
rev = "cb41d54703eef73883bb2be58e19bcf3715d777c";
|
||||
sha256 = "sha256-cLzTeMcCdQJ+kHGcOposjeheFyEG/tGOA1jFAORMHjI=";
|
||||
};
|
||||
cargoDeps = pkgs.rustPlatform.fetchCargoVendor {
|
||||
inherit (finalAttrs) pname src version;
|
||||
hash = finalAttrs.cargoHash;
|
||||
};
|
||||
}));
|
||||
};
|
||||
|
||||
home-manager.users.${config.info.userName} = lib.mkIf (config.features.nixos.home-manager.enable) {
|
||||
@@ -42,11 +26,18 @@
|
||||
};
|
||||
|
||||
flake.homeModules.graphics = { config, pkgs, lib, inputs, ... }: {
|
||||
home = lib.mkIf ((config.components.windowManagers == "niri")||(builtins.elem "niri" config.components.windowManagers)) {
|
||||
activation.linkNiriConfig = lib.hm.dag.entryAfter ["writeBoundary"] (inputs.helpers.mkSymlinkActivationScript {
|
||||
target = "${config.xdg.configHome}/niri/config.kdl";
|
||||
source = "${config.info.rootPath}/dotfiles/${config.info.hostName}/niri.kdl";
|
||||
});
|
||||
home = lib.mkIf (builtins.elem "niri" config.components.windowManagers || builtins.elem "biri" config.components.windowManagers) {
|
||||
activation = {
|
||||
linkNiriConfig = lib.hm.dag.entryAfter ["writeBoundary"] (inputs.helpers.mkSymlinkActivationScript {
|
||||
target = "${config.xdg.configHome}/niri/config.kdl";
|
||||
source = "${config.info.rootPath}/dotfiles/${config.info.hostName}/niri.kdl";
|
||||
});
|
||||
|
||||
linkSharedConfig = lib.hm.dag.entryAfter ["writeBoundary"] (inputs.helpers.mkSymlinkActivationScript {
|
||||
target = "${config.xdg.configHome}/niri/shared.kdl";
|
||||
source = "${config.info.rootPath}/dotfiles/shared/niri-shared.kdl";
|
||||
});
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
+1
-6
@@ -118,12 +118,7 @@ in {
|
||||
options.features.documentation = let
|
||||
defaultPort = "8080";
|
||||
in {
|
||||
enable = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
description = "Whether to enable documentation for the flake, generated with [Material for mkDocs](https://squidfunk.github.io/mkdocs-material/) and hosted by (containerised) nginx at localhost:${defaultPort} by default.";
|
||||
default = true;
|
||||
};
|
||||
|
||||
enable = lib.mkEnableOption "documentation for the flake, generated with [Material for mkDocs](https://squidfunk.github.io/mkdocs-material/) and hosted by (containerised) nginx at localhost:${defaultPort} by default.";
|
||||
port = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
description = "This option sets the port used by the nginx server hosting the local documentation site.";
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
{ inputs, self, lib, ... }: let
|
||||
featureOptionName = "features.applications.cli.color-converter.enable";
|
||||
moduleArgs = config: {
|
||||
inherit config;
|
||||
optionName = featureOptionName;
|
||||
};
|
||||
optionName = "features.applications.cli.color-converter.enable";
|
||||
|
||||
color-converter-package = { lib, pkgs }: pkgs.python3Packages.buildPythonApplication rec {
|
||||
pname = "color-converter";
|
||||
@@ -35,16 +31,16 @@
|
||||
};
|
||||
};
|
||||
in {
|
||||
imports = [ (inputs.helpers.mkStandardFeature.flakeModule "global" featureOptionName (lib.mkEnableOption "`color-converter`")) ];
|
||||
imports = [ (inputs.helpers.mkStandardFeature.flakeModule "global" optionName "`color-converter`") ];
|
||||
|
||||
flake.nixosModules.global = { pkgs, lib, config, ... }: {
|
||||
imports = [ (inputs.helpers.mkStandardFeature.nixosModule (moduleArgs config) {
|
||||
imports = [ (inputs.helpers.mkStandardFeature.nixosModule { inherit config optionName; } {
|
||||
environment.systemPackages = [ (pkgs.callPackage color-converter-package {}) ];
|
||||
}) ];
|
||||
};
|
||||
|
||||
flake.homeModules.global = { pkgs, config, lib, ... }: {
|
||||
imports = [ (inputs.helpers.mkStandardFeature.homeModule (moduleArgs config) {
|
||||
imports = [ (inputs.helpers.mkStandardFeature.homeModule { inherit config optionName; } {
|
||||
home.packages = [ (pkgs.callPackage color-converter-package {}) ];
|
||||
}) ];
|
||||
};
|
||||
|
||||
@@ -1,20 +1,18 @@
|
||||
{ inputs, self, ... }: {
|
||||
imports = [ (inputs.helpers.mkMirroredModulesFlakeModule "globalOptions" ({ lib, ... }: {
|
||||
options.features.applications.cli.fastfetch.enable = lib.mkEnableOption "`fastfetch`";
|
||||
})) ];
|
||||
{ inputs, self, ... }: let
|
||||
optionName = "features.applications.cli.fastfetch.enable";
|
||||
in {
|
||||
imports = [ (inputs.helpers.mkStandardFeature.flakeModule "global" optionName "`fastfetch`") ];
|
||||
|
||||
flake.nixosModules.global = { pkgs, lib, config, ... }: {
|
||||
config = lib.mkIf (config.features.applications.cli.fastfetch.enable) (inputs.helpers.mkIfElse (config.features.nixos.home-manager.enable) {
|
||||
home-manager.users.${config.info.userName}.features.applications.cli.fastfetch.enable = lib.mkDefault true;
|
||||
} {
|
||||
imports = [ (inputs.helpers.mkStandardFeature.nixosModule { inherit config optionName; } {
|
||||
environment.systemPackages = [ pkgs.fastfetch ];
|
||||
});
|
||||
}) ];
|
||||
};
|
||||
|
||||
flake.homeModules.global = { pkgs, lib, config, ... }: {
|
||||
config = lib.mkIf (config.features.applications.cli.fastfetch.enable) ({
|
||||
imports = [ (inputs.helpers.mkStandardFeature.homeModule { inherit config optionName; } {
|
||||
programs.zsh.initContent = lib.mkOrder 1500 "fastfetch";
|
||||
programs.fastfetch.enable = true;
|
||||
});
|
||||
}) ];
|
||||
};
|
||||
}
|
||||
@@ -14,7 +14,7 @@
|
||||
flake.homeModules.graphics = { pkgs, lib, config, ... }: {
|
||||
config = lib.mkIf (config.features.applications.gui.floorp.enable) (
|
||||
let
|
||||
firefox-addons = with pkgs; inputs.firefox-addons.packages.${pkgs.stdenv.hostPlatform.system};
|
||||
firefox-addons = inputs.firefox-addons.packages.${pkgs.stdenv.hostPlatform.system};
|
||||
in {
|
||||
programs.floorp = {
|
||||
enable = true;
|
||||
|
||||
@@ -63,39 +63,41 @@
|
||||
platforms = [ "x86_64-linux" ];
|
||||
};
|
||||
};
|
||||
optionName = "features.applications.gui.fluxer.enable";
|
||||
optionNameCanary = "features.applications.gui.fluxer-canary.enable";
|
||||
in {
|
||||
imports = [ (inputs.helpers.mkMirroredModulesFlakeModule "graphicsOptions" ({ lib, ... }: {
|
||||
options.features.applications.gui = {
|
||||
fluxer.enable = lib.mkEnableOption "Fluxer";
|
||||
fluxer-canary.enable = lib.mkEnableOption "Fluxer Canary";
|
||||
};
|
||||
})) ];
|
||||
imports = [
|
||||
(inputs.helpers.mkStandardFeature.flakeModule "graphics" optionName "Fluxer")
|
||||
(inputs.helpers.mkStandardFeature.flakeModule "graphics" optionNameCanary "Fluxer Canary")
|
||||
];
|
||||
|
||||
flake.nixosModules.graphics = { pkgs, config, lib, ... }: {
|
||||
config = lib.mkIf (config.features.applications.gui.fluxer.enable) (inputs.helpers.mkIfElse (config.features.nixos.home-manager.enable) {
|
||||
home-manager.users.${config.info.userName}.features.applications.gui.fluxer.enable = lib.mkDefault true;
|
||||
} {
|
||||
environment.systemPackages = [
|
||||
(pkgs.callPackage (fluxer-package) {})
|
||||
];
|
||||
}) // lib.mkIf (config.features.applications.gui.fluxer-canary.enable) (inputs.helpers.mkIfElse (config.features.nixos.home-manager.enable) {
|
||||
home-manager.users.${config.info.userName}.features.applications.gui.fluxer-canary.enable = lib.mkDefault true;
|
||||
} {
|
||||
environment.systemPackages = [
|
||||
(pkgs.callPackage (fluxer-canary-package) {})
|
||||
];
|
||||
});
|
||||
imports = [
|
||||
(inputs.helpers.mkStandardFeature.nixosModule { inherit config optionName; } {
|
||||
environment.systemPackages = [
|
||||
(pkgs.callPackage (fluxer-package) {})
|
||||
];
|
||||
})
|
||||
(inputs.helpers.mkStandardFeature.nixosModule { inherit config; optionName = optionNameCanary; } {
|
||||
environment.systemPackages = [
|
||||
(pkgs.callPackage (fluxer-canary-package) {})
|
||||
];
|
||||
})
|
||||
];
|
||||
};
|
||||
|
||||
flake.homeModules.graphics = { pkgs, config, lib, ... }: {
|
||||
config = lib.mkIf (config.features.applications.gui.fluxer.enable) {
|
||||
home.packages = [
|
||||
(pkgs.callPackage (fluxer-package) {})
|
||||
];
|
||||
} // lib.mkIf (config.features.applications.gui.fluxer-canary.enable) {
|
||||
home.packages = [
|
||||
(pkgs.callPackage (fluxer-canary-package) {})
|
||||
];
|
||||
};
|
||||
imports = [
|
||||
(inputs.helpers.mkStandardFeature.homeModule { inherit config optionName; } {
|
||||
home.packages = [
|
||||
(pkgs.callPackage (fluxer-package) {})
|
||||
];
|
||||
})
|
||||
(inputs.helpers.mkStandardFeature.homeModule { inherit config; optionName = optionNameCanary; } {
|
||||
home.packages = [
|
||||
(pkgs.callPackage (fluxer-canary-package) {})
|
||||
];
|
||||
})
|
||||
];
|
||||
};
|
||||
}
|
||||
@@ -1,25 +1,21 @@
|
||||
{ inputs, self, ... }: {
|
||||
imports = [ (inputs.helpers.mkMirroredModulesFlakeModule "graphicsOptions" ({ lib, ... }: {
|
||||
options.features.applications.gui.kitty.enable = lib.mkEnableOption "Kitty Terminal";
|
||||
}))];
|
||||
{ inputs, self, ... }: let
|
||||
optionName = "features.applications.gui.kitty.enable";
|
||||
in {
|
||||
imports = [ (inputs.helpers.mkStandardFeature.flakeModule "graphics" optionName "Kitty Terminal") ];
|
||||
|
||||
flake.nixosModules.graphics = { pkgs, config, lib, ... }: {
|
||||
config = let
|
||||
in lib.mkIf (config.features.applications.gui.kitty.enable) (inputs.helpers.mkIfElse (config.features.nixos.home-manager.enable) {
|
||||
home-manager.users.${config.info.userName}.features.applications.gui.kitty.enable = lib.mkDefault true;
|
||||
} {
|
||||
imports = [ (inputs.helpers.mkStandardFeature.nixosModule { inherit config optionName; } {
|
||||
environment.systemPackages = [ pkgs.kitty ];
|
||||
});
|
||||
}) ];
|
||||
};
|
||||
|
||||
flake.homeModules.graphics = { pkgs, config, lib, ... }: {
|
||||
config = lib.mkIf (config.features.applications.gui.kitty.enable) {
|
||||
imports = [ (inputs.helpers.mkStandardFeature.homeModule { inherit config optionName; } {
|
||||
programs.kitty = {
|
||||
enable = true;
|
||||
|
||||
shellIntegration.enableBashIntegration = true;
|
||||
enableGitIntegration = true;
|
||||
};
|
||||
};
|
||||
}) ];
|
||||
};
|
||||
}
|
||||
@@ -1,21 +1,19 @@
|
||||
{ inputs, self, ... }: {
|
||||
imports = [ (inputs.helpers.mkMirroredModulesFlakeModule "graphicsOptions" ({ lib, ... }: {
|
||||
options.features.applications.gui.remmina.enable = lib.mkEnableOption "Remmina";
|
||||
})) ];
|
||||
{ inputs, self, ... }: let
|
||||
optionName = "features.applications.gui.remmina.enable";
|
||||
in {
|
||||
imports = [ (inputs.helpers.mkStandardFeature.flakeModule "graphics" optionName "Remmina") ];
|
||||
|
||||
flake.nixosModules.graphics = { pkgs, config, lib, ... }: {
|
||||
config = lib.mkIf (config.features.applications.gui.remmina.enable) (inputs.helpers.mkIfElse (config.features.nixos.home-manager.enable) {
|
||||
home-manager.users.${config.info.userName}.features.applications.gui.remmina.enable = lib.mkDefault true;
|
||||
} {
|
||||
flake.nixosModules.graphics = { pkgs, config, lib, ... }: {
|
||||
imports = [ (inputs.helpers.mkStandardFeature.nixosModule { inherit config optionName; } {
|
||||
environment.systemPackages = with pkgs; [
|
||||
remmina
|
||||
freerdp
|
||||
];
|
||||
});
|
||||
}) ];
|
||||
};
|
||||
|
||||
flake.homeModules.graphics = { pkgs, config, lib, ... }: {
|
||||
config = lib.mkIf (config.features.applications.gui.remmina.enable) {
|
||||
imports = [ (inputs.helpers.mkStandardFeature.homeModule { inherit config optionName; } {
|
||||
home.packages = with pkgs; [
|
||||
remmina
|
||||
freerdp
|
||||
@@ -25,6 +23,6 @@
|
||||
target = "${config.home.homeDirectory}/.local/share/remmina";
|
||||
source = "${config.info.rootPath}/dotfiles/${config.info.hostName}/remmina";
|
||||
});
|
||||
};
|
||||
}) ];
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
{ inputs, self, ... }: let
|
||||
optionName = "features.applications.gui.thunderbird.enable";
|
||||
in {
|
||||
imports = [
|
||||
(inputs.helpers.mkStandardFeature.flakeModule "graphics" optionName "Thunderbird")
|
||||
];
|
||||
|
||||
flake.nixosModules.graphics = { pkgs, config, ... }: {
|
||||
imports = [ (inputs.helpers.mkStandardFeature.nixosModule { inherit config optionName; } {
|
||||
environment.systemPackages = [ pkgs.thunderbird ];
|
||||
}) ];
|
||||
};
|
||||
|
||||
flake.homeModules.graphicsOptions = { lib, ... }: {
|
||||
options.features.applications.gui.thunderbird.autostart = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
description = "Whether to add thunderbird.desktop to `$XDG_CONFIG_HOME/autostart`.";
|
||||
default = false;
|
||||
};
|
||||
};
|
||||
|
||||
flake.homeModules.graphics = { pkgs, config, lib, ... }: {
|
||||
imports = [ (inputs.helpers.mkStandardFeature.homeModule { inherit config optionName; } {
|
||||
home.packages = [ pkgs.thunderbird ];
|
||||
xdg.configFile."autostart/thunderbird.desktop" = lib.mkIf (config.features.applications.gui.thunderbird.autostart) {
|
||||
text = ''
|
||||
[Desktop Entry]
|
||||
Categories=Network;Chat;Email;Feed;GTK;News
|
||||
Comment=Read and write e-mails or RSS feeds, or manage tasks on calendars.
|
||||
Exec=${pkgs.thunderbird}/bin/thunderbird --name thunderbird %U
|
||||
GenericName=Email Client
|
||||
Icon=thunderbird
|
||||
MimeType=message/rfc822;x-scheme-handler/mailto;text/calendar;text/x-vcard
|
||||
Name=Thunderbird
|
||||
StartupNotify=true
|
||||
StartupWMClass=thunderbird
|
||||
Terminal=false
|
||||
Type=Application
|
||||
Version=1.5
|
||||
'';
|
||||
force = true;
|
||||
};
|
||||
}) ];
|
||||
};
|
||||
}
|
||||
@@ -1,31 +1,29 @@
|
||||
{ inputs, self, ... }: {
|
||||
imports = [ (inputs.helpers.mkMirroredModulesFlakeModule "graphicsOptions" ({ lib, ... }: {
|
||||
options.features.applications.gui.vscode.enable = lib.mkEnableOption "VS Code";
|
||||
})) ];
|
||||
{ inputs, self, ... }: let
|
||||
optionName = "features.applications.gui.vscode.enable";
|
||||
in {
|
||||
imports = [ (inputs.helpers.mkStandardFeature.flakeModule "graphics" optionName "VS Code") ];
|
||||
|
||||
flake.nixosModules.graphics = { config, pkgs, lib, ... }: {
|
||||
config = lib.mkIf (config.features.applications.gui.vscode.enable) (inputs.helpers.mkIfElse (config.features.nixos.home-manager.enable) {
|
||||
home-manager.users.${config.info.userName}.features.applications.gui.vscode.enable = lib.mkDefault true;
|
||||
} {
|
||||
imports = [ (inputs.helpers.mkStandardFeature.nixosModule { inherit config optionName; } {
|
||||
environment.systemPackages = [ pkgs.vscode ];
|
||||
});
|
||||
}) ];
|
||||
};
|
||||
|
||||
flake.homeModules.graphics = { config, pkgs, lib, ... }: {
|
||||
config = lib.mkIf (config.features.applications.gui.vscode.enable) {
|
||||
imports = [ (inputs.helpers.mkStandardFeature.homeModule { inherit config optionName; } {
|
||||
home.packages = [ pkgs.vscode ];
|
||||
|
||||
home.activation = {
|
||||
linkVsCodeConfigSettings = lib.hm.dag.entryAfter ["writeBoundary"] (inputs.helpers.mkSymlinkActivationScript {
|
||||
target = "${config.xdg.configHome}/Code/User/settings.json";
|
||||
source = "${config.info.rootPath}/dotfiles/global/vscode/settings.json";
|
||||
source = "${config.info.rootPath}/dotfiles/shared/vscode/settings.json";
|
||||
});
|
||||
|
||||
linkVsCodeConfigKeybindings = lib.hm.dag.entryAfter ["writeBoundary"] (inputs.helpers.mkSymlinkActivationScript {
|
||||
target = "${config.xdg.configHome}/Code/User/keybindings.json";
|
||||
source = "${config.info.rootPath}/dotfiles/global/vscode/keybindings.json";
|
||||
source = "${config.info.rootPath}/dotfiles/shared/vscode/keybindings.json";
|
||||
});
|
||||
};
|
||||
};
|
||||
}) ];
|
||||
};
|
||||
}
|
||||
@@ -5,6 +5,8 @@
|
||||
|
||||
flake.nixosModules.gaming = { pkgs, config, lib, ... }: {
|
||||
config = lib.mkIf (config.features.hardware.steam-controller.enable) {
|
||||
hardware.steam-hardware.enable = lib.mkForce true; # most likely enabled somewhere else but should be enforced here regardless
|
||||
|
||||
home-manager.users.${config.info.userName} = lib.mkIf (config.features.nixos.home-manager.enable) {
|
||||
features.hardware.steam-controller.enable = lib.mkDefault true;
|
||||
};
|
||||
@@ -14,8 +16,8 @@
|
||||
flake.homeModules.gaming = { pkgs, config, lib, inputs, ... }: {
|
||||
config = let
|
||||
pkgsCross = import inputs.nixpkgs {
|
||||
localSystem = "x86_64-linux";
|
||||
hostSystem = "x86_64-linux";
|
||||
localSystem = pkgs.stdenv.hostPlatform.system;
|
||||
hostSystem = pkgs.stdenv.hostPlatform.system;
|
||||
crossSystem = "i686-linux";
|
||||
};
|
||||
steam-modified-desktop-file = pkgs.runCommand "modifySteamDesktopFile" {} ''
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
|
||||
applications = {
|
||||
gui = {
|
||||
nautilus.enable = true;
|
||||
kitty.enable = true;
|
||||
vscode.enable = true;
|
||||
equibop.enable = true;
|
||||
|
||||
@@ -31,8 +31,8 @@
|
||||
};
|
||||
|
||||
components = {
|
||||
windowManagers = "niri";
|
||||
shells = "noctalia";
|
||||
windowManagers = [ "biri" ];
|
||||
shells = [ "noctalia" ];
|
||||
};
|
||||
|
||||
features = {
|
||||
@@ -67,15 +67,19 @@
|
||||
theme = "comfy";
|
||||
};
|
||||
};
|
||||
thunderbird = {
|
||||
enable = true;
|
||||
};
|
||||
};
|
||||
|
||||
extraPackages = with pkgs; [
|
||||
nix-init
|
||||
github-desktop
|
||||
signal-desktop
|
||||
];
|
||||
|
||||
shellScripts = let
|
||||
mkBrightnessScript = direction: ''
|
||||
mkBrightnessScript = direction: scriptName: ''
|
||||
LOOP_COUNTER=0
|
||||
DEVICE=$1
|
||||
PRETTY_NAME=$(sudo ddccontrol dev:$DEVICE 2>&1 >/dev/null | grep -oP "/usr/share/ddccontrol-db/monitor/\K.+\.xml" | sed 's/.xml//')
|
||||
@@ -88,7 +92,7 @@
|
||||
LOOP_COUNTER=$(($LOOP_COUNTER + 1))
|
||||
done
|
||||
|
||||
noctalia msg notification-show "Set brightness to $WRITTEN for display $PRETTY_NAME"
|
||||
notify-send -e -a "${scriptName}" "Set brightness to $WRITTEN for display $PRETTY_NAME"
|
||||
'';
|
||||
in {
|
||||
switch-os = ''
|
||||
@@ -109,14 +113,16 @@
|
||||
|
||||
if [ "$bypass_value" = "1" ]; then
|
||||
easyeffects -b 2
|
||||
notify-send -e -a "toggle-easyeffects script" "Easy Effects enabled"
|
||||
else
|
||||
easyeffects -b 1
|
||||
notify-send -e -a "toggle-easyeffects script" "Easy Effects disabled"
|
||||
fi
|
||||
'';
|
||||
|
||||
increase-brightness = mkBrightnessScript "+";
|
||||
increase-brightness = mkBrightnessScript "+" "increase-brightness script";
|
||||
|
||||
decrease-brightness = mkBrightnessScript "-";
|
||||
decrease-brightness = mkBrightnessScript "-" "decrease-brightness script";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user