-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
23 changed files
with
601 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
{ lib, ... }: | ||
with lib; | ||
rec { | ||
mkOpt = | ||
type: default: description: | ||
mkOption { inherit type default description; }; | ||
|
||
mkOpt' = type: default: mkOpt type default null; | ||
|
||
mkBoolOpt = mkOpt types.bool; | ||
|
||
mkBoolOpt' = mkOpt' types.bool; | ||
|
||
enabled = { | ||
enable = true; | ||
}; | ||
|
||
disabled = { | ||
enable = false; | ||
}; | ||
|
||
capitalize = | ||
s: | ||
let | ||
len = stringLength s; | ||
in | ||
if len == 0 then "" else (lib.toUpper (substring 0 1 s)) + (substring 1 len s); | ||
|
||
# return an int (1/0) based on boolean value | ||
# `boolToNum true` -> 1 | ||
boolToNum = bool: if bool then 1 else 0; | ||
|
||
default-attrs = mapAttrs (_key: mkDefault); | ||
|
||
force-attrs = mapAttrs (_key: mkForce); | ||
|
||
nested-default-attrs = mapAttrs (_key: default-attrs); | ||
|
||
nested-force-attrs = mapAttrs (_key: force-attrs); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
{ | ||
config, | ||
lib, | ||
pkgs, | ||
namespace, | ||
... | ||
}: | ||
let | ||
inherit (lib) mkIf getExe' stringAfter; | ||
inherit (lib.${namespace}) mkBoolOpt enabled; | ||
|
||
cfg = config.${namespace}.display-managers.sddm; | ||
in | ||
{ | ||
options.${namespace}.display-managers.sddm = { | ||
enable = mkBoolOpt false "Whether or not to enable sddm."; | ||
}; | ||
|
||
config = mkIf cfg.enable { | ||
environment.systemPackages = with pkgs; [ | ||
catppuccin-sddm-corners | ||
sddm | ||
]; | ||
|
||
services = { | ||
displayManager = { | ||
sddm = { | ||
inherit (cfg) enable; | ||
theme = "catppuccin-sddm-corners"; | ||
wayland = enabled; | ||
}; | ||
}; | ||
}; | ||
|
||
system.activationScripts.postInstallSddm = | ||
stringAfter [ "users" ] # bash | ||
'' | ||
echo "Setting sddm permissions for user icon" | ||
${getExe' pkgs.acl "setfacl"} -m u:sddm:x /home/${config.${namespace}.user.name} | ||
${getExe' pkgs.acl "setfacl"} -m u:sddm:r /home/${config.${namespace}.user.name}/.face.icon || true | ||
''; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
modules/nixos/programs/graphical/addons/keyring/default.nix
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
config, | ||
lib, | ||
namespace, | ||
... | ||
}: | ||
let | ||
inherit (lib) mkIf; | ||
inherit (lib.${namespace}) mkBoolOpt; | ||
|
||
cfg = config.${namespace}.programs.graphical.addons.keyring; | ||
in | ||
{ | ||
options.${namespace}.programs.graphical.addons.keyring = { | ||
enable = mkBoolOpt false "Whether to enable the passwords application."; | ||
}; | ||
|
||
config = mkIf cfg.enable { programs.seahorse.enable = true; }; | ||
} |
50 changes: 50 additions & 0 deletions
50
modules/nixos/programs/graphical/addons/noisetorch/default.nix
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
{ | ||
config, | ||
lib, | ||
pkgs, | ||
namespace, | ||
... | ||
}: | ||
let | ||
inherit (lib) | ||
mkIf | ||
mkEnableOption | ||
mkOption | ||
literalExpression | ||
types | ||
; | ||
|
||
cfg = config.${namespace}.programs.graphical.addons.noisetorch; | ||
in | ||
{ | ||
options.${namespace}.programs.graphical.addons.noisetorch = { | ||
enable = mkEnableOption "noisetorch service"; | ||
package = mkOption { | ||
type = types.package; | ||
default = pkgs.noisetorch; | ||
defaultText = literalExpression "pkgs.noisetorch"; | ||
description = "Which package to use for noisetorch"; | ||
}; | ||
threshold = mkOption { | ||
type = types.int; | ||
default = -1; | ||
description = "Voice activation threshold (default -1)"; | ||
}; | ||
device = mkOption { | ||
type = types.str; | ||
description = "Use the specified source/sink device ID"; | ||
}; | ||
deviceUnit = mkOption { | ||
type = types.str; | ||
description = "Systemd device unit which is providing the audio device"; | ||
}; | ||
}; | ||
|
||
config = mkIf cfg.enable { | ||
programs.noisetorch = { | ||
enable = true; | ||
|
||
inherit (cfg) package; | ||
}; | ||
}; | ||
} |
72 changes: 72 additions & 0 deletions
72
modules/nixos/programs/graphical/addons/xdg-portal/default.nix
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
{ | ||
config, | ||
inputs, | ||
lib, | ||
pkgs, | ||
system, | ||
namespace, | ||
... | ||
}: | ||
let | ||
inherit (lib) mkIf; | ||
inherit (lib.${namespace}) mkBoolOpt; | ||
inherit (inputs) hyprland xdg-desktop-portal-hyprland; | ||
|
||
cfg = config.${namespace}.programs.graphical.addons.xdg-portal; | ||
in | ||
{ | ||
options.${namespace}.programs.graphical.addons.xdg-portal = { | ||
enable = mkBoolOpt false "Whether or not to add support for xdg portal."; | ||
}; | ||
|
||
config = mkIf cfg.enable { | ||
xdg = { | ||
portal = { | ||
enable = true; | ||
|
||
configPackages = [ hyprland.packages.${system}.hyprland ]; | ||
|
||
config = { | ||
hyprland = mkIf config.${namespace}.programs.graphical.wms.hyprland.enable { | ||
default = [ | ||
"hyprland" | ||
"gtk" | ||
]; | ||
"org.freedesktop.impl.portal.Screencast" = "hyprland"; | ||
"org.freedesktop.impl.portal.Screenshot" = "hyprland"; | ||
}; | ||
|
||
common = { | ||
default = [ "gtk" ]; | ||
|
||
"org.freedesktop.impl.portal.Screencast" = "gtk"; | ||
"org.freedesktop.impl.portal.Screenshot" = "gtk"; | ||
"org.freedesktop.impl.portal.Secret" = [ "gnome-keyring" ]; | ||
}; | ||
}; | ||
|
||
extraPortals = | ||
with pkgs; | ||
[ xdg-desktop-portal-gtk ] | ||
++ (lib.optional config.${namespace}.programs.graphical.wms.hyprland.enable ( | ||
xdg-desktop-portal-hyprland.packages.${system}.xdg-desktop-portal-hyprland.override { | ||
debug = true; | ||
# TODO: use same package as home-manager | ||
inherit (hyprland.packages.${system}) hyprland; | ||
} | ||
)); | ||
# xdgOpenUsePortal = true; | ||
|
||
wlr = { | ||
settings = { | ||
screencast = { | ||
max_fps = 30; | ||
chooser_type = "simple"; | ||
chooser_cmd = "${pkgs.slurp}/bin/slurp -f %o -or"; | ||
}; | ||
}; | ||
}; | ||
}; | ||
}; | ||
}; | ||
} |
20 changes: 20 additions & 0 deletions
20
modules/nixos/programs/graphical/apps/bitwarden/default.nix
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
config, | ||
lib, | ||
pkgs, | ||
namespace, | ||
... | ||
}: | ||
let | ||
inherit (lib) mkEnableOption; | ||
|
||
cfg = config.${namespace}.programs.graphical.apps.bitwarden; | ||
in | ||
{ | ||
options.${namespace}.programs.graphical.apps.bitwarden = { | ||
enable = mkEnableOption "Wether or not to enable bitwarden"; | ||
}; | ||
config = lib.mkIf cfg { | ||
environment.systemPackages = with pkgs; [ bitwarden ]; | ||
}; | ||
} |
25 changes: 25 additions & 0 deletions
25
modules/nixos/programs/graphical/apps/partitionmanager/default.nix
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ | ||
config, | ||
lib, | ||
pkgs, | ||
namespace, | ||
... | ||
}: | ||
let | ||
inherit (lib) mkIf; | ||
inherit (lib.${namespace}) mkBoolOpt; | ||
|
||
cfg = config.${namespace}.programs.graphical.apps.partitionmanager; | ||
in | ||
{ | ||
options.${namespace}.programs.graphical.apps.partitionmanager = { | ||
enable = mkBoolOpt false "Whether or not to enable partitionmanager."; | ||
}; | ||
|
||
config = mkIf cfg.enable { | ||
programs.partition-manager = { | ||
enable = true; | ||
package = pkgs.kdePackages.partitionmanager; | ||
}; | ||
}; | ||
} |
23 changes: 23 additions & 0 deletions
23
modules/nixos/programs/graphical/file-managers/thunar/default.nix
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
config, | ||
lib, | ||
namespace, | ||
... | ||
}: | ||
let | ||
inherit (lib) mkIf; | ||
inherit (lib.${namespace}) mkBoolOpt; | ||
|
||
cfg = config.${namespace}.programs.graphical.file-managers.thunar; | ||
in | ||
{ | ||
options.${namespace}.programs.graphical.file-managers.thunar = { | ||
enable = mkBoolOpt false "Whether to enable the xfce file manager."; | ||
}; | ||
|
||
config = mkIf cfg.enable { | ||
programs.thunar = { | ||
enable = true; | ||
}; | ||
}; | ||
} |
Oops, something went wrong.