moar modules
This commit is contained in:
parent
a1175ba492
commit
011009d22f
17 changed files with 556 additions and 240 deletions
|
|
@ -22,14 +22,15 @@
|
|||
mkConf = import ./lib/mkconf.nix;
|
||||
|
||||
user = "tristan";
|
||||
userName = "Tristan Beedell";
|
||||
in
|
||||
{
|
||||
nixosConfigurations = {
|
||||
zenix = mkConf "zenix" {
|
||||
inherit pkgs nixpkgs system user home-manager hyprland;
|
||||
inherit pkgs nixpkgs system user userName home-manager hyprland;
|
||||
};
|
||||
FCS-Tristan-Nixbook = mkConf "work" {
|
||||
inherit pkgs nixpkgs system user home-manager hyprland;
|
||||
inherit pkgs nixpkgs system user userName home-manager hyprland;
|
||||
laptop = true;
|
||||
work = true;
|
||||
};
|
||||
|
|
|
|||
37
lib/home.nix
Normal file
37
lib/home.nix
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
{ user
|
||||
, name
|
||||
, hyprland
|
||||
, laptop ? false
|
||||
, work ? false
|
||||
, displays ? []
|
||||
, userName
|
||||
, ... }:
|
||||
{ config, pkgs, ...}:
|
||||
{
|
||||
imports = [
|
||||
(import ./modules/terminal.nix { inherit user; })
|
||||
(import ./modules/scripts.nix { inherit user; })
|
||||
(import ./modules/editor.nix { inherit user; })
|
||||
(import ./modules/keyboard.nix { inherit user; })
|
||||
(import ./modules/display.nix { inherit user; })
|
||||
(import ./modules/work.nix { inherit user; })
|
||||
(import ./modules/menu.nix { inherit user; })
|
||||
(import ./modules/email.nix { inherit user userName; })
|
||||
(import ./modules/git.nix { inherit user userName; })
|
||||
(import ./modules/laptop.nix { inherit user; })
|
||||
./scripts.nix
|
||||
../system/global/system.nix
|
||||
../system/${name}/system.nix
|
||||
../system/${name}/hardware.nix
|
||||
];
|
||||
|
||||
home-manager.users.${user}.imports = [
|
||||
../system/global/home.nix
|
||||
../system/${name}/home.nix
|
||||
];
|
||||
|
||||
roles.laptop.enable = laptop;
|
||||
roles.work.enable = work;
|
||||
roles.git.enable = true;
|
||||
|
||||
}
|
||||
|
|
@ -7,6 +7,7 @@ name:
|
|||
, laptop ? false
|
||||
, work ? false
|
||||
, displays ? []
|
||||
, userName
|
||||
, ...
|
||||
}:
|
||||
|
||||
|
|
@ -22,36 +23,13 @@ nixpkgs.lib.nixosSystem rec {
|
|||
};
|
||||
}
|
||||
home-manager.nixosModules.home-manager
|
||||
{
|
||||
imports = [
|
||||
(import ./modules/scripts.nix { inherit user; })
|
||||
(import ./modules/editor.nix { inherit user; })
|
||||
(import ./modules/keyboard.nix { inherit user; })
|
||||
(import ./modules/display.nix { inherit user; })
|
||||
(import ./modules/work.nix { inherit user; })
|
||||
];
|
||||
keyboard.dvorak.enable = laptop;
|
||||
displays = if laptop then {
|
||||
enable = true;
|
||||
displays = [{
|
||||
name = "eDP-1";
|
||||
scaling = 1.2;
|
||||
}];
|
||||
}
|
||||
else displays;
|
||||
roles.work.enable = work;
|
||||
}
|
||||
../system/global/system.nix
|
||||
../system/${name}/system.nix
|
||||
../system/${name}/hardware.nix
|
||||
{
|
||||
home-manager.useGlobalPkgs = true;
|
||||
home-manager.useUserPackages = true;
|
||||
home-manager.users.${user}.imports = [
|
||||
../system/${name}/home.nix
|
||||
../system/global/home.nix
|
||||
hyprland.homeManagerModules.default
|
||||
];
|
||||
}
|
||||
(import ./home.nix { inherit user userName name hyprland laptop work; })
|
||||
];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,7 +11,10 @@ let
|
|||
"monitor = " + display.name +
|
||||
", " + resToString display.resolution +
|
||||
", " + display.position +
|
||||
", " + toString display.scaling;
|
||||
", " + toString display.scaling +
|
||||
(if ( display.wallpaper != "" ) then ''
|
||||
exec-once = ${pkgs.swaybg}/bin/swaybg -o ${display.name} -i ${display.wallpaper} &
|
||||
'' else "");
|
||||
|
||||
resolutionType = types.submodule ({ x, y, freq, ... }:
|
||||
{
|
||||
|
|
@ -52,6 +55,10 @@ let
|
|||
description = "XxY";
|
||||
default = "auto";
|
||||
};
|
||||
wallpaper = mkOption {
|
||||
description = "path to wallpaper";
|
||||
default = "";
|
||||
};
|
||||
};
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,9 @@
|
|||
with lib;
|
||||
let
|
||||
editor = config.programs.editor;
|
||||
terminal = "foot";
|
||||
pkg = editor.package;
|
||||
terminal = config.programs.terminal.package;
|
||||
termcmd = "${terminal}/bin/${terminal.pname}";
|
||||
menu = "wofi --show dmenu";
|
||||
in
|
||||
{
|
||||
|
|
@ -13,9 +15,6 @@ in
|
|||
default = pkgs.vscodium;
|
||||
example = "pkgs.vscode";
|
||||
};
|
||||
command = mkOption {
|
||||
default = "/bin/codium";
|
||||
};
|
||||
neovim = mkEnableOption "neovim mode";
|
||||
};
|
||||
};
|
||||
|
|
@ -37,12 +36,12 @@ in
|
|||
case $repo in
|
||||
clone-repo)
|
||||
url=$(wl-paste)
|
||||
${terminal} -e -- git clone "$url" ;;
|
||||
*) [ -e "$repo" ] && ${editor.package}${editor.command} $repo ;;
|
||||
${termcmd} -e -- git clone "$url" ;;
|
||||
*) [ -e "$repo" ] && ${pkg}/bin/${pkg.pname} $repo ;;
|
||||
esac
|
||||
'';
|
||||
install = false;
|
||||
hotkey = "C";
|
||||
hotkeys = [{key = "C";}];
|
||||
}];
|
||||
};
|
||||
|
||||
|
|
|
|||
63
lib/modules/email.nix
Normal file
63
lib/modules/email.nix
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
{ user, userName }: { lib, pkgs, config, ... }:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.roles.email;
|
||||
in
|
||||
{
|
||||
options.roles = {
|
||||
email = {
|
||||
enable = mkEnableOption "email settings";
|
||||
email = mkOption {
|
||||
description = "email address";
|
||||
};
|
||||
terminal = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home-manager.users.${user}.imports = [{
|
||||
programs.git = {
|
||||
userName = userName;
|
||||
userEmail = cfg.email;
|
||||
};
|
||||
|
||||
accounts.email.accounts.${cfg.email} = mkIf cfg.terminal {
|
||||
notmuch.enable = true;
|
||||
neomutt.enable = true;
|
||||
aerc.enable = true;
|
||||
mbsync.enable = true;
|
||||
mbsync.create = "both";
|
||||
userName = cfg.email;
|
||||
realName = userName;
|
||||
address = cfg.email;
|
||||
primary = true;
|
||||
passwordCommand = "${pkgs.rbw}/bin/rbw get privateemail";
|
||||
smtp = {
|
||||
host = "mail.privateemail.com";
|
||||
port = 465;
|
||||
tls.enable = true;
|
||||
};
|
||||
imap = {
|
||||
host = "mail.privateemail.com";
|
||||
port = 993;
|
||||
tls.enable = true;
|
||||
};
|
||||
};
|
||||
|
||||
programs.notmuch.enable = cfg.terminal;
|
||||
programs.neomutt = {
|
||||
enable = cfg.terminal;
|
||||
vimKeys = true;
|
||||
sort = "reverse-date";
|
||||
sidebar.enable = true;
|
||||
};
|
||||
programs.mbsync.enable = cfg.terminal;
|
||||
services.mbsync.enable = cfg.terminal;
|
||||
programs.aerc.enable = cfg.terminal;
|
||||
}];
|
||||
};
|
||||
|
||||
}
|
||||
25
lib/modules/git.nix
Normal file
25
lib/modules/git.nix
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
{ user, userName }: { lib, pkgs, config, ... }:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.roles.git;
|
||||
in
|
||||
{
|
||||
options.roles = {
|
||||
git = {
|
||||
enable = mkEnableOption "email settings";
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home-manager.users.${user}.imports = [{
|
||||
programs.git = {
|
||||
enable = true;
|
||||
aliases = {
|
||||
graph = "log --oneline --all --graph";
|
||||
amend = "commit --amend --no-edit";
|
||||
};
|
||||
};
|
||||
}];
|
||||
};
|
||||
|
||||
}
|
||||
17
lib/modules/hyprland.nix
Normal file
17
lib/modules/hyprland.nix
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
{ user }: { lib, pkgs, config, ... }:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.roles.hyprland;
|
||||
in
|
||||
{
|
||||
options.roles = {
|
||||
hyprland = {
|
||||
enable = mkEnableOption "hyprland";
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home-manager.users.${user}.imports = [{
|
||||
}];
|
||||
};
|
||||
}
|
||||
35
lib/modules/laptop.nix
Normal file
35
lib/modules/laptop.nix
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
{ user }: { lib, pkgs, config, ... }:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.roles.laptop;
|
||||
in
|
||||
{
|
||||
options.roles = {
|
||||
laptop = {
|
||||
enable = mkEnableOption "is a laptop";
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
displays = {
|
||||
enable = true;
|
||||
displays = [{
|
||||
name = "eDP-1";
|
||||
scaling = 1.2;
|
||||
}];
|
||||
};
|
||||
keyboard.dvorak.enable = true;
|
||||
|
||||
home-manager.users.${user}.imports = [{
|
||||
wayland.windowManager.hyprland = {
|
||||
extraConfig = ''
|
||||
# === LAPTOP MODULE ===
|
||||
general {
|
||||
gaps_out = 10
|
||||
border_size = 3
|
||||
}
|
||||
'';
|
||||
};
|
||||
}];
|
||||
};
|
||||
}
|
||||
34
lib/modules/menu.nix
Normal file
34
lib/modules/menu.nix
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
{ user }: { lib, pkgs, config, ... }:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.programs.menu;
|
||||
terminal = config.programs.terminal.package;
|
||||
termcmd = "${terminal}/bin/${terminal.pname}";
|
||||
in
|
||||
{
|
||||
options.programs = {
|
||||
menu = {
|
||||
enable = mkEnableOption "menu";
|
||||
package = mkPackageOption pkgs "wofi" {
|
||||
example = "pkgs.dmenu-wayland";
|
||||
};
|
||||
dmenuCommand = mkOption {
|
||||
default = "/bin/wofi --show dmenu";
|
||||
example = "/bin/dmenu";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home-manager.users.${user}.imports = [{
|
||||
programs.wofi = mkIf cfg.package == pkgs.wofi {
|
||||
enable = true;
|
||||
settings = {
|
||||
term = termcmd;
|
||||
};
|
||||
};
|
||||
|
||||
home.packages = [ cfg.package ];
|
||||
}];
|
||||
};
|
||||
}
|
||||
|
|
@ -3,6 +3,22 @@ with lib;
|
|||
let
|
||||
scripts = config.programs.scripts;
|
||||
|
||||
hotkeyType = types.submodule ({...}: {
|
||||
options = {
|
||||
key = mkOption {
|
||||
description = "the key";
|
||||
};
|
||||
modifier = mkOption {
|
||||
description = "modifiers for the key";
|
||||
default = "SUPER";
|
||||
};
|
||||
args = mkOption {
|
||||
description = "args for the script when use this key";
|
||||
default = "";
|
||||
};
|
||||
};
|
||||
});
|
||||
|
||||
scriptType = types.submodule ({...}: {
|
||||
options = {
|
||||
name = mkOption {
|
||||
|
|
@ -11,9 +27,10 @@ let
|
|||
text = mkOption {
|
||||
description = "the text of the script";
|
||||
};
|
||||
hotkey = mkOption {
|
||||
description = "the key that run this script";
|
||||
default = "";
|
||||
hotkeys = mkOption {
|
||||
type = types.listOf hotkeyType;
|
||||
description = "keys that run this script";
|
||||
default = [];
|
||||
};
|
||||
install = mkOption {
|
||||
type = types.bool;
|
||||
|
|
@ -22,12 +39,16 @@ let
|
|||
};
|
||||
});
|
||||
|
||||
scriptToPackage = script: pkgs.writeShellScriptBin script.name script.text;
|
||||
installScripts = scripts: (map scriptToPackage (filter ( s: s.install ) scripts));
|
||||
scriptToPackage = script:
|
||||
pkgs.writeShellScriptBin script.name script.text;
|
||||
|
||||
bindScript = script: if script.hotkey != "" then ''
|
||||
bind = SUPER, ${script.hotkey}, exec, ${scriptToPackage script}/bin/${script.name}
|
||||
'' else "";
|
||||
installScripts = scripts:
|
||||
(map scriptToPackage (filter ( s: s.install ) scripts));
|
||||
|
||||
bindScript = script: concatStrings (
|
||||
map ( hotkey: ''
|
||||
bind = ${hotkey.modifier}, ${hotkey.key}, exec, ${scriptToPackage script}/bin/${script.name} ${hotkey.args}
|
||||
'' ) script.hotkeys);
|
||||
|
||||
bindScripts = scripts:
|
||||
"# === USER SCRIPTS MODULE ===\n"
|
||||
|
|
|
|||
26
lib/modules/terminal.nix
Normal file
26
lib/modules/terminal.nix
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
{ user }: { lib, pkgs, config, ... }:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.programs.terminal;
|
||||
in
|
||||
{
|
||||
options.programs = {
|
||||
terminal = {
|
||||
enable = mkEnableOption "editor";
|
||||
package = mkPackageOption pkgs "foot" {
|
||||
example = "pkgs.alacritty";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home-manager.users.${user}.imports = [{
|
||||
programs.foot = mkIf cfg.package == pkgs.foot {
|
||||
enable = true;
|
||||
server.enable = true;
|
||||
};
|
||||
|
||||
home.packages = [ cfg.package ];
|
||||
}];
|
||||
};
|
||||
}
|
||||
|
|
@ -7,6 +7,12 @@ with lib;
|
|||
|
||||
config = mkIf config.roles.work.enable {
|
||||
|
||||
roles.email = {
|
||||
enable = true;
|
||||
email = "tristan.beedell@cryoserver.com";
|
||||
terminal = false;
|
||||
};
|
||||
|
||||
home-manager.users.${user}.imports = [{
|
||||
|
||||
home.packages = with pkgs; [
|
||||
|
|
@ -49,12 +55,19 @@ with lib;
|
|||
};
|
||||
};
|
||||
|
||||
wayland.windowManager.hyprland = {
|
||||
extraConfig = ''
|
||||
# === WORK MODULE ===
|
||||
bind = SUPER, E, focuswindow, thunderbird
|
||||
bind = SUPER, t, focuswindow, brave-cifhbcnohmdccbgoicgdjpfamggdegmo-Profile_2
|
||||
'';
|
||||
};
|
||||
|
||||
}];
|
||||
|
||||
programs.editor = {
|
||||
enable = true;
|
||||
package = pkgs.vscode;
|
||||
command = "/bin/code";
|
||||
};
|
||||
|
||||
nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [
|
||||
|
|
|
|||
241
lib/scripts.nix
Normal file
241
lib/scripts.nix
Normal file
|
|
@ -0,0 +1,241 @@
|
|||
{ config, pkgs, ...}:
|
||||
let
|
||||
my-deps = {
|
||||
notify-send = "${pkgs.libnotify}/bin/notify-send";
|
||||
playerctl = "${pkgs.playerctl}/bin/playerctl";
|
||||
grim = "${pkgs.grim}/bin/grim";
|
||||
slurp = "${pkgs.slurp}/bin/slurp";
|
||||
amixer = "${pkgs.alsa-utils}/bin/amixer";
|
||||
swaybg = "${pkgs.swaybg}/bin/swaybg";
|
||||
terminal = "${pkgs.foot}/bin/foot";
|
||||
chafa = "${pkgs.chafa}/bin/chafa";
|
||||
exiftool = "${pkgs.exiftool}/bin/exiftool";
|
||||
wc = "${pkgs.coreutils}/bin/wc";
|
||||
jq = "${pkgs.jq}/bin/jq";
|
||||
hyprctl = "${pkgs.hyprland}/bin/hyprctl";
|
||||
xargs = "${pkgs.findutils}/bin/xargs";
|
||||
menu = "${config.programs.menu.package}${config.programs.menu.dmenuCommand}";
|
||||
runmenu = "${config.programs.menu.package}/bin/wofi --show drun";
|
||||
fileman = "${pkgs.pcmanfm}/bin/pcmanfm";
|
||||
gawk = "${pkgs.gawk}/bin/awk";
|
||||
hyprpicker = "${pkgs.hyprpicker}/bin/hyprpicker";
|
||||
};
|
||||
in
|
||||
{
|
||||
programs.scripts = [
|
||||
{
|
||||
name = "play-pause";
|
||||
text = ''
|
||||
if [ "$(${my-deps.playerctl} --list-all | ${my-deps.wc} -l)" -lt 2 ]
|
||||
then
|
||||
${my-deps.playerctl} play-pause
|
||||
else
|
||||
${my-deps.playerctl} --list-all | \
|
||||
${my-deps.xargs} -I _ ${my-deps.playerctl} --player _ metadata --format '_ - {{title}}' | \
|
||||
${my-deps.menu} | ${my-deps.gawk} '{print $1}' | \
|
||||
${my-deps.xargs} -I _ ${my-deps.playerctl} --player _ play-pause
|
||||
fi
|
||||
'';
|
||||
hotkeys = [
|
||||
{key = "W";}
|
||||
{modifier = ""; key = "XF86AudioPlay";}
|
||||
];
|
||||
}
|
||||
{
|
||||
name = "bwmenu";
|
||||
text = ''
|
||||
items="$(rbw list)"
|
||||
echo "$items" | ${ my-deps.menu } | xargs -I_ rbw get _ | wl-copy
|
||||
'';
|
||||
hotkeys = [ { key = "P"; } ];
|
||||
install = false;
|
||||
}
|
||||
{
|
||||
name = "bwotpmenu";
|
||||
text = ''
|
||||
items="$(rbw list)"
|
||||
echo "$items" | ${ my-deps.menu } | xargs -I_ rbw code _ | wl-copy
|
||||
'';
|
||||
hotkeys = [ { modifier = "SUPER_SHIFT"; key = "P"; } ];
|
||||
install = false;
|
||||
}
|
||||
{
|
||||
name = "screenshot";
|
||||
text = ''
|
||||
OUT_DIR=~/Pictures/Screenshots
|
||||
mkdir -p "$OUT_DIR"
|
||||
FILE=$OUT_DIR/$(date +"%Y-%m-%dT%H:%M:%SZ").png
|
||||
|
||||
${my-deps.grim} -g "$(${my-deps.slurp} -o)" "$FILE"
|
||||
${my-deps.notify-send} "Screenshot Taken" "$FILE"
|
||||
|
||||
cat "$FILE" | wl-copy -t image/png
|
||||
'';
|
||||
hotkeys = [
|
||||
{modifier = "SUPER_SHIFT"; key = "S";}
|
||||
];
|
||||
}
|
||||
{
|
||||
name = "brightness-down";
|
||||
text = ''
|
||||
light -U $1
|
||||
${my-deps.notify-send} "Brightness" -h int:value:$(light) -a brightness-down -t 1000
|
||||
'';
|
||||
hotkeys = [
|
||||
{modifier = ""; key = "XF86MonBrightnessDown"; args = "10";}
|
||||
{modifier = "SHIFT"; key = "XF86MonBrightnessDown"; args = "1";}
|
||||
];
|
||||
install = false;
|
||||
}
|
||||
{
|
||||
name = "brightness-up";
|
||||
text = ''
|
||||
light -A $1
|
||||
${my-deps.notify-send} "Brightness" -h int:value:$(light) -a brightness-up -t 1000
|
||||
'';
|
||||
hotkeys = [
|
||||
{modifier = ""; key = "XF86MonBrightnessUp"; args = "10";}
|
||||
{modifier = "SHIFT"; key = "XF86MonBrightnessUp"; args = "1";}
|
||||
];
|
||||
install = false;
|
||||
}
|
||||
{
|
||||
name = "switch-window";
|
||||
text = ''
|
||||
${my-deps.hyprctl} clients -j | \
|
||||
${my-deps.jq} '.[] | .title' -r | \
|
||||
${my-deps.menu} | \
|
||||
${my-deps.xargs} -I_ ${my-deps.hyprctl} dispatch focuswindow title:"_"
|
||||
'';
|
||||
hotkeys = [
|
||||
{key = "TAB";}
|
||||
];
|
||||
}
|
||||
{
|
||||
name = "picker";
|
||||
text = ''
|
||||
${my-deps.hyprpicker} | wl-copy && notify-send "Copied Colour" "$(wl-paste)"
|
||||
'';
|
||||
hotkeys = [{
|
||||
key = "G";
|
||||
}];
|
||||
}
|
||||
{
|
||||
name = "ncmpcpp";
|
||||
text = ''
|
||||
${my-deps.terminal} -e ncmpcpp
|
||||
'';
|
||||
hotkeys = [{
|
||||
key = "M";
|
||||
}];
|
||||
install = false;
|
||||
}
|
||||
{
|
||||
name = "menu";
|
||||
text = ''
|
||||
${my-deps.runmenu}
|
||||
'';
|
||||
hotkeys = [{
|
||||
key = "D";
|
||||
}];
|
||||
install = false;
|
||||
}
|
||||
{
|
||||
name = "zoom-in";
|
||||
text = ''
|
||||
hyprctl keyword misc:cursor_zoom_factor 2
|
||||
'';
|
||||
hotkeys = [{
|
||||
modifier = "SUPER";
|
||||
key = "EQUAL";
|
||||
}];
|
||||
install = false;
|
||||
}
|
||||
{
|
||||
name = "zoom-out";
|
||||
text = ''
|
||||
hyprctl keyword misc:cursor_zoom_factor 1
|
||||
'';
|
||||
hotkeys = [{
|
||||
modifier = "SUPER";
|
||||
key = "MINUS";
|
||||
}];
|
||||
install = false;
|
||||
}
|
||||
{
|
||||
name = "raise-volume";
|
||||
text = ''
|
||||
${my-deps.amixer} sset Master 5%+ && ${my-deps.amixer} sset Master unmute
|
||||
'';
|
||||
hotkeys = [
|
||||
{key = "bracketright";}
|
||||
{modifier = ""; key = "XF86AudioRaiseVolume";}
|
||||
];
|
||||
install = false;
|
||||
}
|
||||
{
|
||||
name = "lower-volume";
|
||||
text = ''
|
||||
${ my-deps.amixer } sset Master 5%-
|
||||
'';
|
||||
hotkeys = [
|
||||
{key = "bracketleft";}
|
||||
{modifier = ""; key = "XF86AudioLowerVolume";}
|
||||
];
|
||||
install = false;
|
||||
}
|
||||
{
|
||||
name = "skip-track";
|
||||
text = ''
|
||||
${my-deps.playerctl} next
|
||||
'';
|
||||
hotkeys = [
|
||||
{modifier = "SUPER_SHIFT"; key = "period";}
|
||||
{modifier = ""; key = "XF86AudioNext";}
|
||||
];
|
||||
install = false;
|
||||
}
|
||||
{
|
||||
name = "skip-track-back";
|
||||
text = ''
|
||||
${my-deps.playerctl} previous
|
||||
'';
|
||||
hotkeys = [
|
||||
{modifier = "SUPER_SHIFT"; key = "comma";}
|
||||
{modifier = ""; key = "XF86AudioPrev";}
|
||||
];
|
||||
install = false;
|
||||
}
|
||||
{
|
||||
name = "terminal";
|
||||
text = my-deps.terminal;
|
||||
hotkeys = [
|
||||
{key = "RETURN";}
|
||||
];
|
||||
install = false;
|
||||
}
|
||||
{
|
||||
name = "fileman";
|
||||
text = my-deps.fileman;
|
||||
hotkeys = [
|
||||
{key = "O";}
|
||||
];
|
||||
install = false;
|
||||
}
|
||||
{
|
||||
name = "lock";
|
||||
text = ''
|
||||
res=$(echo "lock
|
||||
sleep" | ${my-deps.menu})
|
||||
case $res in
|
||||
lock) swaylock;;
|
||||
sleep) systemctl suspend;;
|
||||
esac
|
||||
'';
|
||||
hotkeys = [
|
||||
{key = "Z";}
|
||||
];
|
||||
install = false;
|
||||
}
|
||||
];
|
||||
}
|
||||
|
|
@ -15,61 +15,10 @@ let
|
|||
jq = "${pkgs.jq}/bin/jq";
|
||||
hyprctl = "${pkgs.hyprland}/bin/hyprctl";
|
||||
xargs = "${pkgs.findutils}/bin/xargs";
|
||||
menu = "${pkgs.wofi}/bin/wofi --dmenu";
|
||||
menu = "${config.programs.menu.package}${config.programs.menu.dmenuCommand}";
|
||||
fileman = "${pkgs.pcmanfm}/bin/pcmanfm";
|
||||
gawk = "${pkgs.gawk}/bin/awk";
|
||||
};
|
||||
my-scripts = {
|
||||
play-pause = (pkgs.writeShellScriptBin "play-pause" ''
|
||||
if [ "$(${my-deps.playerctl} --list-all | ${ my-deps.wc } -l)" -lt 2 ]
|
||||
then
|
||||
${my-deps.playerctl} play-pause
|
||||
else
|
||||
${ my-deps.playerctl } --list-all | \
|
||||
${ my-deps.xargs } -I _ ${ my-deps.playerctl } --player _ metadata --format '_ - {{title}}' | \
|
||||
${ my-deps.menu } | ${pkgs.gawk}/bin/awk '{print $1}' | \
|
||||
${ my-deps.xargs } -I _ ${ my-deps.playerctl } --player _ play-pause
|
||||
fi
|
||||
'');
|
||||
|
||||
bwotpmenu = (pkgs.writeShellScriptBin "bwotpmenu" ''
|
||||
items="$(rbw list)"
|
||||
echo "$items" | ${ my-deps.menu } | xargs -I_ rbw code _ | wl-copy
|
||||
'');
|
||||
|
||||
bwmenu = (pkgs.writeShellScriptBin "bwmenu" ''
|
||||
items="$(rbw list)"
|
||||
echo "$items" | ${ my-deps.menu } | xargs -I_ rbw get _ | wl-copy
|
||||
'');
|
||||
|
||||
screenshot = (pkgs.writeShellScriptBin "screenshot" ''
|
||||
OUT_DIR=~/Pictures/Screenshots
|
||||
mkdir -p "$OUT_DIR"
|
||||
FILE=$OUT_DIR/$(date +"%Y-%m-%dT%H:%M:%SZ").png
|
||||
|
||||
${ my-deps.grim } -g "$(${ my-deps.slurp } -o)" "$FILE"
|
||||
${my-deps.notify-send} "Screenshot Taken" "$FILE"
|
||||
|
||||
cat "$FILE" | wl-copy -t image/png
|
||||
'');
|
||||
|
||||
brightness-down = (pkgs.writeShellScriptBin "brightness-down" ''
|
||||
light -U $1
|
||||
${my-deps.notify-send} "Brightness" -h int:value:$(light) -a brightness-down -t 1000
|
||||
'');
|
||||
|
||||
brightness-up = (pkgs.writeShellScriptBin "brightness-up" ''
|
||||
light -A $1
|
||||
${my-deps.notify-send} "Brightness" -h int:value:$(light) -a brightness-up -t 1000
|
||||
'');
|
||||
|
||||
switch-window = (pkgs.writeShellScriptBin "switch-window" ''
|
||||
${my-deps.hyprctl} clients -j | \
|
||||
${my-deps.jq} '.[] | .title' -r | \
|
||||
${my-deps.menu} | \
|
||||
${my-deps.xargs} -I_ ${my-deps.hyprctl} dispatch focuswindow title:"_"
|
||||
'');
|
||||
};
|
||||
|
||||
lf-sixel = pkgs.callPackage ../../custom/lf-sixel/. { };
|
||||
in
|
||||
{
|
||||
|
|
@ -103,12 +52,13 @@ in
|
|||
quickemu
|
||||
bitwarden
|
||||
libsForQt5.kasts
|
||||
]) ++ (with my-scripts; [
|
||||
play-pause
|
||||
bwmenu
|
||||
screenshot
|
||||
brightness-up
|
||||
brightness-down
|
||||
libreoffice
|
||||
gimp
|
||||
(makeDesktopItem {
|
||||
name = "logseq";
|
||||
desktopName = "Logseq";
|
||||
exec = "${logseq}/bin/logseq --ozone-platform-hint=auto --enable-features=WaylandWindowDecorations --disable-gpu";
|
||||
})
|
||||
]);
|
||||
|
||||
programs.fish = {
|
||||
|
|
@ -168,17 +118,8 @@ in
|
|||
}
|
||||
}
|
||||
|
||||
bind = SUPER, RETURN, exec, ${ my-deps.terminal }
|
||||
bind = SUPER_SHIFT, Q, killactive,
|
||||
bind = SUPER_SHIFT, E, exit,
|
||||
bind = SUPER, d, exec, wofi --show drun
|
||||
bind = SUPER, Z, exec, ${pkgs.wlogout}/bin/wlogout
|
||||
bind = SUPER, M, exec, ${ my-deps.terminal } -e ncmpcpp
|
||||
bind = SUPER, O, exec, pcmanfm
|
||||
bind = SUPER, TAB, exec, ${ my-scripts.switch-window }/bin/switch-window
|
||||
bind = SUPER, G, exec, ${ pkgs.hyprpicker }/bin/hyprpicker | wl-copy && notify-send "Copied Colour" "$(wl-paste)"
|
||||
bind = SUPER, EQUAL, exec, hyprctl keyword misc:cursor_zoom_factor 2
|
||||
bind = SUPER, MINUS, exec, hyprctl keyword misc:cursor_zoom_factor 1
|
||||
bind = SUPER, SLASH, focuswindow, brave-browser
|
||||
bind = SUPER, n, focuswindow, Logseq
|
||||
|
||||
|
|
@ -202,20 +143,6 @@ in
|
|||
bind = SUPER, Y, togglespecialworkspace
|
||||
bind = SUPER_SHIFT, Y, movetoworkspace, special
|
||||
|
||||
bind = SUPER, P, exec,${ my-scripts.bwmenu }/bin/bwmenu
|
||||
bind = SUPER_SHIFT, P, exec,${ my-scripts.bwotpmenu }/bin/bwotpmenu
|
||||
bind = SUPER_SHIFT, S, exec,${ my-scripts.screenshot }/bin/screenshot
|
||||
|
||||
bind =,XF86AudioRaiseVolume, exec,${ my-deps.amixer } sset Master 5%+ && ${ my-deps.amixer } sset Master unmute
|
||||
bind =,XF86AudioLowerVolume, exec,${ my-deps.amixer } sset Master 5%-
|
||||
bind =,XF86AudioPlay, exec,${ my-scripts.play-pause }/bin/play-pause
|
||||
bind =,XF86AudioNext, exec,${ my-deps.playerctl } next
|
||||
bind =,XF86AudioPrev, exec,${ my-deps.playerctl } previous
|
||||
bind =,XF86MonBrightnessUp, exec,${ my-scripts.brightness-up }/bin/brightness-up 10
|
||||
bind =,XF86MonBrightnessDown, exec,${ my-scripts.brightness-down }/bin/brightness-down 10
|
||||
bind =SHIFT,XF86MonBrightnessUp, exec,${ my-scripts.brightness-up }/bin/brightness-up 1
|
||||
bind =SHIFT,XF86MonBrightnessDown, exec,${ my-scripts.brightness-down }/bin/brightness-down 1
|
||||
|
||||
bind = SUPER,1,workspace,1
|
||||
bind = SUPER,2,workspace,2
|
||||
bind = SUPER,3,workspace,3
|
||||
|
|
@ -310,7 +237,7 @@ in
|
|||
status-icons = {
|
||||
paused = "⏸️";
|
||||
};
|
||||
on-click = "${my-scripts.play-pause}/bin/play-pause";
|
||||
# on-click = "${my-scripts.play-pause}/bin/play-pause";
|
||||
};
|
||||
battery = {
|
||||
format = "{icon} {capacity}%";
|
||||
|
|
@ -397,8 +324,6 @@ in
|
|||
pkgs.mpvScripts.mpris
|
||||
];
|
||||
|
||||
programs.foot.enable = true;
|
||||
programs.foot.server.enable = true;
|
||||
programs.foot.settings = {
|
||||
main = {
|
||||
term = "xterm-256color";
|
||||
|
|
@ -568,24 +493,10 @@ in
|
|||
;;
|
||||
esac
|
||||
'';
|
||||
|
||||
programs.wofi = {
|
||||
enable = true;
|
||||
settings = {
|
||||
term = "foot";
|
||||
};
|
||||
};
|
||||
home.file.".icons/default".source = "${pkgs.vanilla-dmz}/share/icons/Vanilla-DMZ";
|
||||
|
||||
programs.librewolf.enable = true;
|
||||
|
||||
programs.git = {
|
||||
enable = true;
|
||||
aliases = {
|
||||
graph = "log --oneline --all --graph";
|
||||
amend = "commit --amend --no-edit";
|
||||
};
|
||||
};
|
||||
|
||||
programs.helix = {
|
||||
enable = true;
|
||||
|
|
@ -891,14 +802,14 @@ color body red default "([a-z][a-z0-9+-]*://(((([a-z0-9_.!~*'();:&=+$,-]|%[0-9a-
|
|||
"${modifier}+o" = "exec ${my-deps.fileman}";
|
||||
XF86AudioRaiseVolume = "exec ${ my-deps.amixer } sset Master 5%+ && ${ my-deps.amixer } sset Master unmute";
|
||||
XF86AudioLowerVolume = "exec ${ my-deps.amixer } sset Master 5%-";
|
||||
XF86AudioPlay = "exec ${ my-scripts.play-pause }/bin/play-pause";
|
||||
# XF86AudioPlay = "exec ${ my-scripts.play-pause }/bin/play-pause";
|
||||
XF86AudioNext = "exec ${ my-deps.playerctl } next";
|
||||
XF86AudioPrev = "exec ${ my-deps.playerctl } previous";
|
||||
XF86MonBrightnessUp = "exec ${ my-scripts.brightness-up }/bin/brightness-up";
|
||||
XF86MonBrightnessDown = "exec ${ my-scripts.brightness-down }/bin/brightness-down";
|
||||
"${modifier}+P" = "exec ${ my-scripts.bwmenu }/bin/bwmenu";
|
||||
"${modifier}+SHIFT+P" = "exec ${ my-scripts.bwotpmenu }/bin/bwotpmenu";
|
||||
"${modifier}+SHIFT+S" = "exec ${ my-scripts.screenshot }/bin/screenshot";
|
||||
# XF86MonBrightnessUp = "exec ${ my-scripts.brightness-up }/bin/brightness-up";
|
||||
# XF86MonBrightnessDown = "exec ${ my-scripts.brightness-down }/bin/brightness-down";
|
||||
# "${modifier}+P" = "exec ${ my-scripts.bwmenu }/bin/bwmenu";
|
||||
# "${modifier}+SHIFT+P" = "exec ${ my-scripts.bwotpmenu }/bin/bwotpmenu";
|
||||
# "${modifier}+SHIFT+S" = "exec ${ my-scripts.screenshot }/bin/screenshot";
|
||||
"${modifier}+M" = "exec ${ my-deps.terminal } -e ncmpcpp";
|
||||
"${modifier}+Z" = "exec ${pkgs.swaylock-effects}/bin/swaylock -f";
|
||||
};
|
||||
|
|
|
|||
|
|
@ -3,54 +3,4 @@
|
|||
{
|
||||
# don't change
|
||||
home.stateVersion = "22.05";
|
||||
|
||||
home.packages = with pkgs; [
|
||||
sbctl
|
||||
gimp
|
||||
libreoffice
|
||||
(pkgs.makeDesktopItem {
|
||||
name = "logseq";
|
||||
desktopName = "Logseq";
|
||||
exec = "${logseq}/bin/logseq --ozone-platform-hint=auto --enable-features=WaylandWindowDecorations --disable-gpu";
|
||||
})
|
||||
];
|
||||
|
||||
programs.git = {
|
||||
userName = "Tristan Beedell";
|
||||
userEmail = "tristan.beedell@cryoserver.com";
|
||||
};
|
||||
|
||||
wayland.windowManager.hyprland = {
|
||||
extraConfig = ''
|
||||
## work laptop configuration
|
||||
exec-once = ${pkgs.swaybg}/bin/swaybg -o eDP-1 -i ~/Pictures/backgrounds/nix-soft.png &
|
||||
|
||||
general {
|
||||
gaps_out = 10
|
||||
border_size = 3
|
||||
}
|
||||
bind = SUPER, E, focuswindow, thunderbird
|
||||
bind = SUPER, t, focuswindow, brave-cifhbcnohmdccbgoicgdjpfamggdegmo-Profile_2
|
||||
'';
|
||||
};
|
||||
|
||||
programs.firefox.enable = true;
|
||||
|
||||
# wayland.windowManager.hyprland.enable = lib.mkForce false;
|
||||
# wayland.windowManager.sway.enable = true;
|
||||
# wayland.windowManager.sway.package = pkgs.swayfx;
|
||||
wayland.windowManager.sway.config = {
|
||||
input = {
|
||||
"type:keyboard" = {
|
||||
xkb_variant = "dvorak";
|
||||
};
|
||||
};
|
||||
output = {
|
||||
eDP-1 = {
|
||||
scale = "1.2";
|
||||
bg = "~/Pictures/backgrounds/nix-wallpaper-watersplash.png fill";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,53 +19,11 @@
|
|||
#gamer
|
||||
airshipper
|
||||
minetest
|
||||
|
||||
(pkgs.writeShellScriptBin "my-editor" ''
|
||||
codium $@
|
||||
'')
|
||||
];
|
||||
|
||||
services.nextcloud-client.enable = true;
|
||||
services.nextcloud-client.startInBackground = true;
|
||||
|
||||
programs.git = {
|
||||
userName = "tristan";
|
||||
userEmail = "tristan@tristans.cloud";
|
||||
};
|
||||
|
||||
accounts.email.accounts."tristan@tristans.cloud" = {
|
||||
notmuch.enable = true;
|
||||
neomutt.enable = true;
|
||||
aerc.enable = true;
|
||||
mbsync.enable = true;
|
||||
mbsync.create = "both";
|
||||
userName = "tristan@tristans.cloud";
|
||||
realName = "Tristan";
|
||||
address = "tristan@tristans.cloud";
|
||||
primary = true;
|
||||
passwordCommand = "${pkgs.rbw}/bin/rbw get privateemail";
|
||||
smtp = {
|
||||
host = "mail.privateemail.com";
|
||||
port = 465;
|
||||
tls.enable = true;
|
||||
};
|
||||
imap = {
|
||||
host = "mail.privateemail.com";
|
||||
port = 993;
|
||||
tls.enable = true;
|
||||
};
|
||||
};
|
||||
|
||||
programs.notmuch.enable = true;
|
||||
programs.neomutt = {
|
||||
enable = true;
|
||||
vimKeys = true;
|
||||
sort = "reverse-date";
|
||||
sidebar.enable = true;
|
||||
};
|
||||
programs.mbsync.enable = true;
|
||||
services.mbsync.enable = true;
|
||||
programs.aerc.enable = true;
|
||||
|
||||
wayland.windowManager.hyprland = {
|
||||
extraConfig = ''
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue