flakfiy some Justfile recipes and experiment with wayland based custom desktop

This commit is contained in:
steveej 2023-05-21 11:58:57 +02:00
parent 06a47c0d23
commit 476e10780b
18 changed files with 739 additions and 149 deletions

View file

@ -1,112 +0,0 @@
{
pkgs,
config,
lib,
...
}: let
in {
services = {
gnome-keyring.enable = false;
blueman-applet.enable = true;
flameshot.enable = true;
};
# TODO: remove this comment once i'm sure everything works
# xdg.configFile."autostart/gnome-keyring-ssh.desktop".text = ''
# [Desktop Entry]
# Type=Application
# Hidden=true
# '';
services.gpg-agent.pinentryFlavor = "gnome3";
# workaround: usually created by 'home.xsession.enabled=true' and i don't use with gnome
systemd.user.targets.tray = {
Unit = {
Description = "Home Manager System Tray";
Requires = ["graphical-session-pre.target"];
};
};
home.packages = [
pkgs.wmctrl
];
home.sessionVariables.MOZ_ENABLE_WAYLAND = "1";
dconf.settings = let
manualKeybindings = [
{
binding = "Print";
command = "flameshot gui";
name = "flameshot";
}
{
binding = "<Super>t";
command = "alacritty";
name = "alacritty";
}
];
numWorkspaces = 10;
customKeybindingBaseName = "org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom";
customKeybindingsNames =
builtins.genList (i: "/${customKeybindingBaseName}${toString i}/")
(
(builtins.length manualKeybindings)
+ numWorkspaces # for sending to the workspace
);
workspacesKeyBindingsOffset = builtins.length manualKeybindings;
# with this we can make use of all number keys [0-9]
mapToNumber = i:
if i < 10
then i
else if i == 10
then 0
else throw "i exceeds 10: ${i}";
in
{
"org/gnome/settings-daemon/plugins/media-keys" = {
custom-keybindings = customKeybindingsNames;
screenreader = "@as []";
screensaver = ["<Alt><Super>l"];
};
# disable the builtin <Super>[1-9] functionality
"org/gnome/shell/keybindings" = builtins.listToAttrs (builtins.genList
(i: {
name = "switch-to-application-${toString (i + 1)}";
value = [];
})
numWorkspaces);
# remap it to switching to the workspaces
"org/gnome/desktop/wm/keybindings" = builtins.listToAttrs (builtins.genList
(i: {
name = "switch-to-workspace-${toString (i + 1)}";
value = [
"<Super>${toString (mapToNumber (i + 1))}"
];
})
numWorkspaces);
}
// builtins.listToAttrs (builtins.genList
(i: {
name = "${customKeybindingBaseName}${toString i}";
value = builtins.elemAt manualKeybindings i;
})
(builtins.length manualKeybindings))
// builtins.listToAttrs (builtins.genList
(i: {
name = "${customKeybindingBaseName}${toString (workspacesKeyBindingsOffset + i)}";
value = {
binding = "<Control><Super>${toString (mapToNumber (i + 1))}";
command = "wmctrl -r :ACTIVE: -t ${toString i}";
name = "Send to workspace ${toString (i + 1)}";
};
})
numWorkspaces);
}

View file

@ -1,3 +0,0 @@
{pkgs, ...}: {
home.packages = [pkgs.holochain-launcher];
}

View file

@ -5,5 +5,13 @@
programs.browserpass.enable = true;
home.packages = with pkgs; [pass rofi-pass gnupg];
home.packages = with pkgs; [
gnupg
pass
# broken on wayland
# rofi-pass
prs
];
}

View file

@ -32,28 +32,37 @@
old.propagatedBuildInputs
++ [radicale-storage-decsync];
});
radicale-config = pkgs.writeText "radicale-config" ''
[auth]
type = htpasswd
htpasswd_filename = ${
pkgs.writeText "radicale" ''
radicale:${passwords.users.radicale}
''
}
htpasswd_encryption = bcrypt
[storage]
type = radicale_storage_decsync
filesystem_folder = ${config.xdg.dataHome}/radicale
decsync_dir = ${config.xdg.dataHome}/decsync
'';
in {
systemd.user.services.radicale = {
Unit.Description = "Radicale with DecSync";
Service = {
ExecStart = "${radicale-decsync}/bin/radicale -C ${radicale-config}";
Restart = "on-failure";
mkRadicaleService = { suffix, port }: let
radicale-config = pkgs.writeText "radicale-config-${suffix}" ''
[server]
hosts = localhost:${builtins.toString(port)}
[auth]
type = htpasswd
htpasswd_filename = ${
pkgs.writeText "radicale" ''
radicale:${passwords.users.radicale}
''
}
htpasswd_encryption = bcrypt
[storage]
type = radicale_storage_decsync
filesystem_folder = ${config.xdg.dataHome}/radicale-${suffix}
decsync_dir = ${config.xdg.dataHome}/decsync-${suffix}
'';
in {
systemd.user.services."radicale-${suffix}" = {
Unit.Description = "Radicale with DecSync (${suffix})";
Service = {
ExecStart = "${radicale-decsync}/bin/radicale -C ${radicale-config}";
Restart = "on-failure";
};
Install.WantedBy = ["default.target"];
};
Install.WantedBy = ["default.target"];
};
}
in builtins.foldl' (sum: cur: lib.recursiveUpdate sum (mkRadicaleService cur)) {} [
{suffix = "personal"; port = 5232;}
{suffix = "family"; port = 5233;}
]

View file

@ -5,7 +5,7 @@
}: let
passwords = import ../../variables/passwords.crypt.nix;
in {
services.redshift = {
services.gammastep = {
enable = true;
inherit (passwords.location.stefan) longitude latitude;
temperature = {
@ -14,10 +14,9 @@ in {
};
tray = true;
settings = {
redshift = {
gammastep = {
brightness-day = 1.0;
brightness-night = 0.5;
adjustment-method = "randr";
};
};
};