[STYLE/REFACTOR] Deadnix, Alejandra and Statix

This commit is contained in:
Kat Inskip 2023-04-25 16:48:32 -07:00
parent 8573c4508d
commit d4242f9dd8
Signed by: kat
GPG key ID: 465E64DECEA8CF0F
51 changed files with 465 additions and 466 deletions

View file

@ -1,4 +1,4 @@
{ pkgs, ... }: { {pkgs, ...}: {
fonts = { fonts = {
fonts = with pkgs; [ fonts = with pkgs; [
font-awesome font-awesome

View file

@ -1,3 +1,3 @@
{ machine, ... }: { {machine, ...}: {
networking.hostName = machine; networking.hostName = machine;
} }

View file

@ -5,7 +5,7 @@
inputs, inputs,
... ...
}: let }: let
inherit (std) set tuple list function; inherit (std) set list;
inherit (lib.strings) versionAtLeast; inherit (lib.strings) versionAtLeast;
inputs' = set.filter (n: _: !list.elem n ["pypi-deps-db"]) (set.rename "self" "kat" inputs); inputs' = set.filter (n: _: !list.elem n ["pypi-deps-db"]) (set.rename "self" "kat" inputs);
in { in {

View file

@ -1,7 +1,5 @@
{ {
inputs, inputs,
pkgs,
tree,
system, system,
... ...
}: { }: {

View file

@ -1,11 +1,12 @@
{ pkgs, ... }: { {pkgs, ...}: {
nix.envVars = { nix.envVars = {
"SSH_AUTH_SOCK" = "/Users/kat/.gnupg/S.gpg-agent.ssh"; "SSH_AUTH_SOCK" = "/Users/kat/.gnupg/S.gpg-agent.ssh";
}; };
launchd.daemons.start_nixos_native = { launchd.daemons.start_nixos_native = {
serviceConfig.ProgramArguments = [ serviceConfig.ProgramArguments = [
"/bin/sh" "-c" "/bin/sh"
"-c"
"/bin/wait4path /nix/store && ${pkgs.writeScript "start_nixos_native" '' "/bin/wait4path /nix/store && ${pkgs.writeScript "start_nixos_native" ''
/usr/bin/open "utm://start?name=NixOS Native" /usr/bin/open "utm://start?name=NixOS Native"
''}" ''}"

View file

@ -1,7 +1,4 @@
{ {lib, ...}: let
lib,
...
}: let
inherit (lib.modules) mkMerge; inherit (lib.modules) mkMerge;
in { in {
base16 = { base16 = {

View file

@ -16,7 +16,7 @@
in in
dirImports dirImports
// { // {
user = tree.prev.user; inherit (tree.prev) user;
common = { common = {
imports = with tree.prev; [ imports = with tree.prev; [
base16 base16

View file

@ -1,4 +1,4 @@
{pkgs, ...}: { _: {
dconf = { dconf = {
enable = true; enable = true;
settings = { settings = {

View file

@ -1,4 +1,4 @@
{ pkgs, ... }: { {pkgs, ...}: {
home.packages = with pkgs; [ home.packages = with pkgs; [
imv # Image viewer imv # Image viewer
yt-dlp # Downloading media yt-dlp # Downloading media

View file

@ -1,119 +1,125 @@
{ config, lib, pkgs, ... }: let {
config,
lib,
pkgs,
...
}: let
inherit (lib.modules) mkMerge mkIf; inherit (lib.modules) mkMerge mkIf;
inherit (lib.attrsets) mapAttrsToList; inherit (lib.attrsets) mapAttrsToList;
in { in {
# TODO: fix lib usage # TODO: fix lib usage
programs.mpv = { programs.mpv = {
enable = true; enable = true;
scripts = with pkgs.mpvScripts; [ sponsorblock paused ]; scripts = with pkgs.mpvScripts; [sponsorblock paused];
bindings = bindings = let
let vim = {
vim = { "l" = "seek 5";
"l" = "seek 5"; "h" = "seek -5";
"h" = "seek -5"; "k" = "seek 60";
"k" = "seek 60"; "j" = "seek -60";
"j" = "seek -60"; "Ctrl+l" = "seek 1 exact";
"Ctrl+l" = "seek 1 exact"; "Ctrl+h" = "seek -1 exact";
"Ctrl+h" = "seek -1 exact"; "Ctrl+L" = "sub-seek 1";
"Ctrl+L" = "sub-seek 1"; "Ctrl+H" = "sub-seek -1";
"Ctrl+H" = "sub-seek -1"; "Ctrl+k" = "add chapter 1";
"Ctrl+k" = "add chapter 1"; "Ctrl+j" = "add chapter -1";
"Ctrl+j" = "add chapter -1"; "Ctrl+K" = "playlist-next";
"Ctrl+K" = "playlist-next"; "Ctrl+J" = "playlist-prev";
"Ctrl+J" = "playlist-prev"; "Alt+h" = "frame-back-step";
"Alt+h" = "frame-back-step"; "Alt+l" = "frame-step";
"Alt+l" = "frame-step"; "`" = "cycle mute";
"`" = "cycle mute"; "MBTN_RIGHT" = "cycle pause";
"MBTN_RIGHT" = "cycle pause"; "w" = "screenshot";
"w" = "screenshot"; "W" = "screenshot video";
"W" = "screenshot video"; "Ctrl+w" = "screenshot window";
"Ctrl+w" = "screenshot window"; "Ctrl+W" = "screenshot each-frame";
"Ctrl+W" = "screenshot each-frame"; "o" = "show-progress";
"o" = "show-progress"; "O" = "script-message show_osc_dur 5";
"O" = "script-message show_osc_dur 5"; "F1" = "cycle sub";
"F1" = "cycle sub"; "F2" = "cycle audio";
"F2" = "cycle audio"; "Ctrl+p" = "cycle video";
"Ctrl+p" = "cycle video"; "L" = "add volume 2";
"L" = "add volume 2"; "H" = "add volume -2";
"H" = "add volume -2"; "Alt+H" = "add audio-delay -0.100";
"Alt+H" = "add audio-delay -0.100"; "Alt+L" = "add audio-delay 0.100";
"Alt+L" = "add audio-delay 0.100"; "1" = "set volume 10";
"1" = "set volume 10"; "2" = "set volume 20";
"2" = "set volume 20"; "3" = "set volume 30";
"3" = "set volume 30"; "4" = "set volume 40";
"4" = "set volume 40"; "5" = "set volume 50";
"5" = "set volume 50"; "6" = "set volume 60";
"6" = "set volume 60"; "7" = "set volume 70";
"7" = "set volume 70"; "8" = "set volume 80";
"8" = "set volume 80"; "9" = "set volume 90";
"9" = "set volume 90"; ")" = "set volume 150";
")" = "set volume 150"; "0" = "set volume 100";
"0" = "set volume 100"; "m" = "cycle mute";
"m" = "cycle mute"; "Ctrl+r" = "loadfile \${path}";
"Ctrl+r" = "loadfile \${path}"; "Ctrl+R" = "video-reload";
"Ctrl+R" = "video-reload"; "d" = "drop-buffers";
"d" = "drop-buffers"; "Ctrl+d" = "quit";
"Ctrl+d" = "quit"; };
}; other = {
other = { "RIGHT" = vim."l";
"RIGHT" = vim."l"; "LEFT" = vim."h";
"LEFT" = vim."h"; "UP" = vim."k";
"UP" = vim."k"; "DOWN" = vim."j";
"DOWN" = vim."j"; "Ctrl+0" = "set speed 1.0";
"Ctrl+0" = "set speed 1.0"; "Ctrl+=" = "multiply speed 1.1";
"Ctrl+=" = "multiply speed 1.1"; "Ctrl+-" = "multiply speed 1/1.1";
"Ctrl+-" = "multiply speed 1/1.1"; "Shift+LEFT" = vim."H";
"Shift+LEFT" = vim."H"; "Shift+RIGHT" = vim."L";
"Shift+RIGHT" = vim."L"; "Ctrl+RIGHT" = vim."Ctrl+l";
"Ctrl+RIGHT" = vim."Ctrl+l"; "Ctrl+LEFT" = vim."Ctrl+h";
"Ctrl+LEFT" = vim."Ctrl+h"; "Ctrl+Shift+LEFT" = vim."Ctrl+H";
"Ctrl+Shift+LEFT" = vim."Ctrl+H"; "Ctrl+Shift+RIGHT" = vim."Ctrl+L";
"Ctrl+Shift+RIGHT" = vim."Ctrl+L"; "Ctrl+UP" = vim."Ctrl+k";
"Ctrl+UP" = vim."Ctrl+k"; "Ctrl+DOWN" = vim."Ctrl+j";
"Ctrl+DOWN" = vim."Ctrl+j"; "Ctrl+Shift+UP" = vim."Ctrl+K";
"Ctrl+Shift+UP" = vim."Ctrl+K"; "Ctrl+Shift+DOWN" = vim."Ctrl+J";
"Ctrl+Shift+DOWN" = vim."Ctrl+J"; "Alt+LEFT" = vim."Alt+h";
"Alt+LEFT" = vim."Alt+h"; "Alt+RIGHT" = vim."Alt+l";
"Alt+RIGHT" = vim."Alt+l"; "SPACE" = vim."MBTN_RIGHT";
"SPACE" = vim."MBTN_RIGHT"; "m" = vim."`";
"m" = vim."`"; "WHEEL_UP" = vim."L";
"WHEEL_UP" = vim."L"; "WHEEL_DOWN" = vim."H";
"WHEEL_DOWN" = vim."H"; };
}; in
in
vim // other; vim // other;
config = mkMerge [ config = mkMerge [
(mkIf config.wayland.windowManager.sway.enable { (mkIf config.wayland.windowManager.sway.enable {
gpu-context = "wayland"; gpu-context = "wayland";
}) })
{ {
no-input-default-bindings = ""; no-input-default-bindings = "";
profile = "gpu-hq"; profile = "gpu-hq";
hwdec = "auto"; hwdec = "auto";
vo = "gpu"; vo = "gpu";
volume-max = 200; volume-max = 200;
keep-open = true; keep-open = true;
opengl-waitvsync = true; opengl-waitvsync = true;
demuxer-max-bytes = "2000MiB"; demuxer-max-bytes = "2000MiB";
demuxer-max-back-bytes = "250MiB"; demuxer-max-back-bytes = "250MiB";
osd-scale-by-window = false; osd-scale-by-window = false;
osd-bar-h = 2.5; # 3.125 default osd-bar-h = 2.5; # 3.125 default
osd-border-size = 2; # font border pixels, default 3 osd-border-size = 2; # font border pixels, default 3
term-osd-bar = true; term-osd-bar = true;
script-opts = builtins.concatStringsSep "," script-opts =
(mapAttrsToList (k: v: "${k}=${toString v}") { builtins.concatStringsSep ","
ytdl_hook-ytdl_path = "${pkgs.yt-dlp}/bin/yt-dlp"; (mapAttrsToList (k: v: "${k}=${toString v}") {
osc-layout = "slimbox"; ytdl_hook-ytdl_path = "${pkgs.yt-dlp}/bin/yt-dlp";
osc-vidscale = "no"; osc-layout = "slimbox";
osc-deadzonesize = 0.75; osc-vidscale = "no";
osc-minmousemove = 4; osc-deadzonesize = 0.75;
osc-hidetimeout = 2000; osc-minmousemove = 4;
osc-valign = 0.9; osc-hidetimeout = 2000;
osc-timems = "yes"; osc-valign = 0.9;
osc-seekbarstyle = "knob"; osc-timems = "yes";
osc-seekbarkeyframes = "no"; osc-seekbarstyle = "knob";
osc-seekrangestyle = "slider"; osc-seekbarkeyframes = "no";
}); osc-seekrangestyle = "slider";
}]; });
}
];
}; };
} }

View file

@ -1,4 +1,4 @@
{ pkgs, ... }: { {pkgs, ...}: {
home.packages = with pkgs; [ home.packages = with pkgs; [
gnome.adwaita-icon-theme gnome.adwaita-icon-theme
]; ];

View file

@ -1,4 +1,8 @@
{ config, lib, ... }: { {
config,
lib,
...
}: {
# TODO: fix lib use # TODO: fix lib use
home.packages = [ home.packages = [
config.services.konawall.konashow config.services.konawall.konashow
@ -8,7 +12,7 @@
enable = true; enable = true;
interval = "30m"; interval = "30m";
mode = "shuffle"; mode = "shuffle";
commonTags = [ "width:>=1600" ]; commonTags = ["width:>=1600"];
tagList = map lib.toList [ tagList = map lib.toList [
[ [
"score:>=50" "score:>=50"

View file

@ -1,18 +1,21 @@
{ config, pkgs, ... }: let {
config,
pkgs,
...
}: let
inherit (config.base16) palette; inherit (config.base16) palette;
in { in {
systemd.user.services = { systemd.user.services = {
mako = { mako = {
Unit = { Unit = {
Description = "mako"; Description = "mako";
X-Restart-Triggers = X-Restart-Triggers = [(toString config.xdg.configFile."mako/config".source)];
[ (toString config.xdg.configFile."mako/config".source) ];
}; };
Service = { Service = {
ExecStart = "${pkgs.mako}/bin/mako"; ExecStart = "${pkgs.mako}/bin/mako";
Restart = "always"; Restart = "always";
}; };
Install = { WantedBy = [ "graphical-session.target" ]; }; Install = {WantedBy = ["graphical-session.target"];};
}; };
}; };

View file

@ -1,10 +1,14 @@
{ kittywitch, ... }: { {kittywitch, ...}: {
programs.wofi = { programs.wofi = {
enable = true; enable = true;
settings = { settings = {
style = let style = let
template = kittywitch.sassTemplate { name = "wofi-style"; src = ./wofi.sass; }; template = kittywitch.sassTemplate {
in template.source; name = "wofi-style";
src = ./wofi.sass;
};
in
template.source;
insensitive = true; insensitive = true;
allow_images = true; allow_images = true;
hide_scroll = true; hide_scroll = true;

View file

@ -1,59 +1,74 @@
{ config, pkgs, lib, ... }: let {
config,
pkgs,
lib,
...
}: let
inherit (lib.types) attrsOf str enum; inherit (lib.types) attrsOf str enum;
inherit (lib.modules) mkIf; inherit (lib.modules) mkIf;
cfg = config.base16; cfg = config.base16;
in with lib; { in
options.base16 = { with lib; {
palette = mkOption { options.base16 = {
type = attrsOf str; palette = mkOption {
};
sass = {
variables = mkOption {
type = attrsOf str; type = attrsOf str;
default = cfg.palette // { };
term_font = "Iosevka"; sass = {
font = "Iosevka"; variables = mkOption {
font_size = "12px"; type = attrsOf str;
default =
cfg.palette
// {
term_font = "Iosevka";
font = "Iosevka";
font_size = "12px";
};
};
css_style = mkOption {
type = enum ["nested" "compressed" "compact" "expanded"];
default = "expanded";
}; };
}; };
css_style = mkOption { };
type = enum [ "nested" "compressed" "compact" "expanded" ]; config = mkIf (cfg.schemes != {}) {
default = "expanded"; base16 = {
# TODO: convert to std
palette =
lib.mapAttrs' (k: v:
lib.nameValuePair
k
"#${v.hex}")
(lib.filterAttrs (n: _: lib.hasInfix "base" n)
cfg.defaultScheme);
}; };
};
};
config = mkIf (cfg.schemes != {}) {
base16 = {
# TODO: convert to std
palette = lib.mapAttrs' (k: v:
lib.nameValuePair
k
"#${v.hex}")
(lib.filterAttrs (n: _: lib.hasInfix "base" n)
cfg.defaultScheme);
};
lib.kittywitch.sassTemplate = { name, src }: lib.kittywitch.sassTemplate = {
let name,
src,
}: let
variables = pkgs.writeText "base-variables.sass" '' variables = pkgs.writeText "base-variables.sass" ''
${(concatStringsSep "\n" (mapAttrsToList(var: con: "\$${var}: ${con}") cfg.sass.variables))} ${(concatStringsSep "\n" (mapAttrsToList (var: con: "\$${var}: ${con}") cfg.sass.variables))}
''; '';
source = pkgs.callPackage source =
({ sass, stdenv }: stdenv.mkDerivation { pkgs.callPackage
inherit name src variables; ({
nativeBuildInputs = lib.singleton pkgs.sass; sass,
phases = [ "buildPhase" ]; stdenv,
buildPhase = '' }:
cat $variables $src > src-mut.sass stdenv.mkDerivation {
sass src-mut.sass $out --sourcemap=none --trace --style=${cfg.sass.css_style} inherit name src variables;
''; nativeBuildInputs = lib.singleton pkgs.sass;
}) phases = ["buildPhase"];
{ }; buildPhase = ''
in cat $variables $src > src-mut.sass
{ sass src-mut.sass $out --sourcemap=none --trace --style=${cfg.sass.css_style}
'';
})
{};
in {
inherit source; inherit source;
text = builtins.readFile source; text = builtins.readFile source;
}; };
_module.args = { inherit (config.lib) kittywitch; }; _module.args = {inherit (config.lib) kittywitch;};
}; };
} }

View file

@ -1,7 +1,12 @@
{ config, lib, ... }: let {
config,
lib,
...
}: let
inherit (lib.modules) mkIf; inherit (lib.modules) mkIf;
in mkIf (config.programs.waybar.enable) { in
systemd.user.services.waybar.Unit.X-Restart-Triggers = [ mkIf config.programs.waybar.enable {
(builtins.toString config.programs.waybar.style) systemd.user.services.waybar.Unit.X-Restart-Triggers = [
]; (builtins.toString config.programs.waybar.style)
} ];
}

View file

@ -1,8 +1,4 @@
{ {lib, ...}: let
config,
lib,
...
}: let
inherit (lib.types) listOf path; inherit (lib.types) listOf path;
inherit (lib.options) mkOption; inherit (lib.options) mkOption;
in { in {

View file

@ -1,13 +1,11 @@
({ config, pkgs, ... }: ({pkgs, ...}: {
users.users.arc = {
{ uid = 1001;
users.users.arc = { isNormalUser = true;
uid = 1001; extraGroups = ["wheel"];
isNormalUser = true; openssh.authorizedKeys.keys = [
extraGroups = [ "wheel" ]; "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJ8Z6briIboxIdedPGObEWB6QEQkvxKvnMW/UVU9t/ac mew-pgp"
openssh.authorizedKeys.keys = [ ];
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJ8Z6briIboxIdedPGObEWB6QEQkvxKvnMW/UVU9t/ac mew-pgp" shell = pkgs.zsh;
]; };
shell = pkgs.zsh; })
};
})

View file

@ -1,31 +1,40 @@
{ config, pkgs, lib, ... }: let {
# TODO: solve lib usage config,
inherit (lib.lists) concatLists elem; lib,
inherit (lib.attrsets) mapAttrsToList; ...
commonUser = { }: let
openssh.authorizedKeys.keys = concatLists (mapAttrsToList # TODO: solve lib usage
(_: user: inherit (lib.lists) concatLists elem;
if elem "wheel" user.extraGroups then inherit (lib.attrsets) mapAttrsToList;
user.openssh.authorizedKeys.keys commonUser = {
else openssh.authorizedKeys.keys = concatLists (mapAttrsToList
[ ]) (_: user:
config.users.users); if elem "wheel" user.extraGroups
}; then user.openssh.authorizedKeys.keys
else [])
config.users.users);
};
in { in {
security.sudo.extraRules = [{ security.sudo.extraRules = [
users = [ "deploy" ]; {
commands = [ { users = ["deploy"];
command = "ALL"; commands = [
options = [ {
"NOPASSWD" command = "ALL";
"SETENV" options = [
"NOPASSWD"
"SETENV"
];
}
]; ];
} ]; }
}]; ];
users.users = { users.users = {
root = commonUser; root = commonUser;
deploy = commonUser // { deploy =
isNormalUser = true; commonUser
}; // {
isNormalUser = true;
};
}; };
} }

View file

@ -1,6 +1,6 @@
{ config, ... }: { {config, ...}: {
system.autoUpgrade = { system.autoUpgrade = {
enable = true; enable = true;
flake = "github:kittywitch/kittywitch#${config.networking.hostName}"; flake = "github:kittywitch/kittywitch#${config.networking.hostName}";
}; };
} }

View file

@ -1,4 +1,4 @@
{ config, ... }: { {config, ...}: {
base16 = { base16 = {
inherit (config.home-manager.users.kat.base16) defaultSchemeName defaultScheme schemes; inherit (config.home-manager.users.kat.base16) defaultSchemeName defaultScheme schemes;
console = { console = {

View file

@ -1,4 +1,4 @@
{ pkgs, ... }: { {pkgs, ...}: {
fonts.fonts = [ fonts.fonts = [
pkgs.tamzen pkgs.tamzen
]; ];
@ -12,7 +12,7 @@
]; ];
}; };
console = { console = {
packages = [ pkgs.tamzen ]; packages = [pkgs.tamzen];
font = "Tamzen7x14"; font = "Tamzen7x14";
earlySetup = true; earlySetup = true;
keyMap = "uk"; keyMap = "uk";

View file

@ -1,6 +1,6 @@
_: { _: {
users.groups.secrets = {}; users.groups.secrets = {};
systemd.tmpfiles.rules = [ systemd.tmpfiles.rules = [
"v /var/lib/secrets 700 deploy secrets" "v /var/lib/secrets 700 deploy secrets"
]; ];
} }

View file

@ -1,19 +1,31 @@
{ config, lib, std, ... }: let {
config,
lib,
std,
...
}: let
inherit (lib.modules) mkDefault; inherit (lib.modules) mkDefault;
inherit (std) list; inherit (std) list;
in { in {
networking.firewall = { networking.firewall = {
allowedTCPPorts = [ (list.unsafeHead config.services.openssh.ports) ]; allowedTCPPorts = [(list.unsafeHead config.services.openssh.ports)];
allowedUDPPortRanges = [ { from = 60000; to = 61000; } ]; allowedUDPPortRanges = [
{
from = 60000;
to = 61000;
}
];
}; };
services.openssh = { services.openssh = {
enable = true; enable = true;
/* knownHosts.katca = { /*
knownHosts.katca = {
certAuthority = true; certAuthority = true;
publicKey = builtins.readFile ./ca-pubkey.pem; publicKey = builtins.readFile ./ca-pubkey.pem;
}; */ };
kexAlgorithms = [ "curve25519-sha256@libssh.org" ]; */
kexAlgorithms = ["curve25519-sha256@libssh.org"];
settings = { settings = {
PasswordAuthentication = false; PasswordAuthentication = false;
KbdInteractiveAuthentication = false; KbdInteractiveAuthentication = false;

View file

@ -2,11 +2,11 @@ _: {
services.tzupdate.enable = true; services.tzupdate.enable = true;
systemd.timers."tzupdate" = { systemd.timers."tzupdate" = {
wantedBy = [ "timers.target" ]; wantedBy = ["timers.target"];
timerConfig = { timerConfig = {
OnBootSec = "5m"; OnBootSec = "5m";
OnUnitActiveSec = "5m"; OnUnitActiveSec = "5m";
Unit = "tzupdate.service"; Unit = "tzupdate.service";
}; };
}; };
} }

View file

@ -1,5 +1,5 @@
{ pkgs, ... }: { {pkgs, ...}: {
environment.systemPackages = with pkgs; [ bluez5-experimental ]; environment.systemPackages = with pkgs; [bluez5-experimental];
environment.etc = { environment.etc = {
"wireplumber/bluetooth.lua.d/51-bluez-config.lua".text = '' "wireplumber/bluetooth.lua.d/51-bluez-config.lua".text = ''

View file

@ -1,4 +1,9 @@
{ lib, tree, ... }: with lib; let {
lib,
tree,
...
}:
with lib; let
profiles = tree.prev; profiles = tree.prev;
appendedProfiles = { appendedProfiles = {
common-wifi-bt = { common-wifi-bt = {
@ -23,4 +28,4 @@
}; };
}; };
in in
profiles // appendedProfiles profiles // appendedProfiles

View file

@ -1,33 +1,37 @@
{lib, pkgs, ...}: let {
inherit (lib.modules) mkDefault mkOrder; lib,
pkgs,
...
}: let
inherit (lib.modules) mkDefault;
in { in {
powerManagement.cpuFreqGovernor = mkDefault "powersave"; powerManagement.cpuFreqGovernor = mkDefault "powersave";
programs.light.enable = true; programs.light.enable = true;
home-manager.sharedModules = [ home-manager.sharedModules = [
{ {
programs.waybar.settings.main = { programs.waybar.settings.main = {
modules-right = [ modules-right = [
"backlight" "backlight"
"battery" "battery"
]; ];
backlight = { backlight = {
format = " {percent}%"; format = " {percent}%";
on-scroll-up = "${pkgs.light}/bin/light -A 1"; on-scroll-up = "${pkgs.light}/bin/light -A 1";
on-scroll-down = "${pkgs.light}/bin/light -U 1"; on-scroll-down = "${pkgs.light}/bin/light -U 1";
}; };
battery = { battery = {
states = { states = {
good = 90; good = 90;
warning = 30; warning = 30;
critical = 15; critical = 15;
};
format = "{icon} {capacity}%";
format-charging = " {capacity}%";
format-plugged = " {capacity}%";
format-alt = "{icon} {time}";
format-icons = ["" "" "" "" ""];
}; };
format = "{icon} {capacity}%";
format-charging = " {capacity}%";
format-plugged = " {capacity}%";
format-alt = "{icon} {time}";
format-icons = [ "" "" "" "" "" ];
}; };
}; }
}
]; ];
} }

View file

@ -1,19 +1,17 @@
{lib, ...}: let _: {
in {
boot = { boot = {
initrd.availableKernelModules = initrd.availableKernelModules = ["xhci_pci" "nvme" "usb_storage" "sd_mod" "sr_mod" "rtsx_usb_sdmmc"];
[ "xhci_pci" "nvme" "usb_storage" "sd_mod" "sr_mod" "rtsx_usb_sdmmc" ]; kernelModules = ["kvm-intel"];
kernelModules = [ "kvm-intel" ];
}; };
home-manager.sharedModules = [ home-manager.sharedModules = [
{ {
wayland.windowManager.sway.config.input."2:7:SynPS/2_Synaptics_TouchPad" = { wayland.windowManager.sway.config.input."2:7:SynPS/2_Synaptics_TouchPad" = {
dwt = "enabled"; dwt = "enabled";
tap = "enabled"; tap = "enabled";
natural_scroll = "enabled"; natural_scroll = "enabled";
middle_emulation = "enabled"; middle_emulation = "enabled";
click_method = "clickfinger"; click_method = "clickfinger";
}; };
} }
]; ];
} }

View file

@ -1,13 +1,11 @@
{lib, pkgs, ...}: let {pkgs, ...}: {
inherit (lib.modules) mkDefault mkOrder; environment.systemPackages = with pkgs; [pulsemixer];
in {
environment.systemPackages = with pkgs; [ pulsemixer ];
sound = { sound = {
enable = true; enable = true;
extraConfig = '' extraConfig = ''
defaults.pcm.rate_converter "speexrate_best" defaults.pcm.rate_converter "speexrate_best"
''; '';
}; };
hardware.pulseaudio.enable = false; hardware.pulseaudio.enable = false;
@ -22,26 +20,26 @@ in {
}; };
home-manager.sharedModules = [ home-manager.sharedModules = [
{ {
programs.waybar.settings.main = { programs.waybar.settings.main = {
modules-right = [ modules-right = [
"pulseaudio" "pulseaudio"
]; ];
pulseaudio = { pulseaudio = {
format = "{icon} {volume}%"; format = "{icon} {volume}%";
format-muted = ""; format-muted = "";
on-click = "${pkgs.wezterm}/bin/wezterm start ${pkgs.pulsemixer}/bin/pulsemixer"; on-click = "${pkgs.wezterm}/bin/wezterm start ${pkgs.pulsemixer}/bin/pulsemixer";
format-icons = { format-icons = {
headphone = ""; headphone = "";
headset = ""; headset = "";
default = [ default = [
"" ""
"" ""
"" ""
]; ];
};
}; };
}; };
}; }
}
]; ];
} }

View file

@ -1,13 +1,22 @@
{ lib, pkgs, ... }: let {
inherit (lib.modules) mkForce; lib,
pkgs,
...
}: let
inherit (lib.modules) mkForce;
in { in {
systemd.services.NetworkManager-wait-online = { systemd.services.NetworkManager-wait-online = {
serviceConfig.ExecStart = [ "" "${pkgs.networkmanager}/bin/nm-online -q" ]; serviceConfig.ExecStart = ["" "${pkgs.networkmanager}/bin/nm-online -q"];
}; };
networking = { networking = {
firewall = { firewall = {
allowedUDPPorts = [ 5353 ]; # MDNS allowedUDPPorts = [5353]; # MDNS
allowedUDPPortRanges = [ { from = 32768; to=60999; } ]; # Ephemeral / Chromecast allowedUDPPortRanges = [
{
from = 32768;
to = 60999;
}
]; # Ephemeral / Chromecast
}; };
networkmanager = { networkmanager = {
enable = true; enable = true;

View file

@ -1,4 +1,9 @@
{ config, lib, std, ... }: let {
config,
lib,
std,
...
}: let
inherit (lib.modules) mkDefault mkIf mkMerge; inherit (lib.modules) mkDefault mkIf mkMerge;
inherit (std) list; inherit (std) list;
in { in {

View file

@ -1,10 +1,4 @@
{ {pkgs, ...}: {
pkgs,
lib,
...
}: let
inherit (lib.modules) mkForce;
in {
services.xserver.enable = true; services.xserver.enable = true;
services.xserver.displayManager.gdm.enable = true; services.xserver.displayManager.gdm.enable = true;
services.xserver.desktopManager.gnome.enable = true; services.xserver.desktopManager.gnome.enable = true;

View file

@ -1,4 +1,4 @@
{ pkgs, ... }: { _: {
fonts = { fonts = {
enableDefaultFonts = true; enableDefaultFonts = true;
fontDir.enable = true; fontDir.enable = true;

View file

@ -1,6 +1,6 @@
{ pkgs, ... }: { {pkgs, ...}: {
services.pcscd.enable = true; services.pcscd.enable = true;
services.udev.packages = [ pkgs.yubikey-personalization ]; services.udev.packages = [pkgs.yubikey-personalization];
programs.gnupg.agent = { programs.gnupg.agent = {
enable = true; enable = true;

View file

@ -1,3 +1,3 @@
_: { _: {
boot.supportedFilesystems = [ "nfs" ]; boot.supportedFilesystems = ["nfs"];
} }

View file

@ -1,4 +1,4 @@
{ pkgs, ... }: { {pkgs, ...}: {
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
android-udev-rules android-udev-rules
jmtpfs jmtpfs

View file

@ -1,7 +1,6 @@
{ {
lib, lib,
config, config,
pkgs,
prev, prev,
... ...
}: let }: let

View file

@ -1,9 +1,15 @@
{ config, pkgs, std, lib, ... }: let {
config,
pkgs,
std,
lib,
...
}: let
inherit (std) set list; inherit (std) set list;
inherit (lib.modules) mkForce; inherit (lib.modules) mkForce;
in { in {
programs.sway = { programs.sway = {
enable = list.any (user: user.wayland.windowManager.sway.enable) (set.values config.home-manager.users); enable = list.any (user: user.wayland.windowManager.sway.enable) (set.values config.home-manager.users);
extraPackages = with pkgs; mkForce [ xwayland swaylock swayidle swaylock-fancy wmctrl ]; extraPackages = with pkgs; mkForce [xwayland swaylock swayidle swaylock-fancy wmctrl];
}; };
} }

View file

@ -1,4 +1,4 @@
{ pkgs, ... }: { {pkgs, ...}: {
xdg = { xdg = {
portal = { portal = {
enable = true; enable = true;

View file

@ -1,10 +1,4 @@
{ {config, ...}: {
lib,
config,
pkgs,
prev,
...
}: {
scalpel.trafos."credentials_file" = { scalpel.trafos."credentials_file" = {
source = "/etc/ssl/credentials_template"; source = "/etc/ssl/credentials_template";
matchers."CLOUDFLARE_EMAIL".secret = config.sops.secrets.cloudflare_email.path; matchers."CLOUDFLARE_EMAIL".secret = config.sops.secrets.cloudflare_email.path;

View file

@ -1,6 +1,6 @@
_: { _: {
boot = { boot = {
initrd.availableKernelModules = [ "virtiofs"]; initrd.availableKernelModules = ["virtiofs"];
binfmt.registrations."rosetta" = { binfmt.registrations."rosetta" = {
interpreter = "/run/rosetta/rosetta"; interpreter = "/run/rosetta/rosetta";
fixBinary = true; fixBinary = true;
@ -12,7 +12,7 @@ _: {
}; };
nix.settings = { nix.settings = {
extra-platforms = [ "x86_64-linux" ]; extra-platforms = ["x86_64-linux"];
extra-sandbox-paths = [ "/run/rosetta" "/run/binfmt" ]; extra-sandbox-paths = ["/run/rosetta" "/run/binfmt"];
}; };
} }

View file

@ -8,10 +8,10 @@
inherit (import ./pkgs.nix {inherit inputs tree overlay;}) pkgs; inherit (import ./pkgs.nix {inherit inputs tree overlay;}) pkgs;
formatter = import ./formatter.nix {inherit inputs pkgs;}; formatter = import ./formatter.nix {inherit inputs pkgs;};
inherit (std) set; inherit (std) set;
#checks = set.map (_: deployLib: deployLib.deployChecks inputs.self.deploy) inputs.deploy-rs.lib; checks = set.map (_: deployLib: deployLib.deployChecks inputs.self.deploy) inputs.deploy-rs.lib;
in in
{ {
inherit inputs tree std pkgs formatter lib; # checks inherit inputs tree std pkgs formatter lib checks;
legacyPackages = pkgs; legacyPackages = pkgs;
} }
// systems // systems

View file

@ -1,3 +1,9 @@
{ inputs, tree, ... }: final: prev: let {
inherit (inputs.std.lib) set list; inputs,
in set.map (_: package: prev.callPackage package {} ) (removeAttrs tree.packages ["default"]) tree,
...
}: _: prev: let
# formerly final: prev:, but deadnix
inherit (inputs.std.lib) set;
in
set.map (_: package: prev.callPackage package {}) (removeAttrs tree.packages ["default"])

View file

@ -5,4 +5,9 @@
}: let }: let
overlays = import tree.overlays {inherit inputs tree;}; overlays = import tree.overlays {inherit inputs tree;};
in in
inputs.utils.lib.eachDefaultSystem (system: {pkgs = import inputs.nixpkgs { inherit system overlays; config.allowUnfree = true; };}) inputs.utils.lib.eachDefaultSystem (system: {
pkgs = import inputs.nixpkgs {
inherit system overlays;
config.allowUnfree = true;
};
})

View file

@ -1,5 +1,10 @@
_: let _: let
hostConfig = {lib, tree, modulesPath, inputs, pkgs, ...}: let hostConfig = {
lib,
tree,
inputs,
...
}: let
inherit (lib.modules) mkForce; inherit (lib.modules) mkForce;
in { in {
imports = with tree; [ imports = with tree; [
@ -46,7 +51,7 @@ _: let
}; };
swapDevices = [ swapDevices = [
{ device = "/dev/sdb"; } {device = "/dev/sdb";}
]; ];
wsl = { wsl = {

View file

@ -110,7 +110,7 @@
{ {
inherit machine; inherit machine;
systemType = config.folder; systemType = config.folder;
system = config.system; inherit (config) system;
} }
// defaultSpecialArgs; // defaultSpecialArgs;
}; };

View file

@ -1,17 +1,24 @@
_: let _: let
hostConfig = {config, tree, pkgs, ...}: { hostConfig = {
imports = with tree.nixos.hardware; [ config,
lenovo-thinkpad-x260 tree,
common-pc-laptop-ssd ...
] ++ (with tree.nixos.roles; [ }: {
graphical imports = with tree.nixos.hardware;
sway [
laptop lenovo-thinkpad-x260
bootable common-pc-laptop-ssd
]) ++ (with tree; [ ]
kat.gui ++ (with tree.nixos.roles; [
kat.sway graphical
]); sway
laptop
bootable
])
++ (with tree; [
kat.gui
kat.sway
]);
fileSystems = { fileSystems = {
"/" = { "/" = {
@ -24,7 +31,7 @@ _: let
}; };
}; };
services.openssh = { services.openssh = {
hostKeys = [ hostKeys = [
{ {
bits = 4096; bits = 4096;

View file

@ -1,7 +1,11 @@
_: let _: let
hostConfig = { lib, tree, ... }: let hostConfig = {
inherit (lib.modules) mkDefault; lib,
in { tree,
...
}: let
inherit (lib.modules) mkDefault;
in {
imports = with tree; [ imports = with tree; [
nixos.rosetta nixos.rosetta
nixos.roles.bootable nixos.roles.bootable
@ -9,7 +13,7 @@ _: let
boot = { boot = {
loader.systemd-boot.enable = true; loader.systemd-boot.enable = true;
initrd.availableKernelModules = ["virtio_pci" "xhci_pci" "usb_storage" "usbhid" ]; initrd.availableKernelModules = ["virtio_pci" "xhci_pci" "usb_storage" "usbhid"];
}; };
fileSystems = { fileSystems = {
@ -24,8 +28,8 @@ _: let
}; };
"/run/rosetta" = { "/run/rosetta" = {
device = "rosetta"; device = "rosetta";
fsType = "virtiofs"; fsType = "virtiofs";
}; };
}; };
swapDevices = [ swapDevices = [

View file

@ -1,84 +0,0 @@
_: let
hostConfig = {tree, lib, ...}: let
inherit (lib.modules) mkForce;
in {
imports = with tree; [
nixos.arc
/* ./kanidm.nix
./vouch.nix
./home-assistant.nix
./zigbee2mqtt.nix
./mosquitto.nix
./postgres.nix
./nginx.nix
../../gui/nfs.nix */
];
networking = {
useDHCP = false;
interfaces = {
eno1 = {
useDHCP = true;
};
};
};
boot = {
loader = {
systemd-boot = {
enable = true;
};
efi = {
canTouchEfiVariables = true;
};
};
initrd = {
availableKernelModules = [ "xhci_pci" "ehci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ];
};
kernelModules = [ "kvm-intel" ];
};
/* services.openiscsi = {
enable = true;
name = "";
discoverPortal = "shanghai.tail.cutie.moe";
};
environment.etc."iscsi/initiatorname.iscsi" = mkForce {
source = config.secrets.files.openscsi-config.path;
};
secrets.variables.openscsi-password = {
path = "gensokyo/tewi-scsi";
field = "password";
};
secrets.files.openscsi-config = {
text = "InitiatorName=${tf.variables.openscsi-password.ref}";
}; */
fileSystems = {
"/" = {
device = "/dev/disk/by-uuid/6c5d82b1-5d11-4c72-96c6-5f90e6ce57f5";
fsType = "ext4";
};
"/boot" = {
device = "/dev/disk/by-uuid/85DC-72FA";
fsType = "vfat";
};
};
swapDevices = lib.singleton ({
device = "/dev/disk/by-uuid/137605d3-5e3f-47c8-8070-6783ce651932";
});
system.stateVersion = "21.05";
};
in {
arch = "x86_64";
type = "NixOS";
modules = [
hostConfig
];
}

View file

@ -1,8 +1,4 @@
{ {inputs, ...}:
inputs,
pkgs,
...
}:
(inputs.tree.tree { (inputs.tree.tree {
inherit inputs; inherit inputs;
folder = ./.; folder = ./.;