Merge branch 'main' of ssh://forge.katzen.cafe:2222/schrottkatze/nix-configs

This commit is contained in:
Jade 2024-02-18 12:41:22 +01:00
commit ce96f657b1
No known key found for this signature in database
13 changed files with 167 additions and 144 deletions

View file

@ -29,8 +29,8 @@ with builtins; {
environment = { environment = {
systemPackages = with pkgs; [ systemPackages = with pkgs; [
pynitrokey # pynitrokey
nitrokey-app2 # nitrokey-app2
veracrypt veracrypt
@ -145,7 +145,7 @@ with builtins; {
opengl.enable = true; opengl.enable = true;
uinput.enable = true; uinput.enable = true;
bluetooth.enable = true; bluetooth.enable = true;
keyboard.uhk.enable = true; # keyboard.uhk.enable = true;
}; };
security.rtkit.enable = true; security.rtkit.enable = true;
@ -153,9 +153,6 @@ with builtins; {
users.users.jade = { users.users.jade = {
isNormalUser = true; isNormalUser = true;
extraGroups = ["wheel" "input" "uinput" "libvirtd" "adbusers" "dialout" "plugdev" "wireshark"]; extraGroups = ["wheel" "input" "uinput" "libvirtd" "adbusers" "dialout" "plugdev" "wireshark"];
packages = [
pkgs.marksman
];
openssh.authorizedKeys.keys = [ openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOaE8TFsIazpn4OnHvHcRpOFr9FfvMaWOiEjmHsmnAoE cardno:000F_70CD7D05" "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOaE8TFsIazpn4OnHvHcRpOFr9FfvMaWOiEjmHsmnAoE cardno:000F_70CD7D05"
]; ];

View file

@ -8,11 +8,11 @@
"nixpkgs": "nixpkgs" "nixpkgs": "nixpkgs"
}, },
"locked": { "locked": {
"lastModified": 1703950660, "lastModified": 1707923576,
"narHash": "sha256-GgynJdQ6KngwFBd4YbMYbwesyOiMTZAFymsStE0PSfM=", "narHash": "sha256-vch1hvgoB2TEl1+0J9h5uPkTrL4zNFUxE/razagkqQQ=",
"owner": "hercules-ci", "owner": "hercules-ci",
"repo": "arion", "repo": "arion",
"rev": "f295eabd25b7c894ab405be784e2a010f83fde55", "rev": "2b1fa9a8e9e40bb8e65a677c6fdd66dae4f4676e",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -49,11 +49,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1701473968, "lastModified": 1706830856,
"narHash": "sha256-YcVE5emp1qQ8ieHUnxt1wCZCC3ZfAS+SRRWZ2TMda7E=", "narHash": "sha256-a0NYyp+h9hlb7ddVz4LUn1vT/PLwqfrWYcHMvFB1xYg=",
"owner": "hercules-ci", "owner": "hercules-ci",
"repo": "flake-parts", "repo": "flake-parts",
"rev": "34fed993f1674c8d06d58b37ce1e0fe5eebcb9f5", "rev": "b253292d9c0a5ead9bc98c4e9a26c6312e27d69f",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -71,11 +71,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1696343447, "lastModified": 1701473968,
"narHash": "sha256-B2xAZKLkkeRFG5XcHHSXXcP7To9Xzr59KXeZiRf4vdQ=", "narHash": "sha256-YcVE5emp1qQ8ieHUnxt1wCZCC3ZfAS+SRRWZ2TMda7E=",
"owner": "hercules-ci", "owner": "hercules-ci",
"repo": "flake-parts", "repo": "flake-parts",
"rev": "c9afaba3dfa4085dbd2ccb38dfade5141e33d9d4", "rev": "34fed993f1674c8d06d58b37ce1e0fe5eebcb9f5",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -170,11 +170,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1701009247, "lastModified": 1704029560,
"narHash": "sha256-GuX16rzRze2y7CsewJLTV6qXkXWyEwp6VCZXi8HLruU=", "narHash": "sha256-a4Iu7x1OP+uSYpqadOu8VCPY+MPF3+f6KIi+MAxlgyw=",
"owner": "hercules-ci", "owner": "hercules-ci",
"repo": "hercules-ci-effects", "repo": "hercules-ci-effects",
"rev": "31b6cd7569191bfcd0a548575b0e2ef953ed7d09", "rev": "d5cbf433a6ae9cae05400189a8dbc6412a03ba16",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -190,11 +190,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1706221476, "lastModified": 1707919853,
"narHash": "sha256-T4b8YafVjHXvtDY8ARec1WrXO8uyyNZOpNgv9yoQy2M=", "narHash": "sha256-qxmBGDzutuJ/tsX4gp+Mr7fjxOZBbeT9ixhS5o4iFOw=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "c7ce343d9bf1a329056a4dd5b32ea8cc43b55e15", "rev": "043ba285c6dc20f36441d48525402bcb9743c498",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -226,7 +226,7 @@
"mac-brcm-fw": { "mac-brcm-fw": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1706552810, "lastModified": 1701034142,
"narHash": "sha256-+kW8ogc6DykjMVlrr+3vWKs9ZUdJ9EW72LbY7k/Qvh4=", "narHash": "sha256-+kW8ogc6DykjMVlrr+3vWKs9ZUdJ9EW72LbY7k/Qvh4=",
"path": "/home/jade/nix-configs/mac-brcm-fw", "path": "/home/jade/nix-configs/mac-brcm-fw",
"type": "path" "type": "path"
@ -329,11 +329,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1701436327, "lastModified": 1707689078,
"narHash": "sha256-tRHbnoNI8SIM5O5xuxOmtSLnswEByzmnQcGGyNRjxsE=", "narHash": "sha256-UUGmRa84ZJHpGZ1WZEBEUOzaPOWG8LZ0yPg1pdDF/yM=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "91050ea1e57e50388fa87a3302ba12d188ef723a", "rev": "f9d39fb9aff0efee4a3d5f4a6d7c17701d38a1d8",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -345,11 +345,11 @@
}, },
"nixpkgs-stable": { "nixpkgs-stable": {
"locked": { "locked": {
"lastModified": 1706098335, "lastModified": 1707786466,
"narHash": "sha256-r3dWjT8P9/Ah5m5ul4WqIWD8muj5F+/gbCdjiNVBKmU=", "narHash": "sha256-yLPfrmW87M2qt+8bAmwopJawa+MJLh3M9rUbXtpUc1o=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "a77ab169a83a4175169d78684ddd2e54486ac651", "rev": "01885a071465e223f8f68971f864b15829988504",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -466,11 +466,11 @@
}, },
"nixpkgs_8": { "nixpkgs_8": {
"locked": { "locked": {
"lastModified": 1705856552, "lastModified": 1707689078,
"narHash": "sha256-JXfnuEf5Yd6bhMs/uvM67/joxYKoysyE3M2k6T3eWbg=", "narHash": "sha256-UUGmRa84ZJHpGZ1WZEBEUOzaPOWG8LZ0yPg1pdDF/yM=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "612f97239e2cc474c13c9dafa0df378058c5ad8d", "rev": "f9d39fb9aff0efee4a3d5f4a6d7c17701d38a1d8",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -113,6 +113,15 @@
# Enable networking # Enable networking
networking.networkmanager.enable = true; networking.networkmanager.enable = true;
security.pam.services.jade.u2fAuth = true;
programs.i3lock.u2fSupport = true;
security.pam.u2f = {
enable = true;
cue = true;
control = "sufficient";
authFile = "/home/jade/.ssh/u2f_keys";
};
i18n.extraLocaleSettings = { i18n.extraLocaleSettings = {
LC_ADDRESS = "de_DE.UTF-8"; LC_ADDRESS = "de_DE.UTF-8";
LC_IDENTIFICATION = "de_DE.UTF-8"; LC_IDENTIFICATION = "de_DE.UTF-8";

View file

@ -98,7 +98,7 @@
}; };
}; };
hardware.keyboard.uhk.enable = true; # hardware.keyboard.uhk.enable = true;
hardware.enableRedistributableFirmware = true; hardware.enableRedistributableFirmware = true;
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [

View file

@ -4,7 +4,7 @@ test:
sudo nixos-rebuild test --flake . --impure sudo nixos-rebuild test --flake . --impure
build: build:
sudo nixos-rebuild switch --flake . --impure sudo nixos-rebuild switch --flake . --impure --fast
update: update:
nix flake update --commit-lock-file nix flake update --commit-lock-file

View file

@ -6,5 +6,6 @@
./flatpak.nix ./flatpak.nix
./firewall.nix ./firewall.nix
./git.nix ./git.nix
./kmscon.nix
]; ];
} }

View file

@ -55,8 +55,10 @@ in
xserver = { xserver = {
enable = true; enable = true;
xkb = {
layout = "us"; layout = "us";
xkbVariant = "altgr-intl"; variant = "altgr-intl";
};
libinput = { libinput = {
enable = true; enable = true;
@ -92,6 +94,10 @@ in
}; };
home-manager.users.jade = {pkgs, ...}: { home-manager.users.jade = {pkgs, ...}: {
programs.ssh = {
controlMaster = "yes";
};
programs.bat = { programs.bat = {
# TODO: more config # TODO: more config
enable = true; enable = true;
@ -138,7 +144,7 @@ in
xdotool xdotool
xorg.xwininfo xorg.xwininfo
gparted gparted
uhk-agent # uhk-agent
cool-retro-term cool-retro-term
xdg-desktop-portal-gtk xdg-desktop-portal-gtk
virt-manager virt-manager

View file

@ -17,14 +17,18 @@
}; };
policies = { policies = {
DefaultDownloadDirectory = "\${home}/Downloads"; DefaultDownloadDirectory = "\${home}/Downloads";
Extensions.Install = [ Extensions.Install = builtins.map (name: "https://addons.mozilla.org/firefox/downloads/latest/${name}") [
"https://addons.mozilla.org/firefox/downloads/latest/ublock-origin" "ublock-origin"
"https://addons.mozilla.org/firefox/downloads/latest/tridactyl-vim" "tridactyl-vim"
"https://addons.mozilla.org/firefox/downloads/latest/privacy-badger17" "privacy-badger17"
"https://addons.mozilla.org/firefox/downloads/latest/gruvbox-dark-theme" "gruvbox-dark-theme"
"https://addons.mozilla.org/firefox/downloads/latest/torproject-snowflake" "torproject-snowflake"
"https://addons.mozilla.org/firefox/downloads/latest/bitwarden-password-manager" "bitwarden-password-manager"
"https://addons.mozilla.org/firefox/downloads/latest/terms-of-service-didnt-read" "terms-of-service-didnt-read"
"shinigami-eyes"
"darkreader"
"sponsorblock"
"youtube-mrbeastify"
]; ];
Extensions.Uninstall = [ Extensions.Uninstall = [
"google@search.mozilla.org" "google@search.mozilla.org"
@ -39,95 +43,6 @@
"DisablePocket" = true; "DisablePocket" = true;
}; };
profiles.jade = { profiles.jade = {
bookmarks = [
{
name = "Toolbar";
toolbar = true;
bookmarks = [
{
name = "Katzencafé";
tags = ["fedi" "social"];
keyword = "ck";
url = "https://ck.katzen.cafe";
}
{
name = "Mastodon.de";
tags = ["fedi" "social"];
keyword = "mde";
url = "https://mastodon.de";
}
{
name = "Nekoverse";
tags = ["fedi" "social"];
keyword = "neko";
url = "https://social.nekover.se";
}
{
name = "Katzenschmiede";
tags = ["fedi" "git"];
keyword = "forge";
url = "https://forge.katzen.cafe";
}
{
name = "Katzenwolke";
tags = ["cloud"];
keyword = "wolke";
url = "https://wolke.katzen.cafe";
}
{
name = "Penpot";
tags = ["design"];
keyword = "pp";
url = "https://design.katzen.cafe";
}
{
name = "Pad";
tags = ["pad"];
keyword = "pad";
url = "https://pad.katzen.cafe";
}
{
name = "Auth";
tags = ["keycloak"];
keyword = "auth";
url = "https://auth.katzen.cafe/realms/katzen.cafe/account";
}
{
name = "CCCHH";
bookmarks = [
{
name = "Website";
url = "https://hamburg.ccc.de";
}
{
name = "Wiki";
url = "https://wiki.ccchh.net";
}
{
name = "Wiki (old)";
url = "https://wiki.hamburg.ccc.de";
}
{
name = "Wiki (nonpublic)";
url = "https://nonpublic.wiki.hamburg.ccc.de";
}
{
name = "Pads";
url = "https://pad.hamburg.ccc.de";
}
{
name = "Cloud";
url = "https://cloud.hamburg.ccc.de";
}
{
name = "Club Assistant";
url = "https://club-assistant.ccchh.net";
}
];
}
];
}
];
search = { search = {
force = true; force = true;
default = "DuckDuckGo"; default = "DuckDuckGo";
@ -252,6 +167,7 @@
settings = { settings = {
"devtools.editor.keymap" = "vim"; "devtools.editor.keymap" = "vim";
"devtools.toolbox.host" = "right"; "devtools.toolbox.host" = "right";
"devtools.theme" = "dark";
"webgl.disabled" = false; "webgl.disabled" = false;
"image.jxl.enabled" = true; "image.jxl.enabled" = true;
"browser.urlbar.decodeURLsOnCopy" = true; "browser.urlbar.decodeURLsOnCopy" = true;
@ -264,9 +180,11 @@
"browser.aboutwelcome.showModal" = false; "browser.aboutwelcome.showModal" = false;
"browser.aboutwelcome.enabled" = false; "browser.aboutwelcome.enabled" = false;
"browser.preferences.moreFromMozilla" = false; "browser.preferences.moreFromMozilla" = false;
"identity.fxaccounts.enabled" = false; "browser.menu.showViewImageInfo" = true;
"browser.tabs.firefox-view" = false;
"browser.tabs.firefox-view-next" = false; "identity.fxaccounts.enabled" = true;
"browser.tabs.firefox-view" = true;
"browser.tabs.firefox-view-next" = true;
"browser.newtabpage.activity-stream.showSponsored" = false; "browser.newtabpage.activity-stream.showSponsored" = false;
"browser.newtabpage.activity-stream.showSponsoredTopSites" = false; "browser.newtabpage.activity-stream.showSponsoredTopSites" = false;
"browser.newtabpage.activity-stream.improvesearch.topSiteSearchShortcuts" = false; "browser.newtabpage.activity-stream.improvesearch.topSiteSearchShortcuts" = false;

View file

@ -39,7 +39,7 @@
separator-foreground = "\${colors.disabled}"; separator-foreground = "\${colors.disabled}";
font-0 = "FiraCode Nerd Font"; font-0 = "FiraCode Nerd Font";
modules-left = "xworkspaces xwindow"; modules-left = "xworkspaces xwindow";
modules-right = "memory cpu wlan battery"; modules-right = "memory cpu wlan bat0 bat1";
cursor-click = "pointer"; cursor-click = "pointer";
cursor-scroll = "ns-resize"; cursor-scroll = "ns-resize";
enable-ipc = true; enable-ipc = true;
@ -103,12 +103,9 @@
interface-type = "wireless"; interface-type = "wireless";
label-connected = "%{F#F0C674}%{F-} %local_ip%"; label-connected = "%{F#F0C674}%{F-} %local_ip%";
}; };
"battery-base" = {
"module/battery" = {
type = "internal/battery"; type = "internal/battery";
poll-interval = 1; poll-interval = 1;
battery = "BAT0";
adapter = "ADP1";
time-format = "%H%{F#7c6f64}:%{F#d5c4a1}%M"; time-format = "%H%{F#7c6f64}:%{F#d5c4a1}%M";
label-charging = "%{F#98971a}󰚥 %{F#ebdbb2}%percentage%%%{F#d5c4a1} %time%"; label-charging = "%{F#98971a}󰚥 %{F#ebdbb2}%percentage%%%{F#d5c4a1} %time%";
format-charging = "<ramp-capacity> <label-charging>"; format-charging = "<ramp-capacity> <label-charging>";
@ -131,6 +128,16 @@
"%{F#98971a}󰁹" "%{F#98971a}󰁹"
]; ];
}; };
"module/bat0" = {
"inherit" = "battery-base";
battery = "BAT0";
adapter = "ADP1";
};
"module/bat1" = {
"inherit" = "battery-base";
battery = "BAT1";
adapter = "ADP1";
};
"settings" = { "settings" = {
screenchange-reload = true; screenchange-reload = true;

View file

@ -14,7 +14,6 @@ in
home-manager.users.jade = {pkgs, ...}: { home-manager.users.jade = {pkgs, ...}: {
home.packages = with pkgs; [ home.packages = with pkgs; [
evolutionWithPlugins evolutionWithPlugins
cinny-desktop
signal-desktop signal-desktop
mumble mumble
element-desktop element-desktop

View file

@ -14,6 +14,8 @@ in
services.flatpak.enable = true; services.flatpak.enable = true;
xdg.portal = { xdg.portal = {
enable = true; enable = true;
# TODO
config.common.default = "*";
extraPortals = [ extraPortals = [
pkgs.xdg-desktop-portal-gtk pkgs.xdg-desktop-portal-gtk
]; ];

73
modules/kmscon.nix Normal file
View file

@ -0,0 +1,73 @@
{
pkgs,
config,
lib,
...
}: let
# generate shell command options for kmscon fom an attrset
generateOptions = with builtins; (
opts:
toString (
attrValues (
mapAttrs (name: value: "--${name} ${toString value}") opts
)
)
);
# generate a hexadecimal number lookup table to get integers from them
hexLookupTable = with lib; (listToAttrs (genList (i: {
name = let
r = toHexString i;
in (
# pad with 0 in front if only 1 digit
if (stringLength r) == 1
then "0${r}"
else r
);
value = toString i;
})
256));
# "parse" hex color strings and convert them to kmscon options
hexToOpt = with lib; (color:
concatStringsSep "," [
(getAttr (substring 1 2 (toUpper color)) hexLookupTable)
(getAttr (substring 3 2 (toUpper color)) hexLookupTable)
(getAttr (substring 5 2 (toUpper color)) hexLookupTable)
]);
in {
services.kmscon = {
enable = true;
fonts = [
{
name = "FiraCode Nerd Font";
package = pkgs.nerdfonts.override {fonts = ["FiraCode"];};
}
];
extraConfig = "font-size=14";
# extraOptions = "--term xterm-256color";
extraOptions = generateOptions {
xkb-layout = config.services.xserver.xkb.layout;
xkb-variant = config.services.xserver.xkb.variant;
palette = "custom";
palette-foreground = hexToOpt "#ebdbb2";
palette-background = hexToOpt "#282828";
palette-black = hexToOpt "#282828";
palette-red = hexToOpt "#cc241d";
palette-green = hexToOpt "#98971a";
palette-yellow = hexToOpt "#d79921";
palette-blue = hexToOpt "#458588";
palette-magenta = hexToOpt "#b16286";
palette-cyan = hexToOpt "#689d6a";
palette-light-grey = hexToOpt "#a89984";
palette-dark-grey = hexToOpt "#928374";
palette-light-red = hexToOpt "#fb4934";
palette-light-green = hexToOpt "#b8bb26";
palette-light-yellow = hexToOpt "#fabd2f";
palette-light-blue = hexToOpt "#83a598";
palette-light-magenta = hexToOpt "#d3869b";
palette-light-cyan = hexToOpt "#8ec07c";
palette-white = hexToOpt "#ebdbb2";
};
hwRender = true;
};
}

View file

@ -782,9 +782,9 @@ def start_zellij [] {
start_zellij start_zellij
def nsp [ def nsp [
program: string ...programs: string
] { ] {
nix shell $"nixpkgs#$program" nix shell ...($programs | each {|it| $"nixpkgs#($it)" })
} }
def lcr [ def lcr [
@ -806,6 +806,17 @@ def glog [
| split column "»¦«" commit subject name email date | split column "»¦«" commit subject name email date
} }
def ed [
file: path
...cmdargs: string
] {
let ext = $file | path parse | get extension;
match $ext {
"typ" => {|| zellij run --direction down -- typst watch $file --open ($cmdargs | str join ' ') }
};
hx $file
}
alias gnix = cd ~/nix-configs; alias gnix = cd ~/nix-configs;
alias grepo = cd ~/Documents/repos; alias grepo = cd ~/Documents/repos;
alias wh = wormhole-rs; alias wh = wormhole-rs;