This commit is contained in:
Patrick Großmann 2023-10-15 18:34:34 +02:00
parent 23fe1c2efa
commit 060cde1148
Signed by: patrick
GPG key ID: 451F95EFB8BECD0F
6 changed files with 436 additions and 159 deletions

View file

@ -89,6 +89,118 @@
"type": "github"
}
},
"base16-alacritty": {
"flake": false,
"locked": {
"lastModified": 1674275109,
"narHash": "sha256-Adwx9yP70I6mJrjjODOgZJjt4OPPe8gJu7UuBboXO4M=",
"owner": "aarowill",
"repo": "base16-alacritty",
"rev": "63d8ae5dfefe5db825dd4c699d0cdc2fc2c3eaf7",
"type": "github"
},
"original": {
"owner": "aarowill",
"repo": "base16-alacritty",
"type": "github"
}
},
"base16-fish": {
"flake": false,
"locked": {
"lastModified": 1622559957,
"narHash": "sha256-PebymhVYbL8trDVVXxCvZgc0S5VxI7I1Hv4RMSquTpA=",
"owner": "tomyun",
"repo": "base16-fish",
"rev": "2f6dd973a9075dabccd26f1cded09508180bf5fe",
"type": "github"
},
"original": {
"owner": "tomyun",
"repo": "base16-fish",
"type": "github"
}
},
"base16-foot": {
"flake": false,
"locked": {
"lastModified": 1696725948,
"narHash": "sha256-65bz2bUL/yzZ1c8/GQASnoiGwaF8DczlxJtzik1c0AU=",
"owner": "tinted-theming",
"repo": "base16-foot",
"rev": "eedbcfa30de0a4baa03e99f5e3ceb5535c2755ce",
"type": "github"
},
"original": {
"owner": "tinted-theming",
"repo": "base16-foot",
"type": "github"
}
},
"base16-helix": {
"flake": false,
"locked": {
"lastModified": 1696727917,
"narHash": "sha256-FVrbPk+NtMra0jtlC5oxyNchbm8FosmvXIatkRbYy1g=",
"owner": "tinted-theming",
"repo": "base16-helix",
"rev": "dbe1480d99fe80f08df7970e471fac24c05f2ddb",
"type": "github"
},
"original": {
"owner": "tinted-theming",
"repo": "base16-helix",
"type": "github"
}
},
"base16-kitty": {
"flake": false,
"locked": {
"lastModified": 1665001328,
"narHash": "sha256-aRaizTYPpuWEcvoYE9U+YRX+Wsc8+iG0guQJbvxEdJY=",
"owner": "kdrag0n",
"repo": "base16-kitty",
"rev": "06bb401fa9a0ffb84365905ffbb959ae5bf40805",
"type": "github"
},
"original": {
"owner": "kdrag0n",
"repo": "base16-kitty",
"type": "github"
}
},
"base16-tmux": {
"flake": false,
"locked": {
"lastModified": 1696725902,
"narHash": "sha256-wDPg5elZPcQpu7Df0lI5O8Jv4A3T6jUQIVg63KDU+3Q=",
"owner": "tinted-theming",
"repo": "base16-tmux",
"rev": "c02050bebb60dbb20cb433cd4d8ce668ecc11ba7",
"type": "github"
},
"original": {
"owner": "tinted-theming",
"repo": "base16-tmux",
"type": "github"
}
},
"base16-vim": {
"flake": false,
"locked": {
"lastModified": 1663659192,
"narHash": "sha256-uJvaYYDMXvoo0fhBZUhN8WBXeJ87SRgof6GEK2efFT0=",
"owner": "chriskempson",
"repo": "base16-vim",
"rev": "3be3cd82cd31acfcab9a41bad853d9c68d30478d",
"type": "github"
},
"original": {
"owner": "chriskempson",
"repo": "base16-vim",
"type": "github"
}
},
"crane": {
"inputs": {
"flake-compat": [
@ -196,11 +308,11 @@
]
},
"locked": {
"lastModified": 1696814493,
"narHash": "sha256-1qArVsJGG2RHbV2iKFpAmM5os3myvwpXMOdFy5nh54M=",
"lastModified": 1697230660,
"narHash": "sha256-Faw7qTLNVZYxW1nBHKhfrKY0lOicJaxxHh5u/Gq4M3Q=",
"owner": "nix-community",
"repo": "disko",
"rev": "32ce057c183506cecb0b84950e4eaf39f37e8c75",
"rev": "6ad5c9c17cbd5514ce0cc2692dd82dd6d8e5d879",
"type": "github"
},
"original": {
@ -527,11 +639,11 @@
]
},
"locked": {
"lastModified": 1696737557,
"narHash": "sha256-YD/pjDjj/BNmisEvRdM/vspkCU3xyyeGVAUWhvVSi5Y=",
"lastModified": 1697371398,
"narHash": "sha256-Tn5feZ5SoYHQM9BTjw5e06DuNu8wc21gC9+bq/kXA8Y=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "3c1d8758ac3f55ab96dcaf4d271c39da4b6e836d",
"rev": "3b67ae3f665379c06999641f99d94dba75b53876",
"type": "github"
},
"original": {
@ -563,11 +675,11 @@
},
"impermanence": {
"locked": {
"lastModified": 1694622745,
"narHash": "sha256-z397+eDhKx9c2qNafL1xv75lC0Q4nOaFlhaU1TINqb8=",
"lastModified": 1697303681,
"narHash": "sha256-caJ0rXeagaih+xTgRduYtYKL1rZ9ylh06CIrt1w5B4g=",
"owner": "nix-community",
"repo": "impermanence",
"rev": "e9643d08d0d193a2e074a19d4d90c67a874d932e",
"rev": "0f317c2e9e56550ce12323eb39302d251618f5b5",
"type": "github"
},
"original": {
@ -609,11 +721,11 @@
"nixpkgs-lib": "nixpkgs-lib"
},
"locked": {
"lastModified": 1696766909,
"narHash": "sha256-lU1BmCWpQ9cx64YnJKc89lMg9cx4pCokXIbh5J//2t0=",
"lastModified": 1697371715,
"narHash": "sha256-1ZV4qoL1B35DsciS/inC+z6vAwjxjWHL3+4G4QQhT0A=",
"owner": "nix-community",
"repo": "lib-aggregate",
"rev": "9f495e4feea66426589cbb59ac8b972993b5d872",
"rev": "af42578368ca0c97d5836ba55b146745911aaecc",
"type": "github"
},
"original": {
@ -649,11 +761,11 @@
]
},
"locked": {
"lastModified": 1696736548,
"narHash": "sha256-Dg0gJ9xVXud55sAbXspMapFYZOpVAldQQo7MFp91Vb0=",
"lastModified": 1697340827,
"narHash": "sha256-XlrR68N7jyaZ0bs8TPrhqcWG0IPG3pbjrKzJMpYOsos=",
"owner": "nix-community",
"repo": "nix-index-database",
"rev": "2902dc66f64f733bfb45754e984e958e9fe7faf9",
"rev": "29977d0796c058bbcfb2df5b18eb5badf1711007",
"type": "github"
},
"original": {
@ -700,11 +812,11 @@
},
"nixos-hardware": {
"locked": {
"lastModified": 1696614066,
"narHash": "sha256-nAyYhO7TCr1tikacP37O9FnGr2USOsVBD3IgvndUYjM=",
"lastModified": 1697100850,
"narHash": "sha256-qSAzJVzNRIo+r3kBjL8TcpJctcgcHlnZyqdzpWgtg0M=",
"owner": "nixos",
"repo": "nixos-hardware",
"rev": "bb2db418b616fea536b1be7f6ee72fb45c11afe0",
"rev": "fb6af288f6cf0f00d3af60cf9d5110433b954565",
"type": "github"
},
"original": {
@ -715,11 +827,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1696604326,
"narHash": "sha256-YXUNI0kLEcI5g8lqGMb0nh67fY9f2YoJsILafh6zlMo=",
"lastModified": 1697059129,
"narHash": "sha256-9NJcFF9CEYPvHJ5ckE8kvINvI84SZZ87PvqMbH6pro0=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "87828a0e03d1418e848d3dd3f3014a632e4a4f64",
"rev": "5e4c2ada4fcd54b99d56d7bd62f384511a7e2593",
"type": "github"
},
"original": {
@ -731,11 +843,11 @@
},
"nixpkgs-lib": {
"locked": {
"lastModified": 1696726172,
"narHash": "sha256-89yxFXzTA7JRyWo6hg7SD4DlS/ejYt8Y8IvGZHbSWsg=",
"lastModified": 1697331025,
"narHash": "sha256-a5LJWWHfEvnq9tBd9UyNVdtzLXc2ehu5MCp//Bex/0E=",
"owner": "nix-community",
"repo": "nixpkgs.lib",
"rev": "59da6ac0c02c48aa92dee37057f978412797db2a",
"rev": "05c07c73de74725ec7efa6609011687035a92c0f",
"type": "github"
},
"original": {
@ -802,11 +914,11 @@
]
},
"locked": {
"lastModified": 1696843042,
"narHash": "sha256-2ykZDYtBaFXWc4zHUEknecBSIOM0e7CUKqMHNZPKlbU=",
"lastModified": 1697372844,
"narHash": "sha256-Ut7Bojh7SqNf2pKRIoGPWWRU9ZjvSxSJS+GByC8AHD0=",
"owner": "nix-community",
"repo": "nixpkgs-wayland",
"rev": "4c7744c36f1f53a42da3c303ebdd05a668269a18",
"rev": "3bd7c4e831bc3dc82828e179397b06652adf2878",
"type": "github"
},
"original": {
@ -1054,16 +1166,23 @@
"stylix": {
"inputs": {
"base16": "base16",
"base16-alacritty": "base16-alacritty",
"base16-fish": "base16-fish",
"base16-foot": "base16-foot",
"base16-helix": "base16-helix",
"base16-kitty": "base16-kitty",
"base16-tmux": "base16-tmux",
"base16-vim": "base16-vim",
"flake-compat": "flake-compat_5",
"home-manager": "home-manager_2",
"nixpkgs": "nixpkgs_5"
},
"locked": {
"lastModified": 1694375893,
"narHash": "sha256-oJGESNjJ/6o6tfuUavBZ7go4Oun7g9YKv7OqaQaY/80=",
"lastModified": 1697094532,
"narHash": "sha256-SvTC0wNCGpoUBvo9//IoTv5NQjozY0Y5ViTziRO+vt8=",
"owner": "danth",
"repo": "stylix",
"rev": "c3c9f4784b4f08f6676340126858d936edbce1fa",
"rev": "feceaa9d81725c0ca28ab46326b6dd1310a10dea",
"type": "github"
},
"original": {
@ -1210,11 +1329,11 @@
]
},
"locked": {
"lastModified": 1683104317,
"narHash": "sha256-TfPrY+sqCKfRiBhO3oz0t/i9IGcTuGGQMKhkD+LpMys=",
"lastModified": 1697336859,
"narHash": "sha256-1R8lPIH82OgrBchW5RGkJMB0NzH9cChljmGOFLoS748=",
"owner": "Toqozz",
"repo": "wired-notify",
"rev": "73bb26863ed3272e0d524424685bd53a70db25e4",
"rev": "0fe5cc4682c30b178dfb2c9c0e3ad19d20d0bc6f",
"type": "github"
},
"original": {

View file

@ -40,6 +40,6 @@
};
services.xserver = {
layout = "de";
xkbVariant = "neo";
xkbVariant = "bone";
};
}

View file

@ -58,6 +58,7 @@
killall
fd
kitty.terminfo
nvd
];
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";

View file

@ -72,10 +72,14 @@
(
exec > >(trap "" INT TERM; sed "s/^/$1: /")
exec 2> >(trap "" INT TERM; sed "s/^/$1: /" >&2)
prev_system=$(ssh "$host" -- readlink -e /nix/var/nix/profiles/system)
ssh "$1" -- /run/current-system/sw/bin/nix-env --profile /nix/var/nix/profiles/system --set "$top_level" \
|| die "Error registering toplevel$1"
|| die "Error registering toplevel $1"
ssh "$1" -- "$top_level/bin/switch-to-configuration" "$ACTION" \
|| die "Error activating toplevel for $1"
if [[ -n "$prev_system" ]]; then
ssh "$1" -- nvd --color always diff "$prev_system" "$top_level"
fi
)
}

View file

@ -1,8 +1,4 @@
{
pkgs,
config,
...
}: {
{pkgs, ...}: {
imports = [
#./deadd
./themes.nix

View file

@ -57,26 +57,6 @@
};
};
# Reusable blocks
mkRootBlock = name: {
name = "${name}_root";
parent = "";
hook = mkHook "TR" "TR";
offset = Vec2 (-50) 50; # Vec2 instead of mkVec2 to not apply scaling.
params = struct "NotificationBlock" (unnamedStruct {
monitor = 0;
border_width = globalScale * 2;
border_rounding = globalScale * 0;
background_color = colors.base00;
border_color = colors.base04;
border_color_low = colors.base04;
border_color_critical = colors.base08;
border_color_paused = colors.base09;
gap = mkVec2 0 8;
notification_hook = mkHook "BR" "TR";
});
};
mkTopBar = name: extra:
map (x: extra // x) [
{
@ -141,7 +121,7 @@
font = "${fonts.sansSerif.name} Bold ${toString (globalScale * 16)}";
ellipsize = mkLiteral "End";
color = colors.base06;
padding = mkPaddingLrBt 16 16 0 8;
padding = mkPaddingLrBt 16 16 12 8;
dimensions = mkDimensionsWH (maxWFull - summaryRightPadding) (maxWFull - summaryRightPadding) 0 30;
dimensions_image_hint = mkDimensionsWH (maxWImg - summaryRightPadding) (maxWImg - summaryRightPadding) 0 30;
dimensions_image_both = mkDimensionsWH (maxWImg - summaryRightPadding) (maxWImg - summaryRightPadding) 0 30;
@ -151,7 +131,7 @@
name = "${name}_${ident}_body";
parent = "${name}_${ident}_summary";
hook = mkHook "BL" "TL";
offset = mkVec2 0 12;
offset = mkVec2 0 0;
render_criteria = [
(And [
(Or extra.render_criteria)
@ -163,7 +143,7 @@
font = "${fonts.sansSerif.name} ${toString (globalScale * 16)}";
ellipsize = mkLiteral "End";
color = colors.base06;
padding = mkPaddingLrBt 16 16 12 0;
padding = mkPaddingLrBt 16 16 12 (-4);
dimensions = mkDimensionsWH maxWFull maxWFull 0 88;
dimensions_image_hint = mkDimensionsWH maxWImg maxWImg 0 88;
dimensions_image_both = mkDimensionsWH maxWImg maxWImg 0 88;
@ -174,7 +154,7 @@
# on the specific name for the parent, which cannot be changed dynamically.
# So each call to mkBody creates these progress bars which only differ in
# their parent :/
++ (mkProgress name "${ident}_hint" 0 {
++ (mkProgress name "${ident}_hint" (-4) {
render_criteria = [
(And (extra.render_criteria
++ [
@ -193,7 +173,7 @@
]))
];
})
++ (mkProgress name "${ident}_summary" 9 {
++ (mkProgress name "${ident}_summary" 0 {
render_criteria = [
(And (extra.render_criteria
++ [
@ -209,7 +189,7 @@
# Each mkProgress includes a button bar. But if no progress is included in a notification,
# those won't be rendered, so we have to define bars for non-progress notifications.
# (And yes, we need 3 because we cannot have duplicate names or dynamic parents)
++ (mkButtonBar name "${ident}_hint" 0 {
++ (mkButtonBar name "${ident}_hint" {
render_criteria = [
(And (extra.render_criteria
++ [
@ -218,7 +198,7 @@
]))
];
})
++ (mkButtonBar name "${ident}_body" (-8) {
++ (mkButtonBar name "${ident}_body" {
render_criteria = [
(And (extra.render_criteria
++ [
@ -228,7 +208,7 @@
]))
];
})
++ (mkButtonBar name "${ident}_summary" 0 {
++ (mkButtonBar name "${ident}_summary" {
render_criteria = [
(And (extra.render_criteria
++ [
@ -267,34 +247,28 @@
hook = mkHook "BL" "TL";
offset = mkVec2 0 0;
params = struct "ProgressBlock" (unnamedStruct {
width = globalScale * 510;
width = globalScale * 524;
height = globalScale * 12;
border_width = 0.0;
border_rounding = globalScale * 6;
border_rounding = globalScale * 4;
border_color = colors.base03;
background_color = colors.base03;
fill_color = colors.base0D;
fill_rounding = globalScale * 6;
fill_rounding = globalScale * 4;
padding = mkPaddingLrBt 68 16 12 (yOffset + 8);
});
}
]
++ (mkButtonBar name "progress_${parent}_text" (
/*
ignore bottom end padding
*/
-8
)
extra)
++ (mkButtonBar name "progress_${parent}_text" extra)
);
mkButtonBar = name: parent: yOffset: extra:
mkButtonBar = name: parent: extra:
map (x: extra // x) (lib.flatten [
{
name = "${name}_button_bar_for_${parent}";
parent = "${name}_${parent}";
hook = mkHook "BL" "TL";
offset = mkVec2 0 yOffset;
offset = mkVec2 0 0;
render_criteria = [
(And (extra.render_criteria
++ [
@ -310,10 +284,10 @@
];
params = struct "TextBlock" (unnamedStruct {
text = "";
font = "${fonts.monospace.name} ${toString (globalScale * 14)}";
font = "${fonts.monospace.name} 1";
color = colors.base06;
padding = mkPaddingLrBt 0 0 0 0;
dimensions = mkDimensionsWH 568 568 56 48;
dimensions = mkDimensionsWH 568 568 44 44;
});
}
(lib.flip map [0 1 2 3 4 5] (
@ -321,7 +295,7 @@
lib.optionalAttrs (i == 0) {
parent = "${name}_button_bar_for_${parent}";
hook = mkHook "TL" "TL";
offset = mkVec2 16 12;
offset = mkVec2 16 0;
}
// lib.optionalAttrs (i != 0) {
parent = "${name}_action_${toString (i - 1)}_for_${parent}";
@ -365,6 +339,43 @@
}
))
]);
mkIndicatorValue = name: ident: parent: extra: textParamsExtra: progressParamsExtra:
map (x: extra // x) (lib.flatten [
{
name = "${name}_${ident}_value_text";
parent = "${name}_${parent}";
hook = mkHook "BM" "TM";
offset = mkVec2 0 0;
params = struct "TextBlock" (unnamedStruct ({
text = "%p%";
font = "${fonts.monospace.name} Bold ${toString (globalScale * 18)}";
align = mkLiteral "Center";
color = colors.base06;
padding = mkPaddingLrBt 0 0 12 0;
dimensions = mkDimensionsWH 64 64 32 32;
}
// textParamsExtra));
}
{
name = "${name}_${ident}_value_bar";
parent = "${name}_${ident}_value_text";
hook = mkHook "BM" "TM";
offset = mkVec2 0 0;
params = struct "ProgressBlock" (unnamedStruct ({
width = globalScale * 0.90 * 384;
height = globalScale * 16;
border_width = 0.0;
border_rounding = globalScale * 6;
border_color = colors.base03;
background_color = colors.base03;
fill_color = colors.base0F;
fill_rounding = globalScale * 6;
padding = mkPaddingLrBt 0 0 0 0;
}
// progressParamsExtra));
}
]);
in
format.generate "wired.ron" (unnamedStruct {
max_notifications = 10;
@ -373,8 +384,8 @@
history_length = 60;
replacing_enabled = true;
replacing_resets_timeout = true;
min_window_width = floor (globalScale * 600);
min_window_height = floor (globalScale * 60);
min_window_width = floor (globalScale * 20);
min_window_height = floor (globalScale * 20);
debug = false;
# https://github.com/Toqozz/wired-notify/wiki/Shortcuts
@ -395,13 +406,50 @@
];
in
map unnamedStruct (lib.flatten [
(mkRootBlock "general")
# Root block for normal notifications
{
name = "general_root";
parent = "";
hook = mkHook "TR" "TR";
offset = Vec2 (-50) 50; # Vec2 instead of mkVec2 to not apply scaling.
render_criteria = [
(Not (Or [
(struct "Tag" "indicator")
]))
];
params = struct "NotificationBlock" (unnamedStruct {
monitor = 1;
border_width = globalScale * 2;
border_rounding = globalScale * 0;
background_color = colors.base00;
border_color = colors.base04;
border_color_low = colors.base04;
border_color_critical = colors.base08;
border_color_paused = colors.base09;
gap = mkVec2 0 8;
notification_hook = mkHook "BR" "TR";
});
}
# Dummy text that enforces minimum window size
{
name = "general_size";
parent = "general_root";
hook = mkHook "TL" "TL";
offset = Vec2 0 0;
params = struct "TextBlock" (unnamedStruct {
text = "";
font = "${fonts.monospace.name} 1";
color = colors.base06;
padding = mkPaddingLrBt 0 0 0 0;
dimensions = mkDimensionsWH 600 600 1 1;
});
}
# Time is always shown in the top right corner.
{
name = "general_time";
parent = "general_root";
hook = mkHook "TR" "TR";
offset = mkVec2 0 0;
hook = mkHook "TL" "TL";
offset = mkVec2 (600 - 100) 0;
params = struct "TextBlock" (unnamedStruct {
color = colors.base05;
dimensions = mkDimensionsWH 100 100 28 28;
@ -424,6 +472,115 @@
(mkBody "general" "withtop" 36 0 {
render_criteria = [criterionHasTopBar];
})
# Root block for brightness/volume indicators
{
name = "indicator_root";
parent = "";
hook = mkHook "MM" "MM";
offset = Vec2 0 0; # Vec2 instead of mkVec2 to not apply scaling.
render_criteria = [
(And [
(struct "Tag" "indicator")
])
];
params = struct "NotificationBlock" (unnamedStruct {
monitor = 1;
border_width = globalScale * 2;
border_rounding = globalScale * 0;
background_color = colors.base00;
border_color = colors.base04;
border_color_low = colors.base04;
border_color_critical = colors.base08;
border_color_paused = colors.base09;
gap = mkVec2 0 0;
notification_hook = mkHook "MM" "MM";
});
}
# Dummy text that enforces minimum window size
{
name = "indicator_size";
parent = "indicator_root";
hook = mkHook "TL" "TL";
offset = Vec2 0 0;
params = struct "TextBlock" (unnamedStruct {
text = "";
font = "${fonts.monospace.name} 1";
color = colors.base06;
padding = mkPaddingLrBt 0 0 0 0;
dimensions = mkDimensionsWH 384 384 384 384;
});
}
{
name = "indicator_summary";
parent = "indicator_size";
hook = mkHook "TM" "TM";
offset = mkVec2 0 0;
params = struct "TextBlock" (unnamedStruct {
text = "%s";
font = "${fonts.sansSerif.name} Bold ${toString (globalScale * 18)}";
align = mkLiteral "Center";
color = colors.base06;
padding = mkPaddingLrBt 0 0 8 8;
dimensions = mkDimensionsWH 300 300 32 32;
});
}
{
name = "indicator_hint";
parent = "indicator_summary";
hook = mkHook "BM" "TM";
offset = mkVec2 0 0;
params = struct "ImageBlock" (unnamedStruct {
filter_mode = mkLiteral "Lanczos3";
image_type = mkLiteral "Hint";
min_height = floor (globalScale * 180);
min_width = floor (globalScale * 180);
padding = mkPaddingLrBt 0 0 (35 + 8) 35;
rounding = globalScale * 9;
scale_height = floor (globalScale * 180);
scale_width = floor (globalScale * 180);
});
}
(
mkIndicatorValue "indicator" "anything" "hint" {
render_criteria = [
(Not (Or [
(struct "Note" "brightness")
(struct "Note" "volume")
]))
];
}
# text extra
{}
# progress extra
{}
)
(mkIndicatorValue "indicator" "brightness" "hint" {
render_criteria = [
(And [
(struct "Note" "brightness")
])
];
}
# text extra
{}
# progress extra
{
fill_color = colors.base0A;
})
(mkIndicatorValue "indicator" "volume" "hint" {
render_criteria = [
(And [
(struct "Note" "volume")
])
];
}
# text extra
{}
# progress extra
{
fill_color = colors.base0B;
})
]);
});
};