feat: add terminal and file manager option
This commit is contained in:
parent
2d29293fa3
commit
627dcbb0e9
11 changed files with 61 additions and 27 deletions
|
@ -1,4 +1,4 @@
|
|||
{ pkgs, ... }:
|
||||
{ lib, osConfig, ... }:
|
||||
{
|
||||
programs.fuzzel = {
|
||||
enable = true;
|
||||
|
@ -9,7 +9,7 @@
|
|||
font = "Hack:weight=bold";
|
||||
line-height = 30;
|
||||
fields = "name,generic,comment";
|
||||
terminal = "${pkgs.foot}/bin/foot -e";
|
||||
terminal = lib.my.getExe osConfig.modules.system.roles.desktop.terminal;
|
||||
prompt = "❯ ";
|
||||
layer = "overlay";
|
||||
};
|
||||
|
|
|
@ -148,8 +148,8 @@ mkIf osConfig.programs.hyprland.enable {
|
|||
bind =
|
||||
[
|
||||
"$mod, D, exec, ${pkgs.fuzzel}/bin/fuzzel"
|
||||
"$mod, E, exec, ${pkgs.nautilus}/bin/nautilus"
|
||||
"$mod, Return, exec, ${pkgs.foot}/bin/foot"
|
||||
"$mod, E, exec, ${lib.my.getExe osConfig.system.roles.desktop.filemanager}"
|
||||
"$mod, Return, exec, ${lib.my.getExe osConfig.modules.system.roles.desktop.terminal}"
|
||||
"$mod SHIFT, Q, killactive,"
|
||||
"$mod, V, togglefloating"
|
||||
"$mod SHIFT, P, exec, ${config.programs.rofi.package}/bin/rofi -show p -modi p:${pkgs.rofi-power-menu}/bin/rofi-power-menu"
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
pkgs,
|
||||
config,
|
||||
lib,
|
||||
osConfig,
|
||||
...
|
||||
}:
|
||||
lib.mkIf config.programs.rofi.enable {
|
||||
|
@ -13,7 +14,7 @@ lib.mkIf config.programs.rofi.enable {
|
|||
package = pkgs.rofi-wayland.override { inherit plugins; };
|
||||
plugins = [ pkgs.rofi-calc ];
|
||||
theme = "${conf}/themes/rounded-gray-dark.rasi";
|
||||
terminal = "${pkgs.foot}/bin/foot";
|
||||
terminal = lib.my.getExe osConfig.modules.system.roles.desktop.terminal;
|
||||
extraConfig = {
|
||||
modes = [
|
||||
"combi"
|
||||
|
@ -23,7 +24,7 @@ lib.mkIf config.programs.rofi.enable {
|
|||
"run"
|
||||
# WARNING: ABI version mismatch
|
||||
# "calc"
|
||||
"clipboard:${lib.my.checkPath pkgs.cliphist "cliphist-rofi-img"}"
|
||||
"clipboard:${lib.my.getExe' pkgs.cliphist "cliphist-rofi-img"}"
|
||||
];
|
||||
matching = "fuzzy";
|
||||
sort = true;
|
||||
|
|
|
@ -10,7 +10,7 @@ let
|
|||
name: word:
|
||||
writeFishBin name ''
|
||||
env --chdir ~/.nixconf ${pkgs.nh}/bin/nh os ${word} . $argv \
|
||||
&& ${lib.my.checkPath pkgs.libnotify "notify-send"} nixos-rebuild "Rebuild complete" \
|
||||
&& ${lib.my.getExe' pkgs.libnotify "notify-send"} nixos-rebuild "Rebuild complete" \
|
||||
-a nixos-rebuild \
|
||||
-i ${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg
|
||||
'';
|
||||
|
|
|
@ -8,6 +8,9 @@
|
|||
}:
|
||||
let
|
||||
inherit (lib) mapAttrs;
|
||||
desktop = osConfig.modules.system.roles.desktop;
|
||||
term = lib.my.getExe desktop.terminal;
|
||||
filemanager = lib.my.getExe desktop.filemanager;
|
||||
in
|
||||
lib.mkIf osConfig.programs.sway.enable {
|
||||
|
||||
|
@ -16,8 +19,6 @@ lib.mkIf osConfig.programs.sway.enable {
|
|||
|
||||
wayland.windowManager.sway =
|
||||
let
|
||||
term = "${pkgs.foot}/bin/foot";
|
||||
filemanager = "${pkgs.nautilus}/bin/nautilus";
|
||||
colors = {
|
||||
lavender = "#babbf1";
|
||||
black = "#000000";
|
||||
|
@ -69,7 +70,6 @@ lib.mkIf osConfig.programs.sway.enable {
|
|||
# Make focused window fullscreen
|
||||
"${mod}+f" = "fullscreen";
|
||||
# Start launcher
|
||||
#"${mod}+d" = "exec rofi -config ${homeDirectory}/.config/rofi/config.rasi -show combi -automatic-save-to-history | xargs swaymsg exec --";
|
||||
"${mod}+d" = "exec ${pkgs.fuzzel}/bin/fuzzel";
|
||||
"${mod}+s" = "exec rofi -show clipboard -show-icons";
|
||||
# Toggle the current focus between tiling and floating mode
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{ pkgs, lib, ... }:
|
||||
let
|
||||
inherit (lib.my) checkPath;
|
||||
inherit (lib.my) getExe';
|
||||
in
|
||||
{
|
||||
programs.fish = {
|
||||
|
@ -11,7 +11,7 @@ in
|
|||
functions = {
|
||||
gitignore = "curl -sL https://www.gitignore.io/api/$argv";
|
||||
mv-bad-creation-date = ''
|
||||
${checkPath pkgs.exiftool "exiftool"} -if 'not $CreateDate' -p '$FileName' "$PWD/$argv[1]" | xargs -I {} mv -i "$PWD/$argv[1]/{}" "$argv[2]"
|
||||
${getExe' pkgs.exiftool "exiftool"} -if 'not $CreateDate' -p '$FileName' "$PWD/$argv[1]" | xargs -I {} mv -i "$PWD/$argv[1]/{}" "$argv[2]"
|
||||
'';
|
||||
rename-images = ''
|
||||
set -f input "$PWD/$argv[1]"
|
||||
|
@ -19,7 +19,7 @@ in
|
|||
if not test -d $input
|
||||
echo "input is not a directory"
|
||||
else
|
||||
${checkPath pkgs.exiftool "exiftool"} -if '$CreateDate' -p '$FileName' "$input" | xargs -I {} jhead -n%Y-%m-%d-%H%M%S "$input/{}"
|
||||
${getExe' pkgs.exiftool "exiftool"} -if '$CreateDate' -p '$FileName' "$input" | xargs -I {} jhead -n%Y-%m-%d-%H%M%S "$input/{}"
|
||||
end
|
||||
'';
|
||||
fish_prompt = builtins.readFile ./fish_prompt.fish;
|
||||
|
|
|
@ -49,7 +49,6 @@
|
|||
pwvucontrol
|
||||
thunderbird
|
||||
keepassxc
|
||||
nautilus
|
||||
protonmail-bridge-gui
|
||||
varia
|
||||
signal-desktop
|
||||
|
|
|
@ -56,11 +56,9 @@
|
|||
gimp
|
||||
thunderbird
|
||||
keepassxc
|
||||
nautilus
|
||||
protonmail-bridge-gui
|
||||
varia
|
||||
signal-desktop
|
||||
foot
|
||||
|
||||
# Proprietary
|
||||
postman
|
||||
|
|
|
@ -1,9 +1,36 @@
|
|||
{ lib, ... }:
|
||||
{
|
||||
pkgs,
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
let
|
||||
inherit (lib) mkEnableOption;
|
||||
inherit (lib) mkEnableOption mkOption mkIf;
|
||||
inherit (lib.types) package;
|
||||
cfg = config.modules.system.roles.desktop;
|
||||
in
|
||||
{
|
||||
options.modules.system.roles.desktop = {
|
||||
enable = mkEnableOption "desktop usage features";
|
||||
|
||||
terminal = mkOption {
|
||||
type = package;
|
||||
default = pkgs.foot;
|
||||
description = ''
|
||||
The default terminal emulator used on the system.
|
||||
To be used by other options and configurations.
|
||||
'';
|
||||
};
|
||||
filemanager = mkOption {
|
||||
type = package;
|
||||
default = pkgs.nautilus;
|
||||
description = '''';
|
||||
};
|
||||
};
|
||||
config = mkIf cfg.enable {
|
||||
environment.systemPackages = [
|
||||
cfg.terminal
|
||||
cfg.filemanager
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
|
@ -37,6 +37,7 @@ in
|
|||
unzip
|
||||
fd
|
||||
ripgrep
|
||||
jnv
|
||||
];
|
||||
};
|
||||
};
|
||||
|
|
|
@ -29,15 +29,6 @@ in
|
|||
SystemCallArchitectures = "native";
|
||||
};
|
||||
|
||||
# Verify the existence of a binary inside of a derivation.
|
||||
# Returns the path to the binary or throws.
|
||||
checkPath =
|
||||
pkg: bin:
|
||||
let
|
||||
abs = lib.getExe' pkg bin;
|
||||
in
|
||||
if builtins.pathExists abs then abs else throw "${abs} does not exist.";
|
||||
|
||||
mkSystem =
|
||||
{
|
||||
withSystem,
|
||||
|
@ -79,6 +70,23 @@ in
|
|||
validatePath =
|
||||
s: if (builtins.pathExists s) then (builtins.baseNameOf s) else throw "${s} does not exist";
|
||||
|
||||
# Return the main executable of a derivation, throwing if it doesn't exist
|
||||
getExe =
|
||||
pkg:
|
||||
let
|
||||
abs = lib.getExe pkg;
|
||||
in
|
||||
if builtins.pathExists abs then abs else throw "${abs} does not exist.";
|
||||
|
||||
# Verify the existence of a binary inside of a derivation.
|
||||
# Returns the path to the binary or throws.
|
||||
getExe' =
|
||||
pkg: bin:
|
||||
let
|
||||
abs = lib.getExe' pkg bin;
|
||||
in
|
||||
if builtins.pathExists abs then abs else throw "${abs} does not exist.";
|
||||
|
||||
mkVHost = name: port: ssl: {
|
||||
inherit name;
|
||||
value = {
|
||||
|
|
Loading…
Add table
Reference in a new issue