From 53655a05fc58b0426cf489d88ae4bcd8c0bd83b2 Mon Sep 17 00:00:00 2001 From: kat Date: Sun, 10 Jul 2022 12:59:40 -0700 Subject: [PATCH] refactor: restructure project to remove profiles, users, ... --- darwin/base/access.nix | 6 + {profiles/darwin => darwin/base}/home.nix | 0 {profiles/darwin => darwin/base}/homebrew.nix | 0 {profiles/darwin => darwin/base}/nix.nix | 0 {profiles/darwin => darwin/base}/shell.nix | 0 users/kat/darwin.nix => darwin/kat.nix | 0 {nodes/darwin => darwin/systems}/sumireko.nix | 8 +- devShell.nix | 3 +- flake.lock | 28 +- flake.nix | 4 +- {empty => flake/empty}/.keep | 0 {trusted => flake/trusted}/flake.lock | 38 +- {trusted => flake/trusted}/flake.nix | 2 +- .../hardware => hardware}/aarch64-darwin.nix | 0 .../hardware => hardware}/aarch64-linux.nix | 0 {profiles/hardware => hardware}/amdgpu.nix | 2 - {profiles/hardware => hardware}/bamboo.nix | 0 {profiles/hardware => hardware}/default.nix | 0 .../hardware => hardware}/eeepc-1015pem.nix | 2 - {profiles/hardware => hardware}/intel-gpu.nix | 0 {profiles/hardware => hardware}/intel.nix | 2 - .../laptop/light.nix => hardware/laptop.nix | 0 {profiles/hardware => hardware}/ms-7b86.nix | 2 - .../hardware => hardware}/networkmanager.nix | 0 .../hardware => hardware}/oracle/common.nix | 0 .../hardware => hardware}/oracle/default.nix | 8 - {profiles/hardware => hardware}/razer.nix | 0 {profiles/hardware => hardware}/rm-310.nix | 2 - {profiles/hardware => hardware}/ryzen.nix | 2 - {profiles/hardware => hardware}/wifi.nix | 1 - {profiles/hardware => hardware}/x270.nix | 2 - {users/kat/base => home}/base16.nix | 4 +- home/dconf.nix | 3 + home/default.nix | 48 ++ home/firefox/default.nix | 174 +++++++ {users/kat/gui => home}/firefox/tst.sass | 0 .../kat/gui => home}/firefox/userChrome.sass | 0 home/fonts.nix | 3 + {users/kat/sway => home}/gammastep.nix | 0 {users/kat/personal => home}/gpg.nix | 0 {users/kat/gui => home}/gtk.nix | 0 {users/kat => home}/gui/packages.nix | 4 - {users/kat/gui => home}/kitty.nix | 0 {users/kat/gui => home}/konawall.nix | 3 +- {profiles/x11 => home}/layout.xkb | 0 {users/kat/sway => home}/mako.nix | 0 .../kat/media/packages.nix => home/media.nix | 0 {users/kat/media => home}/mpv.nix | 0 {users/kat/media => home}/obs.nix | 0 {users/kat/gui => home}/qt.nix | 0 {users/kat/gui => home}/ranger.nix | 0 {users/kat/dev => home}/rustfmt.nix | 0 {users/kat/base => home}/secrets.nix | 0 {users/kat => home}/services/mpd/beets.nix | 0 {users/kat => home}/services/mpd/default.nix | 0 {users/kat => home}/services/mpd/mpd.nix | 0 {users/kat => home}/services/mpd/ncmpcpp.nix | 0 {users/kat => home}/services/weechat.nix | 0 home/shell/bitw.nix | 12 + home/shell/direnv.nix | 6 + home/shell/exa.nix | 11 + home/shell/fzf.nix | 10 + {users/kat/base => home/shell}/git.nix | 7 + {users/kat/base => home/shell}/inputrc.nix | 0 home/shell/packages.nix | 31 ++ {users/kat/dev => home/shell}/rink.nix | 0 {users/kat/base => home/shell}/ssh.nix | 0 home/shell/starship.nix | 6 + {users/kat/base => home/shell}/tmux.nix | 4 +- home/shell/z.nix | 16 + .../kat/base/shell.nix => home/shell/zsh.nix | 93 +--- {users/kat/base => home}/state.nix | 0 {users/kat/sway => home}/sway.nix | 2 +- {users/kat/media => home}/syncplay.nix | 0 {users/kat/base => home}/vim/default.nix | 20 +- {users/kat/base => home}/vim/init.lua | 57 +++ {users/kat/sway => home}/waybar/default.nix | 37 +- {users/kat/sway => home}/waybar/waybar.sass | 0 .../base/weechat.nix => home/weechat/base.nix | 4 +- {users/kat/sway => home}/wofi/default.nix | 0 {users/kat/sway => home}/wofi/wofi.sass | 0 {users/kat/linux => home}/xdg.nix | 4 +- {users/kat/gui => home}/xkb.nix | 2 +- inputs.nix | 4 +- modules/meta/imports.nix | 25 +- users/arc/default.nix => nixos/arc.nix | 0 {profiles => nixos}/base/access.nix | 2 +- {profiles => nixos}/base/base16.nix | 0 {profiles => nixos}/base/documentation.nix | 0 {profiles => nixos}/base/home.nix | 0 {profiles => nixos}/base/kitty.nix | 0 {profiles => nixos}/base/locale.nix | 0 {profiles => nixos}/base/network.nix | 0 {profiles => nixos}/base/nix.nix | 0 {profiles => nixos}/base/packages.nix | 0 {profiles => nixos}/base/secrets.nix | 0 {profiles => nixos}/base/shell.nix | 0 {profiles => nixos}/base/ssh.nix | 0 {profiles => nixos}/base/system.nix | 0 {profiles => nixos}/cross/aarch64.nix | 0 {profiles => nixos}/cross/arm-common.nix | 0 {profiles => nixos}/cross/armv6.nix | 0 {profiles => nixos}/cross/armv7.nix | 0 {profiles => nixos}/cross/default.nix | 12 - {profiles => nixos}/gui/adb.nix | 0 {profiles => nixos}/gui/filesystems.nix | 0 {profiles => nixos}/gui/fonts.nix | 0 {profiles => nixos}/gui/gpg.nix | 0 {profiles => nixos}/gui/mingetty.nix | 0 {profiles => nixos}/gui/nfs.nix | 0 {profiles => nixos}/gui/profile.nix | 0 {profiles => nixos}/gui/qt.nix | 0 {profiles => nixos}/gui/sound.nix | 0 {profiles => nixos}/gui/sway.nix | 0 {profiles => nixos}/gui/udev.nix | 0 {profiles => nixos}/gui/xdg-portals.nix | 0 users/kat/nixos.nix => nixos/kat.nix | 4 +- {profiles => nixos}/light.nix | 4 - {profiles => nixos}/network.nix | 0 {nodes/nixos => nixos/systems}/chen.nix | 6 +- {nodes/nixos => nixos/systems}/daiyousei.nix | 9 +- {nodes/nixos => nixos/systems}/koishi.nix | 14 +- {nodes/nixos => nixos/systems}/marisa.nix | 3 +- {nodes/nixos => nixos/systems}/ran.nix | 6 +- {nodes/nixos => nixos/systems}/rinnosuke.nix | 4 +- {nodes/nixos => nixos/systems}/yukari.nix | 6 +- {profiles => nixos}/vfio/profile.nix | 23 +- {profiles => nixos}/vfio/tsc-tolerance.patch | 0 {users/kat/gui => nixos/x11}/layout.xkb | 0 {profiles => nixos}/x11/profile.nix | 0 outputs.nix | 24 +- overlays/pi/default.nix | 3 - profiles/base/profiles.nix | 109 ---- profiles/gnome/gnome.nix | 39 -- profiles/hardware/hcloud-imperative.nix | 14 - profiles/hardware/laptop/default.nix | 11 - profiles/hardware/raspi.nix | 68 --- profiles/hardware/v330-14arr.nix | 33 -- profiles/shared.nix | 6 - services/znc.nix | 4 +- users/hexchen/default.nix | 42 -- users/kat/base/dconf.nix | 3 - users/kat/base/packages.nix | 24 - users/kat/default.nix | 62 --- users/kat/dev/cookiecutter.nix | 9 - users/kat/dev/doom.d/config.el | 58 --- users/kat/dev/doom.d/init.el | 186 ------- users/kat/dev/doom.d/packages.el | 53 -- users/kat/dev/packages.nix | 13 - users/kat/dev/shell.nix | 7 - users/kat/dev/vim/coc.vim | 135 ----- users/kat/dev/vim/default.nix | 20 - users/kat/dev/vim/init.lua | 57 --- users/kat/gnome/gnome.nix | 6 - users/kat/gui/base16.nix | 3 - users/kat/gui/firefox/default.nix | 383 --------------- users/kat/gui/fonts.nix | 5 - users/kat/gui/foot.nix | 33 -- users/kat/gui/hedgedoc.nix | 10 - users/kat/gui/nextcloud.nix | 13 - users/kat/gui/xdg.nix | 7 - users/kat/i3/dunst.nix | 49 -- users/kat/i3/i3.nix | 309 ------------ users/kat/i3/keyboard.nix | 2 - users/kat/i3/picom.nix | 19 - users/kat/i3/polybar.nix | 464 ------------------ users/kat/i3/rofi.nix | 160 ------ users/kat/personal/bitw.nix | 12 - users/kat/personal/email.nix | 47 -- users/kat/personal/git.nix | 12 - users/kat/personal/nano.png | Bin 188550 -> 0 bytes users/kat/personal/packages.nix | 8 - users/kat/personal/shell.nix | 10 - users/kat/personal/vim/default.nix | 9 - users/kat/personal/vim/init.vim | 8 - users/kat/personal/weechat.nix | 72 --- users/kat/sway/packages.nix | 5 - 177 files changed, 544 insertions(+), 2877 deletions(-) create mode 100644 darwin/base/access.nix rename {profiles/darwin => darwin/base}/home.nix (100%) rename {profiles/darwin => darwin/base}/homebrew.nix (100%) rename {profiles/darwin => darwin/base}/nix.nix (100%) rename {profiles/darwin => darwin/base}/shell.nix (100%) rename users/kat/darwin.nix => darwin/kat.nix (100%) rename {nodes/darwin => darwin/systems}/sumireko.nix (78%) rename {empty => flake/empty}/.keep (100%) rename {trusted => flake/trusted}/flake.lock (93%) rename {trusted => flake/trusted}/flake.nix (92%) rename {profiles/hardware => hardware}/aarch64-darwin.nix (100%) rename {profiles/hardware => hardware}/aarch64-linux.nix (100%) rename {profiles/hardware => hardware}/amdgpu.nix (80%) rename {profiles/hardware => hardware}/bamboo.nix (100%) rename {profiles/hardware => hardware}/default.nix (100%) rename {profiles/hardware => hardware}/eeepc-1015pem.nix (87%) rename {profiles/hardware => hardware}/intel-gpu.nix (100%) rename {profiles/hardware => hardware}/intel.nix (83%) rename profiles/hardware/laptop/light.nix => hardware/laptop.nix (100%) rename {profiles/hardware => hardware}/ms-7b86.nix (84%) rename {profiles/hardware => hardware}/networkmanager.nix (100%) rename {profiles/hardware => hardware}/oracle/common.nix (100%) rename {profiles/hardware => hardware}/oracle/default.nix (72%) rename {profiles/hardware => hardware}/razer.nix (100%) rename {profiles/hardware => hardware}/rm-310.nix (89%) rename {profiles/hardware => hardware}/ryzen.nix (97%) rename {profiles/hardware => hardware}/wifi.nix (95%) rename {profiles/hardware => hardware}/x270.nix (96%) rename {users/kat/base => home}/base16.nix (79%) create mode 100644 home/dconf.nix create mode 100644 home/default.nix create mode 100644 home/firefox/default.nix rename {users/kat/gui => home}/firefox/tst.sass (100%) rename {users/kat/gui => home}/firefox/userChrome.sass (100%) create mode 100644 home/fonts.nix rename {users/kat/sway => home}/gammastep.nix (100%) rename {users/kat/personal => home}/gpg.nix (100%) rename {users/kat/gui => home}/gtk.nix (100%) rename {users/kat => home}/gui/packages.nix (87%) rename {users/kat/gui => home}/kitty.nix (100%) rename {users/kat/gui => home}/konawall.nix (88%) rename {profiles/x11 => home}/layout.xkb (100%) rename {users/kat/sway => home}/mako.nix (100%) rename users/kat/media/packages.nix => home/media.nix (100%) rename {users/kat/media => home}/mpv.nix (100%) rename {users/kat/media => home}/obs.nix (100%) rename {users/kat/gui => home}/qt.nix (100%) rename {users/kat/gui => home}/ranger.nix (100%) rename {users/kat/dev => home}/rustfmt.nix (100%) rename {users/kat/base => home}/secrets.nix (100%) rename {users/kat => home}/services/mpd/beets.nix (100%) rename {users/kat => home}/services/mpd/default.nix (100%) rename {users/kat => home}/services/mpd/mpd.nix (100%) rename {users/kat => home}/services/mpd/ncmpcpp.nix (100%) rename {users/kat => home}/services/weechat.nix (100%) create mode 100644 home/shell/bitw.nix create mode 100644 home/shell/direnv.nix create mode 100644 home/shell/exa.nix create mode 100644 home/shell/fzf.nix rename {users/kat/base => home/shell}/git.nix (76%) rename {users/kat/base => home/shell}/inputrc.nix (100%) create mode 100644 home/shell/packages.nix rename {users/kat/dev => home/shell}/rink.nix (100%) rename {users/kat/base => home/shell}/ssh.nix (100%) create mode 100644 home/shell/starship.nix rename {users/kat/base => home/shell}/tmux.nix (93%) create mode 100644 home/shell/z.nix rename users/kat/base/shell.nix => home/shell/zsh.nix (55%) rename {users/kat/base => home}/state.nix (100%) rename {users/kat/sway => home}/sway.nix (99%) rename {users/kat/media => home}/syncplay.nix (100%) rename {users/kat/base => home}/vim/default.nix (58%) rename {users/kat/base => home}/vim/init.lua (71%) rename {users/kat/sway => home}/waybar/default.nix (81%) rename {users/kat/sway => home}/waybar/waybar.sass (100%) rename users/kat/base/weechat.nix => home/weechat/base.nix (98%) rename {users/kat/sway => home}/wofi/default.nix (100%) rename {users/kat/sway => home}/wofi/wofi.sass (100%) rename {users/kat/linux => home}/xdg.nix (83%) rename {users/kat/gui => home}/xkb.nix (78%) rename users/arc/default.nix => nixos/arc.nix (100%) rename {profiles => nixos}/base/access.nix (98%) rename {profiles => nixos}/base/base16.nix (100%) rename {profiles => nixos}/base/documentation.nix (100%) rename {profiles => nixos}/base/home.nix (100%) rename {profiles => nixos}/base/kitty.nix (100%) rename {profiles => nixos}/base/locale.nix (100%) rename {profiles => nixos}/base/network.nix (100%) rename {profiles => nixos}/base/nix.nix (100%) rename {profiles => nixos}/base/packages.nix (100%) rename {profiles => nixos}/base/secrets.nix (100%) rename {profiles => nixos}/base/shell.nix (100%) rename {profiles => nixos}/base/ssh.nix (100%) rename {profiles => nixos}/base/system.nix (100%) rename {profiles => nixos}/cross/aarch64.nix (100%) rename {profiles => nixos}/cross/arm-common.nix (100%) rename {profiles => nixos}/cross/armv6.nix (100%) rename {profiles => nixos}/cross/armv7.nix (100%) rename {profiles => nixos}/cross/default.nix (58%) rename {profiles => nixos}/gui/adb.nix (100%) rename {profiles => nixos}/gui/filesystems.nix (100%) rename {profiles => nixos}/gui/fonts.nix (100%) rename {profiles => nixos}/gui/gpg.nix (100%) rename {profiles => nixos}/gui/mingetty.nix (100%) rename {profiles => nixos}/gui/nfs.nix (100%) rename {profiles => nixos}/gui/profile.nix (100%) rename {profiles => nixos}/gui/qt.nix (100%) rename {profiles => nixos}/gui/sound.nix (100%) rename {profiles => nixos}/gui/sway.nix (100%) rename {profiles => nixos}/gui/udev.nix (100%) rename {profiles => nixos}/gui/xdg-portals.nix (100%) rename users/kat/nixos.nix => nixos/kat.nix (92%) rename {profiles => nixos}/light.nix (89%) rename {profiles => nixos}/network.nix (100%) rename {nodes/nixos => nixos/systems}/chen.nix (95%) rename {nodes/nixos => nixos/systems}/daiyousei.nix (87%) rename {nodes/nixos => nixos/systems}/koishi.nix (95%) rename {nodes/nixos => nixos/systems}/marisa.nix (98%) rename {nodes/nixos => nixos/systems}/ran.nix (94%) rename {nodes/nixos => nixos/systems}/rinnosuke.nix (90%) rename {nodes/nixos => nixos/systems}/yukari.nix (97%) rename {profiles => nixos}/vfio/profile.nix (92%) rename {profiles => nixos}/vfio/tsc-tolerance.patch (100%) rename {users/kat/gui => nixos/x11}/layout.xkb (100%) rename {profiles => nixos}/x11/profile.nix (100%) delete mode 100644 overlays/pi/default.nix delete mode 100644 profiles/base/profiles.nix delete mode 100644 profiles/gnome/gnome.nix delete mode 100644 profiles/hardware/hcloud-imperative.nix delete mode 100644 profiles/hardware/laptop/default.nix delete mode 100644 profiles/hardware/raspi.nix delete mode 100644 profiles/hardware/v330-14arr.nix delete mode 100644 profiles/shared.nix delete mode 100644 users/hexchen/default.nix delete mode 100644 users/kat/base/dconf.nix delete mode 100644 users/kat/base/packages.nix delete mode 100644 users/kat/default.nix delete mode 100644 users/kat/dev/cookiecutter.nix delete mode 100644 users/kat/dev/doom.d/config.el delete mode 100644 users/kat/dev/doom.d/init.el delete mode 100644 users/kat/dev/doom.d/packages.el delete mode 100644 users/kat/dev/packages.nix delete mode 100644 users/kat/dev/shell.nix delete mode 100644 users/kat/dev/vim/coc.vim delete mode 100644 users/kat/dev/vim/default.nix delete mode 100644 users/kat/dev/vim/init.lua delete mode 100644 users/kat/gnome/gnome.nix delete mode 100644 users/kat/gui/base16.nix delete mode 100644 users/kat/gui/firefox/default.nix delete mode 100644 users/kat/gui/fonts.nix delete mode 100644 users/kat/gui/foot.nix delete mode 100644 users/kat/gui/hedgedoc.nix delete mode 100644 users/kat/gui/nextcloud.nix delete mode 100644 users/kat/gui/xdg.nix delete mode 100644 users/kat/i3/dunst.nix delete mode 100644 users/kat/i3/i3.nix delete mode 100644 users/kat/i3/keyboard.nix delete mode 100644 users/kat/i3/picom.nix delete mode 100644 users/kat/i3/polybar.nix delete mode 100644 users/kat/i3/rofi.nix delete mode 100644 users/kat/personal/bitw.nix delete mode 100644 users/kat/personal/email.nix delete mode 100644 users/kat/personal/git.nix delete mode 100644 users/kat/personal/nano.png delete mode 100644 users/kat/personal/packages.nix delete mode 100644 users/kat/personal/shell.nix delete mode 100644 users/kat/personal/vim/default.nix delete mode 100644 users/kat/personal/vim/init.vim delete mode 100644 users/kat/personal/weechat.nix delete mode 100644 users/kat/sway/packages.nix diff --git a/darwin/base/access.nix b/darwin/base/access.nix new file mode 100644 index 00000000..5740b1e7 --- /dev/null +++ b/darwin/base/access.nix @@ -0,0 +1,6 @@ +{ meta, config, ... }: { + imports = with meta; [ + home.base + ]; +} + diff --git a/profiles/darwin/home.nix b/darwin/base/home.nix similarity index 100% rename from profiles/darwin/home.nix rename to darwin/base/home.nix diff --git a/profiles/darwin/homebrew.nix b/darwin/base/homebrew.nix similarity index 100% rename from profiles/darwin/homebrew.nix rename to darwin/base/homebrew.nix diff --git a/profiles/darwin/nix.nix b/darwin/base/nix.nix similarity index 100% rename from profiles/darwin/nix.nix rename to darwin/base/nix.nix diff --git a/profiles/darwin/shell.nix b/darwin/base/shell.nix similarity index 100% rename from profiles/darwin/shell.nix rename to darwin/base/shell.nix diff --git a/users/kat/darwin.nix b/darwin/kat.nix similarity index 100% rename from users/kat/darwin.nix rename to darwin/kat.nix diff --git a/nodes/darwin/sumireko.nix b/darwin/systems/sumireko.nix similarity index 78% rename from nodes/darwin/sumireko.nix rename to darwin/systems/sumireko.nix index 02b690e0..4b9c175f 100644 --- a/nodes/darwin/sumireko.nix +++ b/darwin/systems/sumireko.nix @@ -1,9 +1,8 @@ { config, pkgs, lib, inputs, meta, ... }: { imports = with meta; [ - profiles.hardware.aarch64-darwin - profiles.darwin - users.kat.darwin - users.kat.dev + hardware.aarch64-darwin + darwin.base + darwin.kat ]; security.pam.enableSudoTouchIdAuth = true; @@ -14,6 +13,7 @@ "element" "visual-studio-code" "firefox" + "telegram" "discord" ]; }; diff --git a/devShell.nix b/devShell.nix index 13474cda..c0086fce 100644 --- a/devShell.nix +++ b/devShell.nix @@ -29,7 +29,7 @@ let nf-update = pkgs.writeShellScriptBin "nf-update" '' nix flake update if [[ -n $TRUSTED ]]; then - nix flake lock ./trusted --update-input trusted + nix flake lock ./flake/trusted --update-input trusted fi ''; sumireko-apply = pkgs.writeShellScriptBin "sumireko-apply" '' @@ -45,6 +45,7 @@ with lib; pkgs.mkShell { nf-update sumireko-apply ] ++ config.runners.lazy.nativeBuildInputs + # ++ optional (builtins.getEnv "TRUSTED" != "") (pkgs.writeShellScriptBin "bitw" ''${pkgs.rbw-bitw}/bin/bitw -p gpg://${config.network.nodes.nixos.koishi.kw.secrets.repo.bitw.source} "$@"'') ++ (map (node: writeShellScriptBin "${node.networking.hostName}-sd-img" '' nix build -f . network.nodes.${node.networking.hostName}.system.build.sdImage --show-trace diff --git a/flake.lock b/flake.lock index 81813c65..671c7dd0 100644 --- a/flake.lock +++ b/flake.lock @@ -3,11 +3,11 @@ "arcexprs": { "flake": false, "locked": { - "lastModified": 1657234505, - "narHash": "sha256-uDlulP599ZbH+Fgw317nYMfyS+vnKwIDgQevMyc/SV4=", + "lastModified": 1657481944, + "narHash": "sha256-b9fAcaHvclH50zjwxCq972F7uKNEerkShjM5YFOm6RA=", "owner": "arcnmx", "repo": "nixexprs", - "rev": "28017bbbea8ca56691b9c7625a032c2e2dd6283a", + "rev": "493ec79ee75efe10f06747d83e5eaca4409a4a6c", "type": "github" }, "original": { @@ -96,11 +96,11 @@ "nixpkgs": "nixpkgs" }, "locked": { - "lastModified": 1657305762, - "narHash": "sha256-dsuJG/y2LtqyHhDEIo3d3g/+K9IqhG3qt/tf7WYheH4=", + "lastModified": 1657477325, + "narHash": "sha256-MeTve5Xl2947w9wZRGPo6DrGvhPW2bbeqfSXNex/EG4=", "owner": "nix-community", "repo": "emacs-overlay", - "rev": "eae26b7d5fc04699078a1687185d65077bc73c96", + "rev": "23c09e04995402b7d97b18d72ce262cb60549df1", "type": "github" }, "original": { @@ -355,11 +355,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1657114324, - "narHash": "sha256-fWuaUNXrHcz/ciHRHlcSO92dvV3EVS0GJQUSBO5JIB4=", + "lastModified": 1657356697, + "narHash": "sha256-sT38tcx7m0Quz+Uj6jzx+yRa2+EVW2C3cE0FkROXUzQ=", "owner": "nixos", "repo": "nixpkgs", - "rev": "a5c867d9fe9e4380452628e8f171c26b69fa9d3d", + "rev": "87e7965bbcdbac3d103e3ed14ff04f719a4f7a58", "type": "github" }, "original": { @@ -387,11 +387,11 @@ }, "nur": { "locked": { - "lastModified": 1657315594, - "narHash": "sha256-lkAqmREtGhWwHK3wdVSfqt+Q+xUhZmQ0UZyubeMJLR4=", + "lastModified": 1657458605, + "narHash": "sha256-WAoPHlCNTV/yXLF72D7vj+gk1yjfNBM3PmZ61sCT4co=", "owner": "nix-community", "repo": "nur", - "rev": "fae381cd12525fdfb5163ce0ac78c2705d5917c4", + "rev": "fe1f99449c93be772b31de520eebaee6feb8717e", "type": "github" }, "original": { @@ -568,11 +568,11 @@ "locked": { "lastModified": 1, "narHash": "sha256-Q3QXOoy+iN4VK2CflvRulYvPZXYgF0dO7FoF7CvWFTA=", - "path": "./empty/.", + "path": "./flake/empty/.", "type": "path" }, "original": { - "path": "./empty/.", + "path": "./flake/empty/.", "type": "path" } } diff --git a/flake.nix b/flake.nix index c66d5724..0149e5b8 100644 --- a/flake.nix +++ b/flake.nix @@ -37,7 +37,7 @@ }; flake-utils.url = "github:numtide/flake-utils"; trusted = { - url = "path:./empty/."; + url = "path:./flake/empty/."; flake = false; }; flake-compat = { @@ -50,7 +50,7 @@ providedSystems = flake-utils.lib.eachDefaultSystem (system: rec { - devShell = import ./devShell.nix { inherit inputs system; }; + devShells.default = import ./devShell.nix { inherit inputs system; }; legacyPackages = import ./outputs.nix { inherit inputs system; }; }); in providedSystems // { diff --git a/empty/.keep b/flake/empty/.keep similarity index 100% rename from empty/.keep rename to flake/empty/.keep diff --git a/trusted/flake.lock b/flake/trusted/flake.lock similarity index 93% rename from trusted/flake.lock rename to flake/trusted/flake.lock index 0c53d715..e1378b15 100644 --- a/trusted/flake.lock +++ b/flake/trusted/flake.lock @@ -3,11 +3,11 @@ "arcexprs": { "flake": false, "locked": { - "lastModified": 1657234505, - "narHash": "sha256-uDlulP599ZbH+Fgw317nYMfyS+vnKwIDgQevMyc/SV4=", + "lastModified": 1657481944, + "narHash": "sha256-b9fAcaHvclH50zjwxCq972F7uKNEerkShjM5YFOm6RA=", "owner": "arcnmx", "repo": "nixexprs", - "rev": "28017bbbea8ca56691b9c7625a032c2e2dd6283a", + "rev": "493ec79ee75efe10f06747d83e5eaca4409a4a6c", "type": "github" }, "original": { @@ -98,11 +98,11 @@ "nixpkgs": "nixpkgs" }, "locked": { - "lastModified": 1657305762, - "narHash": "sha256-dsuJG/y2LtqyHhDEIo3d3g/+K9IqhG3qt/tf7WYheH4=", + "lastModified": 1657477325, + "narHash": "sha256-MeTve5Xl2947w9wZRGPo6DrGvhPW2bbeqfSXNex/EG4=", "owner": "nix-community", "repo": "emacs-overlay", - "rev": "eae26b7d5fc04699078a1687185d65077bc73c96", + "rev": "23c09e04995402b7d97b18d72ce262cb60549df1", "type": "github" }, "original": { @@ -367,12 +367,12 @@ }, "locked": { "lastModified": 0, - "narHash": "sha256-FHjqiLYqBGP1qEmyNkmHIulZKiifg+K8AD1WlIW592s=", - "path": "/nix/store/psp2lvg1gjpy781cvvd703wrjmk27d5f-source", + "narHash": "sha256-WoNwisXEGdCMmpvIKl2ufMXkvIUboFJsImWy+a1Vqxk=", + "path": "/nix/store/1x5vxzi56ywzbw2pfnblwxy459gzm29g-source", "type": "path" }, "original": { - "path": "/nix/store/psp2lvg1gjpy781cvvd703wrjmk27d5f-source", + "path": "/nix/store/1x5vxzi56ywzbw2pfnblwxy459gzm29g-source", "type": "path" } }, @@ -391,11 +391,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1657114324, - "narHash": "sha256-fWuaUNXrHcz/ciHRHlcSO92dvV3EVS0GJQUSBO5JIB4=", + "lastModified": 1657356697, + "narHash": "sha256-sT38tcx7m0Quz+Uj6jzx+yRa2+EVW2C3cE0FkROXUzQ=", "owner": "nixos", "repo": "nixpkgs", - "rev": "a5c867d9fe9e4380452628e8f171c26b69fa9d3d", + "rev": "87e7965bbcdbac3d103e3ed14ff04f719a4f7a58", "type": "github" }, "original": { @@ -423,11 +423,11 @@ }, "nur": { "locked": { - "lastModified": 1657315594, - "narHash": "sha256-lkAqmREtGhWwHK3wdVSfqt+Q+xUhZmQ0UZyubeMJLR4=", + "lastModified": 1657458605, + "narHash": "sha256-WAoPHlCNTV/yXLF72D7vj+gk1yjfNBM3PmZ61sCT4co=", "owner": "nix-community", "repo": "nur", - "rev": "fae381cd12525fdfb5163ce0ac78c2705d5917c4", + "rev": "fe1f99449c93be772b31de520eebaee6feb8717e", "type": "github" }, "original": { @@ -591,11 +591,11 @@ "trusted": { "flake": false, "locked": { - "lastModified": 1652985072, - "narHash": "sha256-SHqXjkk10wMdE47jUSAuLfWIJ40L3cDP6UOiBhZKtVY=", + "lastModified": 1657482041, + "narHash": "sha256-AEC0DO586Xq5NcYwyEBAosFj5VRSwLSPZCH5v5ri11s=", "ref": "main", - "rev": "2af2d4cc2e4675a7eebbdfccd5542d306104c237", - "revCount": 90, + "rev": "76779729b344d8427f05d9e78c76a19daa7cc2a8", + "revCount": 92, "type": "git", "url": "ssh://git@github.com/kittywitch/nixfiles-trusted" }, diff --git a/trusted/flake.nix b/flake/trusted/flake.nix similarity index 92% rename from trusted/flake.nix rename to flake/trusted/flake.nix index b3638153..6463b6c2 100644 --- a/trusted/flake.nix +++ b/flake/trusted/flake.nix @@ -5,7 +5,7 @@ flake = false; }; nixfiles = { - url = "../."; + url = "../../."; inputs.trusted.follows = "trusted"; }; }; diff --git a/profiles/hardware/aarch64-darwin.nix b/hardware/aarch64-darwin.nix similarity index 100% rename from profiles/hardware/aarch64-darwin.nix rename to hardware/aarch64-darwin.nix diff --git a/profiles/hardware/aarch64-linux.nix b/hardware/aarch64-linux.nix similarity index 100% rename from profiles/hardware/aarch64-linux.nix rename to hardware/aarch64-linux.nix diff --git a/profiles/hardware/amdgpu.nix b/hardware/amdgpu.nix similarity index 80% rename from profiles/hardware/amdgpu.nix rename to hardware/amdgpu.nix index 9dd3caab..f00a37c1 100644 --- a/profiles/hardware/amdgpu.nix +++ b/hardware/amdgpu.nix @@ -3,8 +3,6 @@ with lib; { - deploy.profile.hardware.amdgpu = true; - boot.initrd.availableKernelModules = [ "amdgpu" ]; hardware.opengl.extraPackages = with pkgs; [ libvdpau-va-gl vaapiVdpau ]; } diff --git a/profiles/hardware/bamboo.nix b/hardware/bamboo.nix similarity index 100% rename from profiles/hardware/bamboo.nix rename to hardware/bamboo.nix diff --git a/profiles/hardware/default.nix b/hardware/default.nix similarity index 100% rename from profiles/hardware/default.nix rename to hardware/default.nix diff --git a/profiles/hardware/eeepc-1015pem.nix b/hardware/eeepc-1015pem.nix similarity index 87% rename from profiles/hardware/eeepc-1015pem.nix rename to hardware/eeepc-1015pem.nix index ccf249b8..6d1305db 100644 --- a/profiles/hardware/eeepc-1015pem.nix +++ b/hardware/eeepc-1015pem.nix @@ -1,8 +1,6 @@ { config, ... }: { - deploy.profile.hardware.eeepc-1015pem = true; - boot = { initrd = { availableKernelModules = [ "uhci_hcd" "ehci_pci" "ahci" "usb_storage" "sd_mod" ]; diff --git a/profiles/hardware/intel-gpu.nix b/hardware/intel-gpu.nix similarity index 100% rename from profiles/hardware/intel-gpu.nix rename to hardware/intel-gpu.nix diff --git a/profiles/hardware/intel.nix b/hardware/intel.nix similarity index 83% rename from profiles/hardware/intel.nix rename to hardware/intel.nix index 01367693..727130fe 100644 --- a/profiles/hardware/intel.nix +++ b/hardware/intel.nix @@ -5,8 +5,6 @@ */ { - deploy.profile.hardware.intel = true; - hardware.cpu.intel.updateMicrocode = true; boot = { diff --git a/profiles/hardware/laptop/light.nix b/hardware/laptop.nix similarity index 100% rename from profiles/hardware/laptop/light.nix rename to hardware/laptop.nix diff --git a/profiles/hardware/ms-7b86.nix b/hardware/ms-7b86.nix similarity index 84% rename from profiles/hardware/ms-7b86.nix rename to hardware/ms-7b86.nix index af976ef9..0a3fd725 100644 --- a/profiles/hardware/ms-7b86.nix +++ b/hardware/ms-7b86.nix @@ -7,8 +7,6 @@ with lib; { - deploy.profile.hardware.ms-7b86 = true; - boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usbhid" "sd_mod" ]; boot.kernelModules = [ "nct6775" ]; } diff --git a/profiles/hardware/networkmanager.nix b/hardware/networkmanager.nix similarity index 100% rename from profiles/hardware/networkmanager.nix rename to hardware/networkmanager.nix diff --git a/profiles/hardware/oracle/common.nix b/hardware/oracle/common.nix similarity index 100% rename from profiles/hardware/oracle/common.nix rename to hardware/oracle/common.nix diff --git a/profiles/hardware/oracle/default.nix b/hardware/oracle/default.nix similarity index 72% rename from profiles/hardware/oracle/default.nix rename to hardware/oracle/default.nix index c1193f74..515ae0a6 100644 --- a/profiles/hardware/oracle/default.nix +++ b/hardware/oracle/default.nix @@ -2,10 +2,6 @@ profiles = tree.prev; appendedProfiles = with profiles; { ubuntu = { config, ... }: { - deploy.profile.hardware.oracle = { - ubuntu = true; - common = true; - }; kw.oci.base = "Canonical Ubuntu"; imports = with import (inputs.tf-nix + "/modules"); [ nixos.ubuntu-linux @@ -13,10 +9,6 @@ ]; }; oracle = { config, ... }: { - deploy.profile.hardware.oracle = { - oracle = true; - common = true; - }; kw.oci.base = "Oracle Linux"; imports = with import (inputs.tf-nix + "/modules"); [ nixos.oracle-linux diff --git a/profiles/hardware/razer.nix b/hardware/razer.nix similarity index 100% rename from profiles/hardware/razer.nix rename to hardware/razer.nix diff --git a/profiles/hardware/rm-310.nix b/hardware/rm-310.nix similarity index 89% rename from profiles/hardware/rm-310.nix rename to hardware/rm-310.nix index e1c34a73..f0e21255 100644 --- a/profiles/hardware/rm-310.nix +++ b/hardware/rm-310.nix @@ -5,8 +5,6 @@ */ { - deploy.profile.hardware.rm-310 = true; - boot.initrd.availableKernelModules = [ "ata_generic" "ehci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ]; boot.initrd.kernelModules = [ ]; boot.kernelModules = [ ]; diff --git a/profiles/hardware/ryzen.nix b/hardware/ryzen.nix similarity index 97% rename from profiles/hardware/ryzen.nix rename to hardware/ryzen.nix index c1c09684..2ed11f72 100644 --- a/profiles/hardware/ryzen.nix +++ b/hardware/ryzen.nix @@ -34,8 +34,6 @@ }; config = { - deploy.profile.hardware.ryzen = true; - boot = { kernelModules = [ "msr" diff --git a/profiles/hardware/wifi.nix b/hardware/wifi.nix similarity index 95% rename from profiles/hardware/wifi.nix rename to hardware/wifi.nix index c4cbc7e1..83ff9b2d 100644 --- a/profiles/hardware/wifi.nix +++ b/hardware/wifi.nix @@ -20,7 +20,6 @@ }; }; - deploy.profile.hardware.wifi = true; networking.wireless = { enable = true; networks = mkIf (builtins.getEnv "TF_IN_AUTOMATION" != "" || tf.state.enable) { diff --git a/profiles/hardware/x270.nix b/hardware/x270.nix similarity index 96% rename from profiles/hardware/x270.nix rename to hardware/x270.nix index 65c72bea..4cad46c8 100644 --- a/profiles/hardware/x270.nix +++ b/hardware/x270.nix @@ -34,8 +34,6 @@ }; config = { - deploy.profile.hardware.x270 = true; - boot = { initrd.availableKernelModules = [ "xhci_pci" "nvme" "usb_storage" "sd_mod" "sr_mod" "rtsx_usb_sdmmc" ]; diff --git a/users/kat/base/base16.nix b/home/base16.nix similarity index 79% rename from users/kat/base/base16.nix rename to home/base16.nix index b5bdc2fb..b0e56df3 100644 --- a/users/kat/base/base16.nix +++ b/home/base16.nix @@ -1,6 +1,8 @@ -{ config, lib, ... }: +{ config, pkgs, lib, ... }: { + kw.theme.enable = true; + base16 = { shell.enable = true; schemes = [ "atelier.atelier-cave" "atelier.atelier-cave-light" ]; diff --git a/home/dconf.nix b/home/dconf.nix new file mode 100644 index 00000000..531cb90a --- /dev/null +++ b/home/dconf.nix @@ -0,0 +1,3 @@ +{ config, lib, ... }: { + dconf.enable = lib.mkDefault false; +} diff --git a/home/default.nix b/home/default.nix new file mode 100644 index 00000000..ccfe2c8e --- /dev/null +++ b/home/default.nix @@ -0,0 +1,48 @@ +{ lib, tree, ... }: let + wrapImports = imports: lib.mapAttrs + (_: paths: { config, ... }: { + config.home-manager.users.kat = { + imports = lib.singleton paths; + }; + }) + imports; + dirImports = wrapImports tree.prev; + serviceImports = wrapImports tree.prev.services; +in + dirImports // { + base = { + imports = with dirImports; [ + base16 + shell + vim + secrets + state + dconf + ]; + }; + gui = { + imports = with dirImports; [ + gui + firefox + konawall + ranger + xkb + kitty + gpg + sway + mako + gammastep + wofi + waybar + xdg + fonts + media + obs + mpv + syncplay + gtk + qt + ]; + }; + services = serviceImports; +} diff --git a/home/firefox/default.nix b/home/firefox/default.nix new file mode 100644 index 00000000..0552e70c --- /dev/null +++ b/home/firefox/default.nix @@ -0,0 +1,174 @@ +{ config, lib, pkgs, nixos, kw, ... }: with lib; + +let + commonSettings = { + "app.update.auto" = false; + "identity.fxaccounts.account.device.name" = nixos.networking.hostName; + "browser.download.lastDir" = "/home/kat/downloads"; + "toolkit.legacyUserProfileCustomizations.stylesheets" = true; + "svg.context-properties.content.enabled" = true; + "services.sync.engine.prefs" = false; + "services.sync.engine.prefs.modified" = false; + "services.sync.engine.passwords" = false; + "services.sync.declinedEngines" = "passwords,adblockplus,prefs"; + "media.eme.enabled" = true; # whee drm + "gfx.webrender.all.qualified" = true; + "gfx.webrender.all" = true; + "layers.acceleration.force-enabled" = true; + "gfx.canvas.azure.accelerated" = true; + "browser.ctrlTab.recentlyUsedOrder" = false; + "privacy.resistFingerprinting.block_mozAddonManager" = true; + "extensions.webextensions.restrictedDomains" = ""; + "tridactyl.unfixedamo" = true; + "tridactyl.unfixedamo_removed" = true; + "browser.shell.checkDefaultBrowser" = false; + "spellchecker.dictionary" = "en-CA"; + "ui.context_menus.after_mouseup" = true; + "browser.warnOnQuit" = false; + "browser.quitShortcut.disabled" = true; + "browser.startup.homepage" = "about:blank"; + "browser.contentblocking.category" = "strict"; + "browser.discovery.enabled" = false; + "browser.tabs.multiselect" = true; + "browser.tabs.unloadOnLowMemory" = true; + "browser.newtab.privateAllowed" = true; + "browser.newtabpage.enabled" = false; + "browser.urlbar.placeholderName" = ""; + "extensions.privatebrowsing.notification" = false; + "browser.startup.page" = 3; + "devtools.chrome.enabled" = true; + "devtools.inspector.showUserAgentStyles" = true; + "services.sync.prefs.sync.privacy.donottrackheader.value" = false; + "services.sync.prefs.sync.browser.safebrowsing.malware.enabled" = false; + "services.sync.prefs.sync.browser.safebrowsing.phishing.enabled" = false; + "app.shield.optoutstudies.enabled" = true; + "datareporting.healthreport.uploadEnabled" = false; + "datareporting.policy.dataSubmissionEnabled" = false; + "datareporting.sessions.current.clean" = true; + "devtools.onboarding.telemetry.logged" = false; + "toolkit.telemetry.updatePing.enabled" = false; + "browser.ping-centre.telemetry" = false; + "browser.newtabpage.activity-stream.asrouter.userprefs.cfr.addons" = false; + "browser.newtabpage.activity-stream.asrouter.userprefs.cfr.features" = false; + "toolkit.telemetry.bhrPing.enabled" = false; + "toolkit.telemetry.enabled" = false; + "toolkit.telemetry.firstShutdownPing.enabled" = false; + "toolkit.telemetry.hybridContent.enabled" = false; + "toolkit.telemetry.newProfilePing.enabled" = false; + "toolkit.telemetry.reportingpolicy.firstRun" = false; + "toolkit.telemetry.shutdownPingSender.enabled" = false; + "toolkit.telemetry.unified" = false; + "toolkit.telemetry.server" = ""; + "toolkit.telemetry.archive.enabled" = false; + "browser.onboarding.enabled" = false; + "experiments.enabled" = false; + "network.allow-experiments" = false; + "social.directories" = ""; + "social.remote-install.enabled" = false; + "social.toast-notifications.enabled" = false; + "social.whitelist" = ""; + "browser.safebrowsing.malware.enabled" = false; + "browser.safebrowsing.blockedURIs.enabled" = false; + "browser.safebrowsing.downloads.enabled" = false; + "browser.safebrowsing.downloads.remote.enabled" = false; + "browser.safebrowsing.phishing.enabled" = false; + "dom.ipc.plugins.reportCrashURL" = false; + "breakpad.reportURL" = ""; + "beacon.enabled" = false; + "browser.search.geoip.url" = ""; + "browser.search.region" = "UK"; + "browser.search.suggest.enabled" = true; + "browser.search.update" = false; + "browser.selfsupport.url" = ""; + "extensions.getAddons.cache.enabled" = false; + "extensions.pocket.enabled" = true; + "geo.enabled" = false; + "geo.wifi.uri" = false; + "media.getusermedia.screensharing.enabled" = false; + "media.video_stats.enabled" = false; + "device.sensors.enabled" = false; + "dom.battery.enabled" = false; + "dom.enable_performance" = false; + "network.dns.disablePrefetch" = false; + "network.http.speculative-parallel-limit" = 8; + "network.predictor.cleaned-up" = true; + "network.predictor.enabled" = true; + "network.prefetch-next" = true; + "security.dialog_enable_delay" = 300; + "dom.event.contextmenu.enabled" = false; + "privacy.trackingprotection.enabled" = true; + "privacy.trackingprotection.fingerprinting.enabled" = true; + "privacy.trackingprotection.cryptomining.enabled" = true; + "privacy.trackingprotection.introCount" = 20; + "signon.rememberSignons" = false; + "xpinstall.whitelist.required" = false; + "xpinstall.signatures.required" = false; + "general.warnOnAboutConfig" = false; + }; +in +{ + home.file.".mozilla/tst.css" = { inherit (kw.sassTemplate { name = "tst"; src = ./tst.sass; }) source; }; + + programs.zsh.shellAliases = { + ff-pm = "firefox --ProfileManager"; + ff-main = "firefox -P main"; + }; + + home.sessionVariables = { + XDG_CURRENT_DESKTOP = "sway"; + }; + + programs.firefox = { + enable = true; + packageUnwrapped = pkgs.firefox-unwrapped; + wrapperConfig = { + extraPolicies = { + DisableAppUpdate = true; + }; + extraNativeMessagingHosts = with pkgs; [ + tridactyl-native + ] ++ optional config.programs.buku.enable bukubrow; + }; + extensions = with pkgs.nur.repos.rycee.firefox-addons; [ + sponsorblock + link-cleaner + a11ycss + canvasblocker + view-image + wappalyzer + auto-tab-discard + bitwarden + darkreader + decentraleyes + foxyproxy-standard + clearurls + df-youtube + tridactyl + old-reddit-redirect + privacy-badger + reddit-enhancement-suite + refined-github + stylus + temporary-containers + browserpass + tree-style-tab + multi-account-containers + ublock-origin + violentmonkey + ]; + profiles = { + main = { + id = 0; + isDefault = true; + settings = commonSettings; + userChrome = (kw.sassTemplate { name = "userChrome"; src = ./userChrome.sass; }).text; + containers.identities = [ + { id = 7; name = "Professional"; icon = "briefcase"; color = "red"; } + { id = 8; name = "Shopping"; icon = "cart"; color = "pink"; } + { id = 9; name = "Sensitive"; icon = "gift"; color = "orange"; } + { id = 10; name = "Private"; icon = "fence"; color = "blue"; } + ]; + }; + }; + }; +} diff --git a/users/kat/gui/firefox/tst.sass b/home/firefox/tst.sass similarity index 100% rename from users/kat/gui/firefox/tst.sass rename to home/firefox/tst.sass diff --git a/users/kat/gui/firefox/userChrome.sass b/home/firefox/userChrome.sass similarity index 100% rename from users/kat/gui/firefox/userChrome.sass rename to home/firefox/userChrome.sass diff --git a/home/fonts.nix b/home/fonts.nix new file mode 100644 index 00000000..4c1118f6 --- /dev/null +++ b/home/fonts.nix @@ -0,0 +1,3 @@ +{ config, pkgs, lib, ... }: { + fonts.fontconfig.enable = true; +} diff --git a/users/kat/sway/gammastep.nix b/home/gammastep.nix similarity index 100% rename from users/kat/sway/gammastep.nix rename to home/gammastep.nix diff --git a/users/kat/personal/gpg.nix b/home/gpg.nix similarity index 100% rename from users/kat/personal/gpg.nix rename to home/gpg.nix diff --git a/users/kat/gui/gtk.nix b/home/gtk.nix similarity index 100% rename from users/kat/gui/gtk.nix rename to home/gtk.nix diff --git a/users/kat/gui/packages.nix b/home/gui/packages.nix similarity index 87% rename from users/kat/gui/packages.nix rename to home/gui/packages.nix index e669f8f2..dc2c6433 100644 --- a/users/kat/gui/packages.nix +++ b/home/gui/packages.nix @@ -2,7 +2,6 @@ { home.packages = with pkgs; [ - _1password btop bitwarden discord @@ -13,13 +12,10 @@ tdesktop headsetcontrol transmission-remote-gtk - scrcpy lm_sensors p7zip zip unzip - nyxt - baresip yubikey-manager jmtpfs element-desktop diff --git a/users/kat/gui/kitty.nix b/home/kitty.nix similarity index 100% rename from users/kat/gui/kitty.nix rename to home/kitty.nix diff --git a/users/kat/gui/konawall.nix b/home/konawall.nix similarity index 88% rename from users/kat/gui/konawall.nix rename to home/konawall.nix index 8efd7b13..bea27d2c 100644 --- a/users/kat/gui/konawall.nix +++ b/home/konawall.nix @@ -1,6 +1,5 @@ { config, pkgs, nixos, lib, ... }: -with lib; { services.konawall = { @@ -8,7 +7,7 @@ with lib; interval = "30m"; mode = "shuffle"; commonTags = [ "width:>=1600" ]; - tagList = map (toList) [ + tagList = map (lib.toList) [ (["score:>=50" "touhou" "rating:s"]) #++ optional (nixos.networking.hostName == "koishi") "rating:s") ]; diff --git a/profiles/x11/layout.xkb b/home/layout.xkb similarity index 100% rename from profiles/x11/layout.xkb rename to home/layout.xkb diff --git a/users/kat/sway/mako.nix b/home/mako.nix similarity index 100% rename from users/kat/sway/mako.nix rename to home/mako.nix diff --git a/users/kat/media/packages.nix b/home/media.nix similarity index 100% rename from users/kat/media/packages.nix rename to home/media.nix diff --git a/users/kat/media/mpv.nix b/home/mpv.nix similarity index 100% rename from users/kat/media/mpv.nix rename to home/mpv.nix diff --git a/users/kat/media/obs.nix b/home/obs.nix similarity index 100% rename from users/kat/media/obs.nix rename to home/obs.nix diff --git a/users/kat/gui/qt.nix b/home/qt.nix similarity index 100% rename from users/kat/gui/qt.nix rename to home/qt.nix diff --git a/users/kat/gui/ranger.nix b/home/ranger.nix similarity index 100% rename from users/kat/gui/ranger.nix rename to home/ranger.nix diff --git a/users/kat/dev/rustfmt.nix b/home/rustfmt.nix similarity index 100% rename from users/kat/dev/rustfmt.nix rename to home/rustfmt.nix diff --git a/users/kat/base/secrets.nix b/home/secrets.nix similarity index 100% rename from users/kat/base/secrets.nix rename to home/secrets.nix diff --git a/users/kat/services/mpd/beets.nix b/home/services/mpd/beets.nix similarity index 100% rename from users/kat/services/mpd/beets.nix rename to home/services/mpd/beets.nix diff --git a/users/kat/services/mpd/default.nix b/home/services/mpd/default.nix similarity index 100% rename from users/kat/services/mpd/default.nix rename to home/services/mpd/default.nix diff --git a/users/kat/services/mpd/mpd.nix b/home/services/mpd/mpd.nix similarity index 100% rename from users/kat/services/mpd/mpd.nix rename to home/services/mpd/mpd.nix diff --git a/users/kat/services/mpd/ncmpcpp.nix b/home/services/mpd/ncmpcpp.nix similarity index 100% rename from users/kat/services/mpd/ncmpcpp.nix rename to home/services/mpd/ncmpcpp.nix diff --git a/users/kat/services/weechat.nix b/home/services/weechat.nix similarity index 100% rename from users/kat/services/weechat.nix rename to home/services/weechat.nix diff --git a/home/shell/bitw.nix b/home/shell/bitw.nix new file mode 100644 index 00000000..5f6a0afe --- /dev/null +++ b/home/shell/bitw.nix @@ -0,0 +1,12 @@ +{ config, pkgs, meta, lib, ... }: { + programs.rbw = { + enable = true; + package = lib.mkIf (meta.trusted ? secrets) (pkgs.writeShellScriptBin "bitw" ''${pkgs.rbw-bitw}/bin/bitw -p gpg://${config.kw.secrets.repo.bitw.source} "$@"''); + settings = { + email = "kat@kittywit.ch"; + base_url = "https://vault.kittywit.ch"; + identity_url = null; + lock_timeout = 3600; + }; + }; +} diff --git a/home/shell/direnv.nix b/home/shell/direnv.nix new file mode 100644 index 00000000..6c116fa0 --- /dev/null +++ b/home/shell/direnv.nix @@ -0,0 +1,6 @@ +{ config, ... }: { + programs.direnv = { + enable = true; + enableZshIntegration = true; + }; +} diff --git a/home/shell/exa.nix b/home/shell/exa.nix new file mode 100644 index 00000000..cc9eded0 --- /dev/null +++ b/home/shell/exa.nix @@ -0,0 +1,11 @@ +{ config, pkgs, ... }: { + home.packages = [ pkgs.exa ]; + + programs.zsh.shellAliases = { + exa = "exa --time-style long-iso"; + ls = "exa -G"; + la = "exa -Ga"; + ll = "exa -l"; + lla = "exa -lga"; + }; +} diff --git a/home/shell/fzf.nix b/home/shell/fzf.nix new file mode 100644 index 00000000..36117a7b --- /dev/null +++ b/home/shell/fzf.nix @@ -0,0 +1,10 @@ +{ config, pkgs, lib, ... }: { + programs.fzf = { + enable = true; + enableZshIntegration = true; + }; + programs.zsh.plugins = lib.optional (pkgs.hostPlatform == pkgs.buildPlatform) ({ + name = "fzf-tab"; + src = "${pkgs.zsh-fzf-tab}/share/fzf-tab"; + }); +} diff --git a/users/kat/base/git.nix b/home/shell/git.nix similarity index 76% rename from users/kat/base/git.nix rename to home/shell/git.nix index e1e59bac..3badc651 100644 --- a/users/kat/base/git.nix +++ b/home/shell/git.nix @@ -1,7 +1,14 @@ { config, pkgs, lib, ... }: { + home.packages = with pkgs; [ + gitAndTools.gitRemoteGcrypt + git-crypt + git-revise + ]; + programs.git = { + package = pkgs.gitAndTools.gitFull; enable = true; userName = "Kat Inskip"; userEmail = "kat@inskip.me"; diff --git a/users/kat/base/inputrc.nix b/home/shell/inputrc.nix similarity index 100% rename from users/kat/base/inputrc.nix rename to home/shell/inputrc.nix diff --git a/home/shell/packages.nix b/home/shell/packages.nix new file mode 100644 index 00000000..fe2576fe --- /dev/null +++ b/home/shell/packages.nix @@ -0,0 +1,31 @@ +{ config, pkgs, ... }: { + home.packages = with pkgs; [ + # disk usage + duc-cli + # nix formatting + nixpkgs-fmt + # show type of files + file + # command monitoring + progress + pv + # cat but better + bat + # ls replacement + exa + # sed replacement + sd + # find replacement + fd + # ripgrep / grep replacement + ripgrep + # remote tmux + tmate + # remote utilities + socat + rsync + wget + dnsutils + whois + ]; +} diff --git a/users/kat/dev/rink.nix b/home/shell/rink.nix similarity index 100% rename from users/kat/dev/rink.nix rename to home/shell/rink.nix diff --git a/users/kat/base/ssh.nix b/home/shell/ssh.nix similarity index 100% rename from users/kat/base/ssh.nix rename to home/shell/ssh.nix diff --git a/home/shell/starship.nix b/home/shell/starship.nix new file mode 100644 index 00000000..c0dde97e --- /dev/null +++ b/home/shell/starship.nix @@ -0,0 +1,6 @@ +{ config, ... }: { + programs.starship = { + enable = true; + enableZshIntegration = true; + }; +} diff --git a/users/kat/base/tmux.nix b/home/shell/tmux.nix similarity index 93% rename from users/kat/base/tmux.nix rename to home/shell/tmux.nix index cb49551a..ff94dd0c 100644 --- a/users/kat/base/tmux.nix +++ b/home/shell/tmux.nix @@ -1,7 +1,5 @@ { config, lib, pkgs, ... }: -with lib; - { programs.zsh.shellAliases = { tt = "tmux new -AD -s"; @@ -11,7 +9,7 @@ with lib; terminal = "tmux-256color"; keyMode = "vi"; baseIndex = 1; - extraConfig = with mapAttrs (_: v: "colour${toString v}") pkgs.base16.shell.shell256; '' + extraConfig = with lib.mapAttrs (_: v: "colour${toString v}") pkgs.base16.shell.shell256; '' # proper title handling set -g set-titles on set -g set-titles-string "#T" diff --git a/home/shell/z.nix b/home/shell/z.nix new file mode 100644 index 00000000..110501bf --- /dev/null +++ b/home/shell/z.nix @@ -0,0 +1,16 @@ +{ config, pkgs, ... }: { + # ensure .local/share/z is created + xdg.dataFile."z/.keep".text = ""; + + programs.zsh = { + localVariables = { + _Z_DATA = "${config.xdg.dataHome}/z/data"; + }; + plugins = (map (plugin: (with pkgs.${plugin}; { + name = pname; + inherit src; + })) [ + "zsh-z" + ]); + }; +} diff --git a/users/kat/base/shell.nix b/home/shell/zsh.nix similarity index 55% rename from users/kat/base/shell.nix rename to home/shell/zsh.nix index 54461f71..a3a21007 100644 --- a/users/kat/base/shell.nix +++ b/home/shell/zsh.nix @@ -1,33 +1,12 @@ { config, lib, pkgs, ... }: -with lib; - -let - shellFunAlias = command: replacement: '' - if [[ ! -t 0 ]]; then - command ${command} $@ - else - echo 'use ${replacement}!' - fi - ''; - shellFunAliases = mapAttrs shellFunAlias; -in { - home.shell.functions = { - genmac = '' - nix run nixpkgs.openssl -c openssl rand -hex 6 | sed 's/\(..\)\(..\)\(..\)\(..\)\(..\)\(..\)/\1:\2:\3:\4:\5:\6/' - ''; - getAlias = '' - printf '%s\n' $aliases[$1] - ''; - } // shellFunAliases { - sed = "sd"; - find = "fd"; - grep = "rg"; - yes = "me instead"; - }; - xdg.dataFile = { "z/.keep".text = ""; }; - home.packages = with pkgs; [ fzf fd zsh-completions ]; + + home.packages = with pkgs; [ + # programs.zsh.enableAutosuggestions only includes nix-zsh-autocompletions + zsh-completions + ]; + programs.zsh = { enable = true; enableSyntaxHighlighting = true; @@ -57,12 +36,12 @@ in "listrowsfirst" ]; in '' - ${if pkgs.stdenv.system != "aarch64-darwin" then '' + ${if lib.hasSuffix "darwin" pkgs.stdenv.system then '' eval $(dircolors) '' else '' ''} PROMPT_EOL_MARK=''' - ZSH_TAB_TITLE_ADDITIONAL_TERMS='foot' + ZSH_TAB_TITLE_ADDITIONAL_TERMS='kitty' ZSH_TAB_TITLE_ENABLE_FULL_COMMAND=true zmodload -i zsh/complist h=() @@ -87,24 +66,22 @@ in ${lib.concatStringsSep "\n" (map (opt: "setopt ${opt}") zshOpts)} bindkey '^ ' autosuggest-accept ''; - shellAliases = { - nixdirfmt = "nixpkgs-fmt $(fd -e nix)"; - exa = "exa --time-style long-iso"; - ls = "exa -G"; - la = "exa -Ga"; - ll = "exa -l"; - lla = "exa -lga"; - sys = "systemctl"; - sysu = "systemctl --user"; - walls = "journalctl _SYSTEMD_INVOCATION_ID=$(systemctl show -p InvocationID --value konawall.service --user) -o json | jq -r '.MESSAGE'"; - logu = "journalctl --user"; - log = "journalctl"; - dmesg = "dmesg -HP"; - lg = "log --no-pager | rg"; - hg = "history 0 | rg"; - }; + shellAliases = lib.mkMerge [ + { + nixdirfmt = "nixpkgs-fmt $(fd -e nix)"; + dmesg = "dmesg -HP"; + hg = "history 0 | rg"; + } + (lib.mkIf (lib.hasSuffix "linux" pkgs.stdenv.system) { + sys = "systemctl"; + sysu = "systemctl --user"; + walls = "journalctl _SYSTEMD_INVOCATION_ID=$(systemctl show -p InvocationID --value konawall.service --user) -o json | jq -r '.MESSAGE'"; + logu = "journalctl --user"; + log = "journalctl"; + lg = "log --no-pager | rg"; + }) + ]; localVariables = { - _Z_DATA = "${config.xdg.dataHome}/z/data"; ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE = "fg=3,bold"; ZSH_AUTOSUGGEST_USE_ASYNC = 1; }; @@ -112,30 +89,10 @@ in tab-title vim-mode evil-registers - ]) ++ (map - (plugin: (with pkgs.${plugin}; { - name = pname; - inherit src; - })) [ - "zsh-z" - ]) ++ lib.optional (pkgs.hostPlatform == pkgs.buildPlatform) ({ - name = "fzf-tab"; - src = "${pkgs.zsh-fzf-tab}/share/fzf-tab"; - }); + ]); }; + home.sessionVariables = { XDG_DATA_HOME = "${config.xdg.dataHome}"; }; - programs.fzf = { - enable = true; - enableZshIntegration = true; - }; - programs.starship = { - enable = true; - enableZshIntegration = true; - }; - programs.direnv = { - enable = true; - enableZshIntegration = true; - }; } diff --git a/users/kat/base/state.nix b/home/state.nix similarity index 100% rename from users/kat/base/state.nix rename to home/state.nix diff --git a/users/kat/sway/sway.nix b/home/sway.nix similarity index 99% rename from users/kat/sway/sway.nix rename to home/sway.nix index b32ff3cc..fa248eac 100644 --- a/users/kat/sway/sway.nix +++ b/home/sway.nix @@ -8,7 +8,7 @@ let lockCommand = config.programs.swaylock.script; in WLR_DRM_DEVICES = "/dev/dri/card0"; }; - home.packages = with pkgs; [ grim slurp swaylock-fancy wl-clipboard jq quintom-cursor-theme gsettings-desktop-schemas glib wofi wmctrl ]; + home.packages = with pkgs; [ grim slurp swaylock-fancy wl-clipboard jq quintom-cursor-theme gsettings-desktop-schemas glib wofi wmctrl sway-scrot ]; services.i3gopher = { enable = true; }; diff --git a/users/kat/media/syncplay.nix b/home/syncplay.nix similarity index 100% rename from users/kat/media/syncplay.nix rename to home/syncplay.nix diff --git a/users/kat/base/vim/default.nix b/home/vim/default.nix similarity index 58% rename from users/kat/base/vim/default.nix rename to home/vim/default.nix index e3a59ce0..07ae1f9d 100644 --- a/users/kat/base/vim/default.nix +++ b/home/vim/default.nix @@ -1,19 +1,19 @@ -{ config, lib, pkgs, nixos, ... }: with lib; +{ config, lib, pkgs, nixos, ... }: { - home.sessionVariables = mkIf config.programs.neovim.enable { EDITOR = "nvim"; }; + home.sessionVariables = lib.mkIf config.programs.neovim.enable { EDITOR = "nvim"; }; programs.neovim = { enable = true; vimAlias = true; viAlias = true; plugins = with pkgs.vimPlugins; [ + # Libraries + plenary-nvim # Disables and re-enables highlighting when searching vim-cool # Colour highlighting vim-hexokinase - # fzf - fzf-vim # Git porcelain vim-fugitive # Start screen @@ -24,10 +24,22 @@ lualine-nvim # EasyMotion Equivalent hop-nvim + # org-mode for vim + neorg + # Completion + nvim-cmp + # Fuzzy Finder + telescope-nvim + # Language Server + nvim-lspconfig # Languages vim-nix vim-terraform ]; + extraPackages = with pkgs; [ + # For nvim-lspconfig, Terraform Language Server + terraform-ls + ]; extraConfig = '' luafile ${./init.lua} ''; diff --git a/users/kat/base/vim/init.lua b/home/vim/init.lua similarity index 71% rename from users/kat/base/vim/init.lua rename to home/vim/init.lua index 285309ed..0431d778 100644 --- a/users/kat/base/vim/init.lua +++ b/home/vim/init.lua @@ -112,3 +112,60 @@ local disabled_built_ins = { for _, plugin in pairs(disabled_built_ins) do g["loaded_" .. plugin] = 1 end + +----------------------------------------------------------- +-- Plugins +----------------------------------------------------------- + +-- nvim-cmp +local cmp = require'cmp' + +cmp.setup({ + snippet = { + expand = function(args) + vim.fn["vsnip#anonymous"](args.body) + end, + }, + mapping = { + [''] = cmp.mapping.confirm({ select = true }), + }, + sources = { + { name = 'neorg' }, + } +}) + +-- lspconfig +require'lspconfig'.terraformls.setup{} +api.nvim_create_autocmd('BufWritePre', { + pattern = '*.tf', + command = 'lua vim.lsp.buf.formatting_sync()' +}) + +-- neorg +require('neorg').setup { + -- Tell Neorg what modules to load + load = { + ['core.defaults'] = {}, -- Load all the default modules + ['core.norg.concealer'] = {}, -- Allows for use of icons + ['core.norg.dirman'] = { -- Manage your directories with Neorg + config = { + engine = 'nvim-cmp', + workspaces = { + home = '~/neorg' + } + } + } +}, +} + +-- telescope +api.nvim_set_keymap('n', 'ff', 'Telescope find_files', { noremap = true, silent = true }) +api.nvim_set_keymap('n', 'fg', 'Telescope live_grep', { noremap = true, silent = true }) +api.nvim_set_keymap('n', 'fb', 'Telescope buffers', { noremap = true, silent = true }) +api.nvim_set_keymap('n', 'fh', 'Telescope help_tags', { noremap = true, silent = true }) + +-- hop +vim.api.nvim_set_keymap('', 'f', "lua require'hop'.hint_char1({ direction = require'hop.hint'.HintDirection.AFTER_CURSOR, current_line_only = true })", {}) +vim.api.nvim_set_keymap('', 'F', "lua require'hop'.hint_char1({ direction = require'hop.hint'.HintDirection.BEFORE_CURSOR, current_line_only = true })", {}) +vim.api.nvim_set_keymap('', 't', "lua require'hop'.hint_char1({ direction = require'hop.hint'.HintDirection.AFTER_CURSOR, current_line_only = true, hint_offset = -1 })", {}) +vim.api.nvim_set_keymap('', 'T', "lua require'hop'.hint_char1({ direction = require'hop.hint'.HintDirection.BEFORE_CURSOR, current_line_only = true, hint_offset = 1 })", {}) diff --git a/users/kat/sway/waybar/default.nix b/home/waybar/default.nix similarity index 81% rename from users/kat/sway/waybar/default.nix rename to home/waybar/default.nix index 858a70c2..f4e4ffe5 100644 --- a/users/kat/sway/waybar/default.nix +++ b/home/waybar/default.nix @@ -1,9 +1,9 @@ -{ config, lib, pkgs, kw, ... }: with lib; +{ config, lib, pkgs, kw, ... }: { xdg.configFile."waybar/style.css" = { inherit (kw.sassTemplate { name = "waybar-style"; src = ./waybar.sass; }) source; }; - systemd.user.services.waybar.Service.Environment = singleton "NOTMUCH_CONFIG=${config.home.sessionVariables.NOTMUCH_CONFIG}"; + systemd.user.services.waybar.Service.Environment = lib.singleton "NOTMUCH_CONFIG=${config.home.sessionVariables.NOTMUCH_CONFIG}"; programs.waybar = { enable = true; @@ -16,12 +16,6 @@ "sway/window" ]; modules-center = [ - "custom/arc-h" - "clock#arc" - "custom/hex-h" - "clock#hex" - "custom/miku-h" - "clock#miku" "clock#original" ]; modules-right = [ @@ -168,33 +162,6 @@ ]; interval = 1; }; - "custom/arc-h" = { - format = ""; - }; - "custom/hex-h" = { - format = ""; - }; - "custom/miku-h" = { - format = ""; - }; - "clock#arc" = { - format = "-{:%H}"; - tooltip = true; - timezone = "America/Vancouver"; - tooltip-format = "{:%A, %F %R %z (%Z)}"; - }; - "clock#miku" = { - format = "+{:%H}"; - tooltip = true; - timezone = "Pacific/Auckland"; - tooltip-format = "{:%A, %F %R %z (%Z)}"; - }; - "clock#hex" = { - format = "+{:%H}"; - tooltip = true; - timezone = "Europe/Berlin"; - tooltip-format = "{:%A, %F %R %z (%Z)}"; - }; }; }]; }; diff --git a/users/kat/sway/waybar/waybar.sass b/home/waybar/waybar.sass similarity index 100% rename from users/kat/sway/waybar/waybar.sass rename to home/waybar/waybar.sass diff --git a/users/kat/base/weechat.nix b/home/weechat/base.nix similarity index 98% rename from users/kat/base/weechat.nix rename to home/weechat/base.nix index d0e7c763..ba834120 100644 --- a/users/kat/base/weechat.nix +++ b/home/weechat/base.nix @@ -1,7 +1,5 @@ { config, pkgs, lib, ... }: -with lib; - { programs.weechat = { init = lib.mkMerge [ @@ -47,7 +45,7 @@ with lib; highmon zncplayback ]; - config = with mapAttrs (_: toString) pkgs.base16.shell.shell256; { + config = with lib.mapAttrs (_: toString) pkgs.base16.shell.shell256; { logger.level.irc = 0; logger.level.python.matrix = 0; logger.level.core.weechat = 0; diff --git a/users/kat/sway/wofi/default.nix b/home/wofi/default.nix similarity index 100% rename from users/kat/sway/wofi/default.nix rename to home/wofi/default.nix diff --git a/users/kat/sway/wofi/wofi.sass b/home/wofi/wofi.sass similarity index 100% rename from users/kat/sway/wofi/wofi.sass rename to home/wofi/wofi.sass diff --git a/users/kat/linux/xdg.nix b/home/xdg.nix similarity index 83% rename from users/kat/linux/xdg.nix rename to home/xdg.nix index 980dd899..70f1c23e 100644 --- a/users/kat/linux/xdg.nix +++ b/home/xdg.nix @@ -1,4 +1,4 @@ -{ config, lib, ... }: +{ config, lib, pkgs, ... }: { xdg = { @@ -12,7 +12,7 @@ desktop = "$HOME/tmp"; templates = "$HOME/tmp"; publicShare = "$HOME/shared"; - music = "$HOME/media-share/music"; + music = "$HOME/media/music"; }; }; } diff --git a/users/kat/gui/xkb.nix b/home/xkb.nix similarity index 78% rename from users/kat/gui/xkb.nix rename to home/xkb.nix index 41357c75..8dbeae2a 100644 --- a/users/kat/gui/xkb.nix +++ b/home/xkb.nix @@ -1,4 +1,4 @@ -{ config, ... }: +{ config, pkgs, lib, ... }: { home.file = { diff --git a/inputs.nix b/inputs.nix index b7d46bb7..1c8f921f 100644 --- a/inputs.nix +++ b/inputs.nix @@ -6,7 +6,7 @@ let sha256 = lock.nodes.flake-compat.locked.narHash; }; trusted = import flakeCompat { - src = ./trusted; + src = ./flake/trusted; }; nixfiles = import flakeCompat { src = ./.; @@ -14,5 +14,5 @@ let in nixfiles.defaultNix.inputs // { trusted = if builtins.getEnv "TRUSTED" != "" then trusted.defaultNix.inputs.trusted - else ./empty; + else ./flake/empty; } diff --git a/modules/meta/imports.nix b/modules/meta/imports.nix index d5ee03fa..b025b590 100644 --- a/modules/meta/imports.nix +++ b/modules/meta/imports.nix @@ -1,4 +1,4 @@ -{ config, lib, profiles, root, ... }: +{ config, lib, meta, root, ... }: with lib; @@ -25,29 +25,26 @@ with lib; config = { network.importing = { nixosImports = mkDefault (map (path: toString path) [ - (root + "/nodes/nixos/HN.nix") - (root + "/nodes/nixos/HN/nixos.nix") - (root + "/trusted/nodes/nixos/HN/nixos.nix") + (root + "/nixos/systems/HN.nix") + (root + "/nixos/systems/HN/nixos.nix") + (root + "/trusted/nixos/systems/HN/nixos.nix") ]); darwinImports = mkDefault (map (path: toString path) [ - (root + "/nodes/darwin/HN.nix") - (root + "/nodes/darwin/HN/darwin.nix") - (root + "/trusted/nodes/darwin/HN/darwin.nix") - ]); - homeImports = mkDefault (map (path: toString path) [ - (root + "/nodes/nixos/HN/home.nix") - (root + "/nodes/darwin/HN/home.nix") - (root + "/trusted/nodes/HN/home.nix") + (root + "/darwin/systems/HN.nix") + (root + "/darwin/systems/HN/darwin.nix") + (root + "/trusted/darwin/systems/HN/darwin.nix") ]); + homeImports = []; users = mkDefault (singleton "kat"); }; lib.kw.nixosImport = hostName: lib.nodeImport { inherit (config.network.importing) nixosImports homeImports users; - inherit profiles hostName; + profiles = meta.nixos; + inherit hostName; }; lib.kw.darwinImport = hostName: lib.nodeImport { nixosImports = config.network.importing.darwinImports; - profiles = profiles // { base = {}; }; + profiles = meta.darwin; inherit (config.network.importing) homeImports users; inherit hostName; }; diff --git a/users/arc/default.nix b/nixos/arc.nix similarity index 100% rename from users/arc/default.nix rename to nixos/arc.nix diff --git a/profiles/base/access.nix b/nixos/base/access.nix similarity index 98% rename from profiles/base/access.nix rename to nixos/base/access.nix index b1a4bcb3..1c6890ba 100644 --- a/profiles/base/access.nix +++ b/nixos/base/access.nix @@ -12,7 +12,7 @@ ''; imports = with meta; [ - users.kat.base + home.base ]; users.motd = '' diff --git a/profiles/base/base16.nix b/nixos/base/base16.nix similarity index 100% rename from profiles/base/base16.nix rename to nixos/base/base16.nix diff --git a/profiles/base/documentation.nix b/nixos/base/documentation.nix similarity index 100% rename from profiles/base/documentation.nix rename to nixos/base/documentation.nix diff --git a/profiles/base/home.nix b/nixos/base/home.nix similarity index 100% rename from profiles/base/home.nix rename to nixos/base/home.nix diff --git a/profiles/base/kitty.nix b/nixos/base/kitty.nix similarity index 100% rename from profiles/base/kitty.nix rename to nixos/base/kitty.nix diff --git a/profiles/base/locale.nix b/nixos/base/locale.nix similarity index 100% rename from profiles/base/locale.nix rename to nixos/base/locale.nix diff --git a/profiles/base/network.nix b/nixos/base/network.nix similarity index 100% rename from profiles/base/network.nix rename to nixos/base/network.nix diff --git a/profiles/base/nix.nix b/nixos/base/nix.nix similarity index 100% rename from profiles/base/nix.nix rename to nixos/base/nix.nix diff --git a/profiles/base/packages.nix b/nixos/base/packages.nix similarity index 100% rename from profiles/base/packages.nix rename to nixos/base/packages.nix diff --git a/profiles/base/secrets.nix b/nixos/base/secrets.nix similarity index 100% rename from profiles/base/secrets.nix rename to nixos/base/secrets.nix diff --git a/profiles/base/shell.nix b/nixos/base/shell.nix similarity index 100% rename from profiles/base/shell.nix rename to nixos/base/shell.nix diff --git a/profiles/base/ssh.nix b/nixos/base/ssh.nix similarity index 100% rename from profiles/base/ssh.nix rename to nixos/base/ssh.nix diff --git a/profiles/base/system.nix b/nixos/base/system.nix similarity index 100% rename from profiles/base/system.nix rename to nixos/base/system.nix diff --git a/profiles/cross/aarch64.nix b/nixos/cross/aarch64.nix similarity index 100% rename from profiles/cross/aarch64.nix rename to nixos/cross/aarch64.nix diff --git a/profiles/cross/arm-common.nix b/nixos/cross/arm-common.nix similarity index 100% rename from profiles/cross/arm-common.nix rename to nixos/cross/arm-common.nix diff --git a/profiles/cross/armv6.nix b/nixos/cross/armv6.nix similarity index 100% rename from profiles/cross/armv6.nix rename to nixos/cross/armv6.nix diff --git a/profiles/cross/armv7.nix b/nixos/cross/armv7.nix similarity index 100% rename from profiles/cross/armv7.nix rename to nixos/cross/armv7.nix diff --git a/profiles/cross/default.nix b/nixos/cross/default.nix similarity index 58% rename from profiles/cross/default.nix rename to nixos/cross/default.nix index b3f80a7b..7fa19006 100644 --- a/profiles/cross/default.nix +++ b/nixos/cross/default.nix @@ -2,29 +2,17 @@ profiles = tree.prev; appendedProfiles = with profiles; { aarch64 = { - deploy.profile.cross = { - enable = true; - aarch64 = true; - }; imports = [ aarch64 ]; }; armv7l = { - deploy.profile.cross = { - enable = true; - armv7l = true; - }; imports = [ arm-common armv7 ]; }; armv6l = { - deploy.profile.cross = { - enable = true; - armv6l = true; - }; imports = [ arm-common armv6 diff --git a/profiles/gui/adb.nix b/nixos/gui/adb.nix similarity index 100% rename from profiles/gui/adb.nix rename to nixos/gui/adb.nix diff --git a/profiles/gui/filesystems.nix b/nixos/gui/filesystems.nix similarity index 100% rename from profiles/gui/filesystems.nix rename to nixos/gui/filesystems.nix diff --git a/profiles/gui/fonts.nix b/nixos/gui/fonts.nix similarity index 100% rename from profiles/gui/fonts.nix rename to nixos/gui/fonts.nix diff --git a/profiles/gui/gpg.nix b/nixos/gui/gpg.nix similarity index 100% rename from profiles/gui/gpg.nix rename to nixos/gui/gpg.nix diff --git a/profiles/gui/mingetty.nix b/nixos/gui/mingetty.nix similarity index 100% rename from profiles/gui/mingetty.nix rename to nixos/gui/mingetty.nix diff --git a/profiles/gui/nfs.nix b/nixos/gui/nfs.nix similarity index 100% rename from profiles/gui/nfs.nix rename to nixos/gui/nfs.nix diff --git a/profiles/gui/profile.nix b/nixos/gui/profile.nix similarity index 100% rename from profiles/gui/profile.nix rename to nixos/gui/profile.nix diff --git a/profiles/gui/qt.nix b/nixos/gui/qt.nix similarity index 100% rename from profiles/gui/qt.nix rename to nixos/gui/qt.nix diff --git a/profiles/gui/sound.nix b/nixos/gui/sound.nix similarity index 100% rename from profiles/gui/sound.nix rename to nixos/gui/sound.nix diff --git a/profiles/gui/sway.nix b/nixos/gui/sway.nix similarity index 100% rename from profiles/gui/sway.nix rename to nixos/gui/sway.nix diff --git a/profiles/gui/udev.nix b/nixos/gui/udev.nix similarity index 100% rename from profiles/gui/udev.nix rename to nixos/gui/udev.nix diff --git a/profiles/gui/xdg-portals.nix b/nixos/gui/xdg-portals.nix similarity index 100% rename from profiles/gui/xdg-portals.nix rename to nixos/gui/xdg-portals.nix diff --git a/users/kat/nixos.nix b/nixos/kat.nix similarity index 92% rename from users/kat/nixos.nix rename to nixos/kat.nix index 3005054c..87e43a56 100644 --- a/users/kat/nixos.nix +++ b/nixos/kat.nix @@ -1,4 +1,4 @@ -{ config, pkgs, lib, ... }: with lib; +{ meta, config, pkgs, lib, ... }: with lib; { users.users.kat = { @@ -11,7 +11,7 @@ ]; shell = pkgs.zsh; extraGroups = [ "wheel" "video" "systemd-journal" "plugdev" "bird2" "vfio" "input" "uinput" ]; - hashedPassword = mkIf (config.deploy.profile.trusted) (removeSuffix "\n" config.kw.secrets.repo.kat-user.text); + hashedPassword = mkIf (meta.trusted ? secrets) (removeSuffix "\n" config.kw.secrets.repo.kat-user.text); }; systemd.tmpfiles.rules = [ diff --git a/profiles/light.nix b/nixos/light.nix similarity index 89% rename from profiles/light.nix rename to nixos/light.nix index 75275ea4..a684425e 100644 --- a/profiles/light.nix +++ b/nixos/light.nix @@ -12,8 +12,4 @@ modules = singleton lightModeExtend; }); }; - - config = { - deploy.profile.light = true; - }; } diff --git a/profiles/network.nix b/nixos/network.nix similarity index 100% rename from profiles/network.nix rename to nixos/network.nix diff --git a/nodes/nixos/chen.nix b/nixos/systems/chen.nix similarity index 95% rename from nodes/nixos/chen.nix rename to nixos/systems/chen.nix index 981ee458..932401d5 100644 --- a/nodes/nixos/chen.nix +++ b/nixos/systems/chen.nix @@ -6,11 +6,11 @@ with lib; # Imports imports = with meta; [ - profiles.hardware.eeepc-1015pem - profiles.network + hardware.eeepc-1015pem + nixos.network + nixos.arc services.kattv2 services.dnscrypt-proxy - users.arc ]; # Terraform diff --git a/nodes/nixos/daiyousei.nix b/nixos/systems/daiyousei.nix similarity index 87% rename from nodes/nixos/daiyousei.nix rename to nixos/systems/daiyousei.nix index a1f2d103..e24f6d30 100644 --- a/nodes/nixos/daiyousei.nix +++ b/nixos/systems/daiyousei.nix @@ -1,9 +1,10 @@ { config, inputs, tf, meta, kw, pkgs, lib, ... }: with lib; { imports = with meta; [ - profiles.hardware.aarch64-linux - profiles.hardware.oracle.ubuntu - profiles.network - users.kat.services.weechat + hardware.aarch64-linux + hardware.oracle.ubuntu + nixos.network + home.weechat + home.services.weechat services.nginx services.murmur services.murmur-ldap diff --git a/nodes/nixos/koishi.nix b/nixos/systems/koishi.nix similarity index 95% rename from nodes/nixos/koishi.nix rename to nixos/systems/koishi.nix index 6acf4ab9..f8b956e5 100644 --- a/nodes/nixos/koishi.nix +++ b/nixos/systems/koishi.nix @@ -1,12 +1,10 @@ { meta, config, pkgs, lib, ... }: with lib; { imports = with meta; [ - profiles.hardware.x270 - profiles.gui - profiles.gnome - profiles.light - profiles.network - (users.kat.guiFlavour "gnome") - services.nginx + hardware.x270 + nixos.gui + nixos.light + nixos.network + home.gui ]; config = { @@ -99,8 +97,6 @@ Host daiyousei-build }; }; - deploy.profile.sway = true; - networking = { hostId = "dddbb888"; useDHCP = false; diff --git a/nodes/nixos/marisa.nix b/nixos/systems/marisa.nix similarity index 98% rename from nodes/nixos/marisa.nix rename to nixos/systems/marisa.nix index 1c9532f6..552f0b5e 100644 --- a/nodes/nixos/marisa.nix +++ b/nixos/systems/marisa.nix @@ -1,10 +1,9 @@ { config, lib, pkgs, modulesPath, tf, meta, ... }: with lib; { imports = with meta; [ (modulesPath + "/profiles/qemu-guest.nix") - profiles.network + nixos.network services.nginx services.access - users.kat.server ] ++ optional (meta.trusted ? services) trusted.services.website; diff --git a/nodes/nixos/ran.nix b/nixos/systems/ran.nix similarity index 94% rename from nodes/nixos/ran.nix rename to nixos/systems/ran.nix index 6d3d9beb..714e21b3 100644 --- a/nodes/nixos/ran.nix +++ b/nixos/systems/ran.nix @@ -6,11 +6,11 @@ with lib; # Imports imports = with meta; [ - profiles.hardware.eeepc-1015pem - profiles.network + hardware.eeepc-1015pem + nixos.network + nixos.arc services.kattv services.dnscrypt-proxy - users.arc ]; # Terraform diff --git a/nodes/nixos/rinnosuke.nix b/nixos/systems/rinnosuke.nix similarity index 90% rename from nodes/nixos/rinnosuke.nix rename to nixos/systems/rinnosuke.nix index f5f947fd..ab5f8d6e 100644 --- a/nodes/nixos/rinnosuke.nix +++ b/nixos/systems/rinnosuke.nix @@ -1,7 +1,7 @@ { config, tf, meta, kw, pkgs, lib, ... }: with lib; { imports = with meta; [ - profiles.hardware.oracle.ubuntu - profiles.network + hardware.oracle.ubuntu + nixos.network services.nginx services.knot ]; diff --git a/nodes/nixos/yukari.nix b/nixos/systems/yukari.nix similarity index 97% rename from nodes/nixos/yukari.nix rename to nixos/systems/yukari.nix index 115203b1..9d0950b3 100644 --- a/nodes/nixos/yukari.nix +++ b/nixos/systems/yukari.nix @@ -1,7 +1,8 @@ { meta, tf, config, pkgs, lib, ... }: with lib; { imports = with meta; [ - profiles.hardware.rm-310 - profiles.network + hardware.rm-310 + nixos.network + nixos.arc services.ha services.nextcloud #services.kattv-ingest @@ -13,7 +14,6 @@ services.tvheadend services.zfs services.plex - users.arc ]; deploy.tf = { diff --git a/profiles/vfio/profile.nix b/nixos/vfio/profile.nix similarity index 92% rename from profiles/vfio/profile.nix rename to nixos/vfio/profile.nix index f05b9f22..cdfe410e 100644 --- a/profiles/vfio/profile.nix +++ b/nixos/vfio/profile.nix @@ -96,8 +96,6 @@ in { }; config = { - deploy.profile.vfio = true; - environment.systemPackages = with pkgs; [ win10-toggler vfio-vm @@ -147,29 +145,16 @@ in { users.groups = { uinput = { }; vfio = { }; }; - boot = lib.mkMerge [{ + boot = { initrd.kernelModules = mkBefore [ "vfio" "vfio_iommu_type1" "vfio_pci" "vfio_virqfd" ]; kernelParams = [ - ]; - kernelModules = [ "i2c-dev" ]; # i2c-dev is required for DDC/CI for screenstub - kernelPatches = with pkgs.kernelPatches; [ - (mkIf config.deploy.profile.hardware.acs-override acs-override) - ]; - } - (mkIf (config.deploy.profile.hardware.amdgpu) { - kernelParams = [ "video=efifb:off" - ]; + ]; extraModulePackages = [ (pkgs.linuxPackagesFor config.boot.kernelPackages.kernel).vendor-reset ]; - }) - (mkIf (config.deploy.profile.hardware.acs-override) { - kernelParams = [ - "pci=noats" - "pcie_acs_override=downstream,multifunction" - ]; - })]; + kernelModules = [ "i2c-dev" ]; # i2c-dev is required for DDC/CI for screenstub + }; environment.etc."qemu/bridge.conf".text = "allow br"; diff --git a/profiles/vfio/tsc-tolerance.patch b/nixos/vfio/tsc-tolerance.patch similarity index 100% rename from profiles/vfio/tsc-tolerance.patch rename to nixos/vfio/tsc-tolerance.patch diff --git a/users/kat/gui/layout.xkb b/nixos/x11/layout.xkb similarity index 100% rename from users/kat/gui/layout.xkb rename to nixos/x11/layout.xkb diff --git a/profiles/x11/profile.nix b/nixos/x11/profile.nix similarity index 100% rename from profiles/x11/profile.nix rename to nixos/x11/profile.nix diff --git a/outputs.nix b/outputs.nix index b807b2be..c93d3bef 100644 --- a/outputs.nix +++ b/outputs.nix @@ -63,14 +63,20 @@ }; "modules/darwin".functor.enable = true; "modules/meta".functor.enable = true; - "profiles/*".functor.enable = true; - "profiles/hardware".evaluateDefault = true; - "profiles/cross".evaluateDefault = true; - "profiles/hardware/*".evaluateDefault = true; + "nixos/systems".functor.enable = false; + "darwin/systems".functor.enable = false; + "nixos/*".functor = { + enable = true; + }; + "darwin/*".functor = { + enable = true; + }; + "hardware".evaluateDefault = true; + "nixos/cross".evaluateDefault = true; + "hardware/*".evaluateDefault = true; "services/*".aliasDefault = true; - "users/*".evaluateDefault = true; - "users/kat/*".functor.enable = true; - "users/kat/services/mpd".functor.enable = true; + "home".evaluateDefault = true; + "home/*".functor.enable = true; }; }; trustedTree = mkTree { @@ -106,7 +112,7 @@ }; }; }) - (lib.attrNames nixfiles.nodes.nixos)); + (lib.attrNames nixfiles.nixos.systems)); darwinNodes = (map (node: { network.nodes.darwin.${node} = { @@ -116,7 +122,7 @@ }; }; }) - (lib.attrNames nixfiles.nodes.darwin)); + (lib.attrNames nixfiles.darwin.systems)); in lib.evalModules { modules = lib.singleton metaBase ++ lib.singleton nixfiles.modules.meta diff --git a/overlays/pi/default.nix b/overlays/pi/default.nix deleted file mode 100644 index a75944ed..00000000 --- a/overlays/pi/default.nix +++ /dev/null @@ -1,3 +0,0 @@ -final: prev: { - cairo = prev.cairo.override { glSupport = false; }; -} diff --git a/profiles/base/profiles.nix b/profiles/base/profiles.nix deleted file mode 100644 index 09c5b4c5..00000000 --- a/profiles/base/profiles.nix +++ /dev/null @@ -1,109 +0,0 @@ -{ config, lib, meta, ... }: - -with lib; - -{ - options = { - deploy.profile = { - gui = mkEnableOption "Graphical System"; - sway = mkEnableOption "Sway WM"; - i3 = mkEnableOption "i3 WM"; - vfio = mkEnableOption "VFIO"; - shared = mkEnableOption "Shared System"; - trusted = mkEnableOption "Trusted Submodule"; - light = mkEnableOption "Light mode"; - cross = { - enable = mkEnableOption "cross/emulated compilation"; - aarch64 = mkOption { - type = types.bool; - default = false; - }; - armv6l = mkOption { - type = types.bool; - default = false; - }; - armv7l = mkOption { - type = types.bool; - default = false; - }; - }; - hardware = { - acs-override = mkEnableOption "ACS IOMMU Override"; - amdgpu = mkEnableOption "AMD GPU"; - hcloud-imperative = mkEnableOption "Imperative Hetzner Cloud Setup"; - intel = mkEnableOption "Intel CPU"; - laptop = mkEnableOption "Laptop"; - wifi = mkEnableOption "WiFi, home network"; - ryzen = mkEnableOption "AMD Ryzen CPU"; - ms-7b86 = mkEnableOption "MSI B450-A Pro Max"; - rm-310 = mkEnableOption "Intel DQ67OW"; - raspi = mkEnableOption "Raspberry Pi 1 Model B+"; - oracle = { - common = mkEnableOption "OCI"; - ubuntu = mkEnableOption "Canonical Ubuntu Base Image"; - oracle = mkEnableOption "Oracle Linux Base Image"; - }; - eeepc-1015pem = mkEnableOption "Asus Eee PC 1015PEM"; - v330-14arr = mkEnableOption "Lenovo Ideapad v330-14ARR"; - x270 = mkEnableOption "Lenovo Thinkpad x270"; - }; - }; - home-manager.users = mkOption { - type = types.attrsOf (types.submoduleWith { - modules = [ - ({ nixos, ... }: { - options.deploy.profile = { - gui = mkEnableOption "Graphical System"; - sway = mkEnableOption "Sway WM"; - i3 = mkEnableOption "i3 WM"; - vfio = mkEnableOption "VFIO"; - shared = mkEnableOption "Shared System"; - trusted = mkEnableOption "Trusted Submodule" // { - default = meta.trusted ? secrets; - }; - light = mkEnableOption "Light mode"; - cross = { - enable = mkEnableOption "cross/emulated compilation"; - aarch64 = mkOption { - type = types.bool; - default = false; - }; - armv6l = mkOption { - type = types.bool; - default = false; - }; - armv7l = mkOption { - type = types.bool; - default = false; - }; - }; - hardware = { - acs-override = mkEnableOption "ACS IOMMU Override"; - amdgpu = mkEnableOption "AMD GPU"; - hcloud-imperative = mkEnableOption "Imperative Hetzner Cloud Setup"; - intel = mkEnableOption "Intel CPU"; - laptop = mkEnableOption "Laptop"; - wifi = mkEnableOption "WiFi, home network"; - ryzen = mkEnableOption "AMD Ryzen CPU"; - ms-7b86 = mkEnableOption "MSI B450-A Pro Max"; - rm-310 = mkEnableOption "Intel DQ67OW"; - raspi = mkEnableOption "Raspberry Pi 1 Model B+"; - oracle = { - common = mkEnableOption "OCI"; - ubuntu = mkEnableOption "Canonical Ubuntu Base Image"; - oracle = mkEnableOption "Oracle Linux Base Image"; - }; - eeepc-1015pem = mkEnableOption "Asus Eee PC 1015PEM"; - v330-14arr = mkEnableOption "Lenovo Ideapad v330-14ARR"; - x270 = mkEnableOption "Lenovo Thinkpad x270"; - }; - }; - config = { - deploy.profile = nixos.deploy.profile; - }; - }) - ]; - }); - }; - }; -} diff --git a/profiles/gnome/gnome.nix b/profiles/gnome/gnome.nix deleted file mode 100644 index 91df896b..00000000 --- a/profiles/gnome/gnome.nix +++ /dev/null @@ -1,39 +0,0 @@ -{ config, pkgs, lib, ... }: { - services = { - xserver = { - enable = true; - desktopManager.gnome = { - enable = true; - }; - displayManager.gdm = { - enable = true; - }; - }; - mullvad-vpn.enable = true; - }; - - hardware.pulseaudio.enable = lib.mkForce false; - xdg.portal.enable = lib.mkForce false; - - environment.systemPackages = (with pkgs.gnomeExtensions; [ - gsconnect - vitals - switcher - espresso - impatience - noannoyance - arcmenu - tweaks-in-system-menu - activities-icons - random-wallpaper - mullvad-indicator - tray-icons-reloaded - noannoyance-2 - dash-to-panel - ]) ++ (with pkgs; [ - mullvad-vpn - ytmdesktop - pkgs.gnome.gnome-shell-extensions - pkgs.gnome.gnome-tweaks - ]); -} diff --git a/profiles/hardware/hcloud-imperative.nix b/profiles/hardware/hcloud-imperative.nix deleted file mode 100644 index 06e06ed9..00000000 --- a/profiles/hardware/hcloud-imperative.nix +++ /dev/null @@ -1,14 +0,0 @@ -{ config, lib, inputs, ... }: - -/* - This hardware profile corresponds with the imperatively provisioned hetzner cloud box. -*/ - -with lib; - -{ - deploy.profile.hardware.hcloud-imperative = true; - - imports = [ (inputs.nixpkgs + "/nixos/modules/profiles/qemu-guest.nix") ]; - boot.initrd.availableKernelModules = [ "ata_piix" "uhci_hcd" "virtio_pci" "sd_mod" "sr_mod" ]; -} diff --git a/profiles/hardware/laptop/default.nix b/profiles/hardware/laptop/default.nix deleted file mode 100644 index 87623b95..00000000 --- a/profiles/hardware/laptop/default.nix +++ /dev/null @@ -1,11 +0,0 @@ -{ ... }: { - imports = [ - ({ config, ... }: { - deploy.profile.hardware.laptop = true; - - imports = [ - ./light.nix - ]; - }) - ]; -} diff --git a/profiles/hardware/raspi.nix b/profiles/hardware/raspi.nix deleted file mode 100644 index 7ba46180..00000000 --- a/profiles/hardware/raspi.nix +++ /dev/null @@ -1,68 +0,0 @@ -{ config, lib, pkgs, ... }: with lib; { - deploy.profile.hardware.raspi = true; - - nixpkgs.crossOverlays = [ - (import ../../../overlays/pi) - ]; - - boot = { - loader = { - grub.enable = false; - generic-extlinux-compatible.enable = true; - }; - consoleLogLevel = lib.mkDefault 7; - kernelModules = mkForce [ "loop" "atkbd" ]; - initrd = { - includeDefaultModules = false; - availableKernelModules = mkForce [ - "mmc_block" - "usbhid" - "ext4" - "hid_generic" - "hid_lenovo" - "hid_apple" - "hid_roccat" - "hid_logitech_hidpp" - "hid_logitech_dj" - "hid_microsoft" - ]; - }; - }; - - services.udev.extraRules = '' - SUBSYSTEM=="bcm2835-gpiomem", KERNEL=="gpiomem", GROUP="gpio", MODE="0660" - SUBSYSTEM=="gpio", KERNEL=="gpiochip*", ACTION=="add", PROGRAM="${pkgs.runtimeShell} -c 'chown root:gpio /sys/class/gpio/export /sys/class/gpio/unexport ; chmod 220 /sys/class/gpio/export /sys/class/gpio/unexport'" - SUBSYSTEM=="gpio", KERNEL=="gpio*", ACTION=="add", PROGRAM="${pkgs.runtimeShell} -c 'chown root:gpio /sys%p/active_low /sys%p/direction /sys%p/edge /sys%p/value ; chmod 660 /sys%p/active_low /sys%p/direction /sys%p/edge /sys%p/value'" - - T - ''; - - users.groups.gpio = { }; - - environment.noXlibs = true; - documentation.info.enable = false; - documentation.man.enable = false; - programs.command-not-found.enable = false; - security.polkit.enable = false; - security.audit.enable = false; - services.udisks2.enable = false; - boot.enableContainers = false; - - home-manager.users.kat.manual = { - json.enable = false; - manpages.enable = false; - }; - - services.logrotate.enable = false; - - nixpkgs.crossSystem = systems.examples.raspberryPi // { - system = "armv6l-linux"; - }; - - fileSystems = { - "/" = { - device = "/dev/disk/by-label/NIXOS_SD"; - fsType = "ext4"; - }; - }; -} diff --git a/profiles/hardware/v330-14arr.nix b/profiles/hardware/v330-14arr.nix deleted file mode 100644 index 1396422f..00000000 --- a/profiles/hardware/v330-14arr.nix +++ /dev/null @@ -1,33 +0,0 @@ -{ config, lib, ... }: with lib; - -/* - This hardware profile corresponds to the Lenovo IdeaPad v330-14ARR. -*/ - -{ - options.home-manager.users = let - userTouchpadExtend = { config, nixos, ... }: { - wayland.windowManager.sway.config.input."1739:33362:Synaptics_TM3336-002" = { - dwt = "enabled"; - tap = "enabled"; - natural_scroll = "enabled"; - middle_emulation = "enabled"; - click_method = "clickfinger"; - }; - }; - in mkOption { - type = types.attrsOf (types.submoduleWith { - modules = singleton userTouchpadExtend; - }); - }; - - config = { - deploy.profile.hardware.v330-14arr = true; - - boot.initrd.availableKernelModules = - [ "xhci_pci" "ahci" "usb_storage" "sd_mod" ]; - boot.initrd.kernelModules = [ ]; - boot.kernelModules = [ ]; - boot.extraModulePackages = [ ]; - }; -} diff --git a/profiles/shared.nix b/profiles/shared.nix deleted file mode 100644 index 24ab6f24..00000000 --- a/profiles/shared.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ config, meta, ... }: { - imports = with meta; [ - users.hexchen - users.arc - ]; -} diff --git a/services/znc.nix b/services/znc.nix index 20f86a37..9f25ba10 100644 --- a/services/znc.nix +++ b/services/znc.nix @@ -1,4 +1,4 @@ -{ config, tf, lib, pkgs, ... }: +{ meta, config, tf, lib, pkgs, ... }: with lib; @@ -189,7 +189,7 @@ in }; }; }) - (mkIf config.deploy.profile.trusted (import config.kw.secrets.repo.znc.source)) + (mkIf (meta.trusted ? secrets) (import config.kw.secrets.repo.znc.source)) ]; configFile = config.secrets.files.znc-config.path; }; diff --git a/users/hexchen/default.nix b/users/hexchen/default.nix deleted file mode 100644 index 2a624572..00000000 --- a/users/hexchen/default.nix +++ /dev/null @@ -1,42 +0,0 @@ -{ ... }: { - imports = [ - ({ config, lib, pkgs, ... }: - - { - users.users.hexchen = { - uid = 1002; - isNormalUser = true; - openssh.authorizedKeys.keys = [ - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDNVUDKx9sukRkb6INny432+2HZBWx/qIEAOvngF1qcj hexchen@montasch" - "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDI3T1eFS77URHZ/HVWkMOqx7W1U54zJtn9C7QWsHOtyH72i/4EVj8SxYqLllElh1kuKUXSUipPeEzVsipFVvfH0wEuTDgFffiSQ3a8lfUgdEBuoySwceEoPgc5deapkOmiDIDeeWlrRe3nqspLRrSWU1DirMxoFPbwqJXRvpl6qJPxRg+2IolDcXlZ6yxB4Vv48vzRfVzZNUz7Pjmy2ebU8PbDoFWL/S3m7yOzQpv3L7KYBz7+rkjuF3AU2vy6CAfIySkVpspZZLtkTGCIJF228ev0e8NvhuN6ZnjzXxVTQOy32HCdPdbBbicu0uHfZ5O7JX9DjGd8kk1r2dnZwwy/ hexchen@yubi5" - "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC4CLJ+mFfq5XiBXROKewmN9WYmj+79bj/AoaR6Iud2pirulot3tkrrLe2cMjiNWFX8CGVqrsAELKUA8EyUTJfStlcTE0/QNESTRmdDaC+lZL41pWUO9KOiD6/0axAhHXrSJ0ScvbqtD0CtpnCKKxtuOflVPoUGZsH9cLKJNRKfEka0H0GgeKb5Tp618R/WNAQOwaCcXzg/nG4Bgv3gJW4Nm9IKy/MwRZqtILi8Mtd+2diTqpMwyNRmbenmRHCQ1vRw46joYkledVqrmSlfSMFgIHI1zRSBXb/JkG2IvIyB5TGbTkC4N2fqJNpH8wnCKuOvs46xmgdiRA26P48C2em3 hexchen@yubi5c" - ]; - }; - - home-manager.users.hexchen = { - programs.vim = { - enable = true; - extraConfig = '' - set viminfo='20,<1000 - set mouse=a - ''; - }; - - programs.git = { - enable = true; - userName = "hexchen"; - userEmail = "hexchen@lilwit.ch"; - signing = { - key = "B1DF5EAD"; - }; - extraConfig = { - pull.rebase = true; - }; - }; - - programs.bat.enable = true; - programs.jq.enable = true; - }; - }) - ]; -} diff --git a/users/kat/base/dconf.nix b/users/kat/base/dconf.nix deleted file mode 100644 index 01edde06..00000000 --- a/users/kat/base/dconf.nix +++ /dev/null @@ -1,3 +0,0 @@ -{ config, lib, ... }: { - dconf.enable = lib.mkDefault false; # TODO: is this just broken? # yes, yes it fucking is -} diff --git a/users/kat/base/packages.nix b/users/kat/base/packages.nix deleted file mode 100644 index 90082b0f..00000000 --- a/users/kat/base/packages.nix +++ /dev/null @@ -1,24 +0,0 @@ -{ config, lib, pkgs, ... }: - -{ - home.packages = with pkgs; [ - tmate - htop - fd - sd - duc-cli - bat - exa - socat - rsync - wget - ripgrep - nixpkgs-fmt - pv - progress - zstd - file - whois - neofetch - ]; -} diff --git a/users/kat/default.nix b/users/kat/default.nix deleted file mode 100644 index 0a5da480..00000000 --- a/users/kat/default.nix +++ /dev/null @@ -1,62 +0,0 @@ -{ lib, tree, ... }: with lib; let - wrapImports = imports: mapAttrs - (_: paths: { config, ... }: { - config.home-manager.users.kat = { - imports = singleton paths; - }; - }) - imports; - dirImports = wrapImports tree.prev; - serviceImports = wrapImports tree.prev.services; -in -dirImports // { - darwin = { - imports = [ - dirImports.base - tree.prev.darwin - ]; - }; - base = { - imports = [ - dirImports.base - dirImports.linux - tree.prev.nixos - ]; - }; - server = { }; - guiX11Full = { - imports = with dirImports; [ - gui - i3 - dev - media - personal - ]; - }; - guiBase = { - imports = with dirImports; [ - gui - dev - media - personal - ]; - }; - guiFlavour = flavour: { - imports = (with dirImports; [ - gui - dev - media - personal - ]) ++ [ dirImports.${flavour} ]; - }; - guiFull = { - imports = with dirImports; [ - gui - sway - dev - media - personal - ]; - }; - services = serviceImports; -} diff --git a/users/kat/dev/cookiecutter.nix b/users/kat/dev/cookiecutter.nix deleted file mode 100644 index 9bcb02f6..00000000 --- a/users/kat/dev/cookiecutter.nix +++ /dev/null @@ -1,9 +0,0 @@ -{ config, pkgs, ... }: - -{ - home.packages = with pkgs; [ cookiecutter ]; - - home.shell.functions.katenv = '' - cookiecutter cookiecutters --directory $1 - ''; -} diff --git a/users/kat/dev/doom.d/config.el b/users/kat/dev/doom.d/config.el deleted file mode 100644 index 0c38c20e..00000000 --- a/users/kat/dev/doom.d/config.el +++ /dev/null @@ -1,58 +0,0 @@ -;;; $DOOMDIR/config.el -*- lexical-binding: t; -*- - -;; Place your private configuration here! Remember, you do not need to run 'doom -;; sync' after modifying this file! - - -;; Some functionality uses this to identify you, e.g. GPG configuration, email -;; clients, file templates and snippets. -(setq user-full-name "kat" - user-mail-address "kat@kittywit.ch") - - -;; Doom exposes five (optional) variables for controlling fonts in Doom. Here -;; are the three important ones: -;; -;; + `doom-font' -;; + `doom-variable-pitch-font' -;; + `doom-big-font' -- used for `doom-big-font-mode'; use this for -;; presentations or streaming. -;; -;; They all accept either a font-spec, font string ("Input Mono-12"), or xlfd -;; font string. You generally only need these two: -(setq doom-font (font-spec :family "Cozette" :size 13)) -;; doom-variable-pitch-font (font-spec :family "sans" :size 13)) - -;; There are two ways to load a theme. Both assume the theme is installed and -;; available. You can either set `doom-theme' or manually load a theme with the -;; `load-theme' function. This is the default: -;;(setq doom-theme '${lib.elemAt (lib.splitString "." base16.alias.default) 1}) - -;; If you use `org' and don't want your org files in the default location below, -;; change `org-directory'. It must be set before org loads! -(setq org-directory "~/.org/") - -;; This determines the style of line numbers in effect. If set to `nil', line -;; numbers are disabled. For relative line numbers, set this to `relative'. -(setq display-line-numbers-type t) - -(use-package! protobuf-mode - :mode "\\.proto\\'") - - -;; Here are some additional functions/macros that could help you configure Doom: -;; -;; - `load!' for loading external *.el files relative to this one -;; - `use-package!' for configuring packages -;; - `after!' for running code after a package has loaded -;; - `add-load-path!' for adding directories to the `load-path', relative to -;; this file. Emacs searches the `load-path' when you load packages with -;; `require' or `use-package'. -;; - `map!' for binding new keys -;; -;; To get information about any of these functions/macros, move the cursor over -;; the highlighted symbol at press 'K' (non-evil users must press 'C-c c k'). -;; This will open documentation for it, including demos of how they are used. -;; -;; You can also try 'gd' (or 'C-c c d') to jump to their definition and see how -;; they are implemented. diff --git a/users/kat/dev/doom.d/init.el b/users/kat/dev/doom.d/init.el deleted file mode 100644 index c2936a80..00000000 --- a/users/kat/dev/doom.d/init.el +++ /dev/null @@ -1,186 +0,0 @@ -;;; init.el -*- lexical-binding: t; -*- - -;; This file controls what Doom modules are enabled and what order they load -;; in. Remember to run 'doom sync' after modifying it! - -;; NOTE Press 'SPC h d h' (or 'C-h d h' for non-vim users) to access Doom's -;; documentation. There you'll find a "Module Index" link where you'll find -;; a comprehensive list of Doom's modules and what flags they support. - -;; NOTE Move your cursor over a module's name (or its flags) and press 'K' (or -;; 'C-c c k' for non-vim users) to view its documentation. This works on -;; flags as well (those symbols that start with a plus). -;; -;; Alternatively, press 'gd' (or 'C-c c d') on a module to browse its -;; directory (for easy access to its source code). - - -(doom! :input - ;;chinese - ;;japanese - - :completion - company ; the ultimate code completion backend - ;;helm ; the *other* search engine for love and life - ;;ido ; the other *other* search engine... - ivy ; a search engine for love and life - - :ui - ;;deft ; notational velocity for Emacs - doom ; what makes DOOM look the way it does - doom-dashboard ; a nifty splash screen for Emacs - doom-quit ; DOOM quit-message prompts when you quit Emacs - ;;fill-column ; a `fill-column' indicator - hl-todo ; highlight TODO/FIXME/NOTE/DEPRECATED/HACK/REVIEW - ;;hydra - indent-guides ; highlighted indent columns - ;;(ligatures +iosevka) - minimap ; show a map of the code on the side - modeline ; snazzy, Atom-inspired modeline, plus API - ;;nav-flash ; blink cursor line after big motions - ;;neotree ; a project drawer, like NERDTree for vim - ophints ; highlight the region an operation acts on - (popup +defaults) ; tame sudden yet inevitable temporary windows - ;;pretty-code ; ligatures or substitute text with pretty symbols - ;;tabs ; a tab bar for Emacs - treemacs ; a project drawer, like neotree but cooler - ;;unicode ; extended unicode support for various languages - vc-gutter ; vcs diff in the fringe - vi-tilde-fringe ; fringe tildes to mark beyond EOB - ;;window-select ; visually switch windows - workspaces ; tab emulation, persistence & separate workspaces - ;;zen ; distraction-free coding or writing - - :editor - (evil +everywhere); come to the dark side, we have cookies - file-templates ; auto-snippets for empty files - fold ; (nigh) universal code folding - ;;(format +onsave) ; automated prettiness - ;;god ; run Emacs commands without modifier keys - ;;lispy ; vim for lisp, for people who don't like vim - ;;multiple-cursors ; editing in many places at once - ;;objed ; text object editing for the innocent - ;;parinfer ; turn lisp into python, sort of - ;;rotate-text ; cycle region at point between text candidates - snippets ; my elves. They type so I don't have to - ;;word-wrap ; soft wrapping with language-aware indent - - :emacs - dired ; making dired pretty [functional] - electric ; smarter, keyword-based electric-indent - ;;ibuffer ; interactive buffer management - (undo +tree) ; persistent, smarter undo for your inevitable mistakes - vc ; version-control and Emacs, sitting in a tree - - :term - ;;eshell ; the elisp shell that works everywhere - ;;shell ; simple shell REPL for Emacs - ;;term ; basic terminal emulator for Emacs - vterm ; the best terminal emulation in Emacs - - :checkers - syntax ; tasing you for every semicolon you forget - ;;spell ; tasing you for misspelling mispelling - ;;grammar ; tasing grammar mistake every you make - - :tools - ;;ansible - ;;debugger ; FIXME stepping through code, to help you add bugs - ;;direnv - docker - ;;editorconfig ; let someone else argue about tabs vs spaces - ;;ein ; tame Jupyter notebooks with emacs - (eval +overlay) ; run code, run (also, repls) - ;;gist ; interacting with github gists - lookup ; navigate your code and its documentation - (lsp +peek) - ;;macos ; MacOS-specific commands - magit ; a git porcelain for Emacs - ;;make ; run make tasks from Emacs - pass ; password manager for nerds - pdf ; pdf enhancements - ;;prodigy ; FIXME managing external services & code builders - ;;rgb ; creating color strings - ;;taskrunner ; taskrunner for all your projects - ;;terraform ; infrastructure as code - ;;tmux ; an API for interacting with tmux - ;;upload ; map local to remote projects via ssh/ftp - - :lang - ;;agda ; types of types of types of types... - ;;cc ; C/C++/Obj-C madness - ;;clojure ; java with a lisp - ;;common-lisp ; if you've seen one lisp, you've seen them all - ;;coq ; proofs-as-programs - crystal ; ruby at the speed of c - ;;csharp ; unity, .NET, and mono shenanigans - data ; config/data formats - ;;(dart +flutter) ; paint ui and not much else - (elixir +lsp) ; erlang done right - ;;elm ; care for a cup of TEA? - emacs-lisp ; drown in parentheses - erlang ; an elegant language for a more civilized age - ;;ess ; emacs speaks statistics - ;;faust ; dsp, but you get to keep your soul - ;;fsharp ; ML stands for Microsoft's Language - ;;fstar ; (dependent) types and (monadic) effects and Z3 - ;;gdscript ; the language you waited for - ;;(go +lsp) ; the hipster dialect - ;;(haskell +dante) ; a language that's lazier than I am - ;;hy ; readability of scheme w/ speed of python - ;;idris ; - json ; At least it ain't XML - ;;(java +meghanada) ; the poster child for carpal tunnel syndrome - javascript ; all(hope(abandon(ye(who(enter(here)))))) - ;;julia ; a better, faster MATLAB - ;;kotlin ; a better, slicker Java(Script) - ;;latex ; writing papers in Emacs has never been so fun - ;;lean - ;;factor - ;;ledger ; an accounting system in Emacs - ;;lua ; one-based indices? one-based indices - markdown ; writing docs for people to ignore - ;;nim ; python + lisp at the speed of c - nix ; I hereby declare "nix geht mehr!" - ;;ocaml ; an objective camel - (org - +present - +pretty) ; organize your plain life in plain text - ;;php ; perl's insecure younger brother - ;;plantuml ; diagrams for confusing people more - ;;purescript ; javascript, but functional - python ; beautiful is better than ugly - ;;qt ; the 'cutest' gui framework ever - ;;racket ; a DSL for DSLs - ;;raku ; the artist formerly known as perl6 - ;;rest ; Emacs as a REST client - ;;rst ; ReST in peace - ;;(ruby +rails) ; 1.step {|i| p "Ruby is #{i.even? ? 'love' : 'life'}"} - (rust +lsp) ; Fe2O3.unwrap().unwrap().unwrap().unwrap() - ;;scala ; java, but good - ;;scheme ; a fully conniving family of lisps - sh ; she sells {ba,z,fi}sh shells on the C xor - ;;sml - ;;solidity ; do you need a blockchain? No. - ;;swift ; who asked for emoji variables? - ;;terra ; Earth and Moon in alignment for performance. - ;;web ; the tubes - yaml ; JSON, but readable - - :email - ;;(mu4e +gmail) - notmuch - ;;(wanderlust +gmail) - - :app - ;;calendar - ;;irc ; how neckbeards socialize - ;;(rss +org) ; emacs as an RSS reader - ;;twitter ; twitter client https://twitter.com/vnought - - :os - (tty +osc) - - :config - ;;literate - (default +bindings +smartparens)) diff --git a/users/kat/dev/doom.d/packages.el b/users/kat/dev/doom.d/packages.el deleted file mode 100644 index ee573a50..00000000 --- a/users/kat/dev/doom.d/packages.el +++ /dev/null @@ -1,53 +0,0 @@ -;; -*- no-byte-compile: t; -*- -;;; $DOOMDIR/packages.el - -;; To install a package with Doom you must declare them here and run 'doom sync' -;; on the command line, then restart Emacs for the changes to take effect -- or -;; use 'M-x doom/reload'. - - -;; To install SOME-PACKAGE from MELPA, ELPA or emacsmirror: -;(package! some-package) - -;; To install a package directly from a remote git repo, you must specify a -;; `:recipe'. You'll find documentation on what `:recipe' accepts here: -;; https://github.com/raxod502/straight.el#the-recipe-format -;(package! another-package -; :recipe (:host github :repo "username/repo")) - -;; If the package you are trying to install does not contain a PACKAGENAME.el -;; file, or is located in a subdirectory of the repo, you'll need to specify -;; `:files' in the `:recipe': -;(package! this-package -; :recipe (:host github :repo "username/repo" -; :files ("some-file.el" "src/lisp/*.el"))) - -;; If you'd like to disable a package included with Doom, you can do so here -;; with the `:disable' property: -;(package! builtin-package :disable t) - -;; You can override the recipe of a built in package without having to specify -;; all the properties for `:recipe'. These will inherit the rest of its recipe -;; from Doom or MELPA/ELPA/Emacsmirror: -;(package! builtin-package :recipe (:nonrecursive t)) -;(package! builtin-package-2 :recipe (:repo "myfork/package")) - -;; Specify a `:branch' to install a package from a particular branch or tag. -;; This is required for some packages whose default branch isn't 'master' (which -;; our package manager can't deal with; see raxod502/straight.el#279) -;(package! builtin-package :recipe (:branch "develop")) - -;; Use `:pin' to specify a particular commit to install. -;(package! builtin-package :pin "1a2b3c4d5e") - - -;; Doom's packages are pinned to a specific commit and updated from release to -;; release. The `unpin!' macro allows you to unpin single packages... -;(unpin! pinned-package) -;; ...or multiple packages -;(unpin! pinned-package another-pinned-package) -;; ...Or *all* packages (NOT RECOMMENDED; will likely break things) -;(unpin! t) -(package! base16-theme) -(package! evil-easymotion) -(package! protobuf-mode :recipe (:host github :repo "emacsmirror/protobuf-mode" :files (:defaults "*"))) diff --git a/users/kat/dev/packages.nix b/users/kat/dev/packages.nix deleted file mode 100644 index be0f8aa1..00000000 --- a/users/kat/dev/packages.nix +++ /dev/null @@ -1,13 +0,0 @@ -{ config, pkgs, ... }: - -{ - home.packages = with pkgs; [ - jq - hyperfine - hexyl - tokei - nixpkgs-fmt - pandoc - hugo - ]; -} diff --git a/users/kat/dev/shell.nix b/users/kat/dev/shell.nix deleted file mode 100644 index c9d57c06..00000000 --- a/users/kat/dev/shell.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ config, ... }: - -{ - programs.zsh.shellAliases = { - readmefmt = "pandoc -f markdown -t gfm --reference-links ./readme.md --output readme.md --wrap=preserve"; - }; -} diff --git a/users/kat/dev/vim/coc.vim b/users/kat/dev/vim/coc.vim deleted file mode 100644 index c5591a42..00000000 --- a/users/kat/dev/vim/coc.vim +++ /dev/null @@ -1,135 +0,0 @@ -let g:coc_node_path='@nodejs@/bin/node' -let g:coc_config_home=$XDG_CONFIG_HOME . '/vim/coc' - -inoremap - \ pumvisible() ? "\" : - \ check_back_space() ? "\" : - \ coc#refresh() -inoremap pumvisible() ? "\" : "\" - -function! s:check_back_space() abort - let col = col('.') - 1 - return !col || getline('.')[col - 1] =~# '\s' -endfunction - -" Use to trigger completion. -if has('nvim') - inoremap coc#refresh() -else - inoremap coc#refresh() -endif - -" Make auto-select the first completion item and notify coc.nvim to -" format on enter, could be remapped by other vim plugin -noremap pumvisible() ? coc#_select_confirm() - \: "\u\\=coc#on_enter()\" - -" Use `[g` and `]g` to navigate diagnostics -" Use `:CocDiagnostics` to get all diagnostics of current buffer in location list. -nmap [g (coc-diagnostic-prev) -nmap ]g (coc-diagnostic-next) - -" GoTo code navigation. -nmap gd (coc-definition) -nmap gy (coc-type-definition) -nmap gi (coc-implementation) -nmap gr (coc-references) - -" Use K to show documentation in preview window. -nnoremap K :call show_documentation() - -function! s:show_documentation() - if (index(['vim','help'], &filetype) >= 0) - execute 'h '.expand('') - elseif (coc#rpc#ready()) - call CocActionAsync('doHover') - else - execute '!' . &keywordprg . " " . expand('') - endif -endfunction - -" Highlight the symbol and its references when holding the cursor. -autocmd CursorHold * silent call CocActionAsync('highlight') - -" Symbol renaming. -nmap rn (coc-rename) - -" Formatting selected code. -xmap f (coc-format-selected) -nmap f (coc-format-selected) - -augroup mygroup - autocmd! - " Setup formatexpr specified filetype(s). - autocmd FileType typescript,json setl formatexpr=CocAction('formatSelected') - " Update signature help on jump placeholder. - autocmd User CocJumpPlaceholder call CocActionAsync('showSignatureHelp') -augroup end - -" Applying codeAction to the selected region. -" Example: `aap` for current paragraph -xmap a (coc-codeaction-selected) -nmap a (coc-codeaction-selected) - -" Remap keys for applying codeAction to the current buffer. -nmap ac (coc-codeaction) -" Apply AutoFix to problem on the current line. -nmap qf (coc-fix-current) - -" Map function and class text objects -" NOTE: Requires 'textDocument.documentSymbol' support from the language server. -xmap if (coc-funcobj-i) -omap if (coc-funcobj-i) -xmap af (coc-funcobj-a) -omap af (coc-funcobj-a) -xmap ic (coc-classobj-i) -omap ic (coc-classobj-i) -xmap ac (coc-classobj-a) -omap ac (coc-classobj-a) - -" Remap and for scroll float windows/popups. -if has('nvim-0.4.0') || has('patch-8.2.0750') - nnoremap coc#float#has_scroll() ? coc#float#scroll(1) : "\" - nnoremap coc#float#has_scroll() ? coc#float#scroll(0) : "\" - inoremap coc#float#has_scroll() ? "\=coc#float#scroll(1)\" : "\" - inoremap coc#float#has_scroll() ? "\=coc#float#scroll(0)\" : "\" - vnoremap coc#float#has_scroll() ? coc#float#scroll(1) : "\" - vnoremap coc#float#has_scroll() ? coc#float#scroll(0) : "\" -endif - -" Use CTRL-S for selections ranges. -" Requires 'textDocument/selectionRange' support of language server. -nmap (coc-range-select) -xmap (coc-range-select) - -" Add `:Format` command to format current buffer. -command! -nargs=0 Format :call CocAction('format') - -" Add `:Fold` command to fold current buffer. -command! -nargs=? Fold :call CocAction('fold', ) - -" Add `:OR` command for organize imports of the current buffer. -command! -nargs=0 OR :call CocAction('runCommand', 'editor.action.organizeImport') - -" Add (Neo)Vim's native statusline support. -" NOTE: Please see `:h coc-status` for integrations with external plugins that -" provide custom statusline: lightline.vim, vim-airline. -set statusline^=%{coc#status()}%{get(b:,'coc_current_function',''')} - -" Mappings for CoCList -" Show all diagnostics. -nnoremap a :CocList diagnostics -" Manage extensions. -nnoremap e :CocList extensions -" Show commands. -nnoremap c :CocList commands -" Find symbol of current document. -nnoremap o :CocList outline -" Search workspace symbols. -nnoremap s :CocList -I symbols -" Do default action for next item. -nnoremap j :CocNext -" Do default action for previous item. -nnoremap k :CocPrev -" Resume latest coc list. -nnoremap p :CocListResume diff --git a/users/kat/dev/vim/default.nix b/users/kat/dev/vim/default.nix deleted file mode 100644 index fa95652f..00000000 --- a/users/kat/dev/vim/default.nix +++ /dev/null @@ -1,20 +0,0 @@ -{ config, pkgs, ... }: - -{ - programs.neovim = { - extraConfig = '' - luafile ${./init.lua} - ''; - extraPackages = with pkgs; [ - terraform-ls - ]; - plugins = with pkgs.vimPlugins; [ - neorg - nvim-cmp - plenary-nvim - nvim-base16 - telescope-nvim - nvim-lspconfig - ]; - }; -} diff --git a/users/kat/dev/vim/init.lua b/users/kat/dev/vim/init.lua deleted file mode 100644 index 11645d3e..00000000 --- a/users/kat/dev/vim/init.lua +++ /dev/null @@ -1,57 +0,0 @@ -local api = vim.api -local cmp = require'cmp' - ------------------------------------------------------------ --- Plugins ------------------------------------------------------------ - --- nvim-cmp -cmp.setup({ - snippet = { - expand = function(args) - vim.fn["vsnip#anonymous"](args.body) - end, - }, - mapping = { - [''] = cmp.mapping.confirm({ select = true }), - }, - sources = { - { name = 'neorg' }, - } -}) - --- lspconfig -require'lspconfig'.terraformls.setup{} -api.nvim_create_autocmd('BufWritePre', { - pattern = '*.tf', - command = 'lua vim.lsp.buf.formatting_sync()' -}) - --- neorg -require('neorg').setup { - -- Tell Neorg what modules to load - load = { - ['core.defaults'] = {}, -- Load all the default modules - ['core.norg.concealer'] = {}, -- Allows for use of icons - ['core.norg.dirman'] = { -- Manage your directories with Neorg - config = { - engine = 'nvim-cmp', - workspaces = { - home = '~/neorg' - } - } - } -}, -} - --- telescope -api.nvim_set_keymap('n', 'ff', 'Telescope find_files', { noremap = true, silent = true }) -api.nvim_set_keymap('n', 'fg', 'Telescope live_grep', { noremap = true, silent = true }) -api.nvim_set_keymap('n', 'fb', 'Telescope buffers', { noremap = true, silent = true }) -api.nvim_set_keymap('n', 'fh', 'Telescope help_tags', { noremap = true, silent = true }) - --- hop -vim.api.nvim_set_keymap('', 'f', "lua require'hop'.hint_char1({ direction = require'hop.hint'.HintDirection.AFTER_CURSOR, current_line_only = true })", {}) -vim.api.nvim_set_keymap('', 'F', "lua require'hop'.hint_char1({ direction = require'hop.hint'.HintDirection.BEFORE_CURSOR, current_line_only = true })", {}) -vim.api.nvim_set_keymap('', 't', "lua require'hop'.hint_char1({ direction = require'hop.hint'.HintDirection.AFTER_CURSOR, current_line_only = true, hint_offset = -1 })", {}) -vim.api.nvim_set_keymap('', 'T', "lua require'hop'.hint_char1({ direction = require'hop.hint'.HintDirection.BEFORE_CURSOR, current_line_only = true, hint_offset = 1 })", {}) diff --git a/users/kat/gnome/gnome.nix b/users/kat/gnome/gnome.nix deleted file mode 100644 index 2a148014..00000000 --- a/users/kat/gnome/gnome.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ config, lib, pkgs, ... }: { - home.packages = [ pkgs.pinentry-gnome pkgs.adapta-gtk-theme pkgs.papirus-icon-theme ]; - services.gpg-agent = { - pinentryFlavor = lib.mkForce "gnome3"; - }; -} diff --git a/users/kat/gui/base16.nix b/users/kat/gui/base16.nix deleted file mode 100644 index 12e64ab8..00000000 --- a/users/kat/gui/base16.nix +++ /dev/null @@ -1,3 +0,0 @@ -{ config, ... }: { - kw.theme.enable = true; -} diff --git a/users/kat/gui/firefox/default.nix b/users/kat/gui/firefox/default.nix deleted file mode 100644 index 2d191e65..00000000 --- a/users/kat/gui/firefox/default.nix +++ /dev/null @@ -1,383 +0,0 @@ -{ config, lib, pkgs, nixos, kw, ... }: with lib; - -let - commonSettings = { - "app.update.auto" = false; - "identity.fxaccounts.account.device.name" = nixos.networking.hostName; - "browser.download.lastDir" = "/home/kat/downloads"; - "toolkit.legacyUserProfileCustomizations.stylesheets" = true; - "svg.context-properties.content.enabled" = true; - "services.sync.engine.prefs" = false; - "services.sync.engine.prefs.modified" = false; - "services.sync.engine.passwords" = false; - "services.sync.declinedEngines" = "passwords,adblockplus,prefs"; - "media.eme.enabled" = true; # whee drm - "gfx.webrender.all.qualified" = true; - "gfx.webrender.all" = true; - "layers.acceleration.force-enabled" = true; - "gfx.canvas.azure.accelerated" = true; - "browser.ctrlTab.recentlyUsedOrder" = false; - "privacy.resistFingerprinting.block_mozAddonManager" = true; - "extensions.webextensions.restrictedDomains" = ""; - "tridactyl.unfixedamo" = true; - "tridactyl.unfixedamo_removed" = true; - "browser.shell.checkDefaultBrowser" = false; - "spellchecker.dictionary" = "en-CA"; - "ui.context_menus.after_mouseup" = true; - "browser.warnOnQuit" = false; - "browser.quitShortcut.disabled" = true; - "browser.startup.homepage" = "about:blank"; - "browser.contentblocking.category" = "strict"; - "browser.discovery.enabled" = false; - "browser.tabs.multiselect" = true; - "browser.tabs.unloadOnLowMemory" = true; - "browser.newtab.privateAllowed" = true; - "browser.newtabpage.enabled" = false; - "browser.urlbar.placeholderName" = ""; - "extensions.privatebrowsing.notification" = false; - "browser.startup.page" = 3; - "devtools.chrome.enabled" = true; - "devtools.inspector.showUserAgentStyles" = true; - "services.sync.prefs.sync.privacy.donottrackheader.value" = false; - "services.sync.prefs.sync.browser.safebrowsing.malware.enabled" = false; - "services.sync.prefs.sync.browser.safebrowsing.phishing.enabled" = false; - "app.shield.optoutstudies.enabled" = true; - "datareporting.healthreport.uploadEnabled" = false; - "datareporting.policy.dataSubmissionEnabled" = false; - "datareporting.sessions.current.clean" = true; - "devtools.onboarding.telemetry.logged" = false; - "toolkit.telemetry.updatePing.enabled" = false; - "browser.ping-centre.telemetry" = false; - "browser.newtabpage.activity-stream.asrouter.userprefs.cfr.addons" = false; - "browser.newtabpage.activity-stream.asrouter.userprefs.cfr.features" = false; - "toolkit.telemetry.bhrPing.enabled" = false; - "toolkit.telemetry.enabled" = false; - "toolkit.telemetry.firstShutdownPing.enabled" = false; - "toolkit.telemetry.hybridContent.enabled" = false; - "toolkit.telemetry.newProfilePing.enabled" = false; - "toolkit.telemetry.reportingpolicy.firstRun" = false; - "toolkit.telemetry.shutdownPingSender.enabled" = false; - "toolkit.telemetry.unified" = false; - "toolkit.telemetry.server" = ""; - "toolkit.telemetry.archive.enabled" = false; - "browser.onboarding.enabled" = false; - "experiments.enabled" = false; - "network.allow-experiments" = false; - "social.directories" = ""; - "social.remote-install.enabled" = false; - "social.toast-notifications.enabled" = false; - "social.whitelist" = ""; - "browser.safebrowsing.malware.enabled" = false; - "browser.safebrowsing.blockedURIs.enabled" = false; - "browser.safebrowsing.downloads.enabled" = false; - "browser.safebrowsing.downloads.remote.enabled" = false; - "browser.safebrowsing.phishing.enabled" = false; - "dom.ipc.plugins.reportCrashURL" = false; - "breakpad.reportURL" = ""; - "beacon.enabled" = false; - "browser.search.geoip.url" = ""; - "browser.search.region" = "UK"; - "browser.search.suggest.enabled" = true; - "browser.search.update" = false; - "browser.selfsupport.url" = ""; - "extensions.getAddons.cache.enabled" = false; - "extensions.pocket.enabled" = true; - "geo.enabled" = false; - "geo.wifi.uri" = false; - "media.getusermedia.screensharing.enabled" = false; - "media.video_stats.enabled" = false; - "device.sensors.enabled" = false; - "dom.battery.enabled" = false; - "dom.enable_performance" = false; - "network.dns.disablePrefetch" = false; - "network.http.speculative-parallel-limit" = 8; - "network.predictor.cleaned-up" = true; - "network.predictor.enabled" = true; - "network.prefetch-next" = true; - "security.dialog_enable_delay" = 300; - "dom.event.contextmenu.enabled" = false; - "privacy.trackingprotection.enabled" = true; - "privacy.trackingprotection.fingerprinting.enabled" = true; - "privacy.trackingprotection.cryptomining.enabled" = true; - "privacy.trackingprotection.introCount" = 20; - "signon.rememberSignons" = false; - "xpinstall.whitelist.required" = false; - "xpinstall.signatures.required" = false; - "general.warnOnAboutConfig" = false; - }; -in -{ - home.file.".mozilla/tst.css" = { inherit (kw.sassTemplate { name = "tst"; src = ./tst.sass; }) source; }; - - programs.zsh.shellAliases = { - ff-pm = "firefox --ProfileManager"; - ff-main = "firefox -P main"; - }; - - home.sessionVariables = { - XDG_CURRENT_DESKTOP = "sway"; - }; - - programs.firefox = { - enable = true; - packageUnwrapped = pkgs.firefox-unwrapped; - wrapperConfig = { - extraPolicies = { - DisableAppUpdate = true; - }; - extraNativeMessagingHosts = with pkgs; [ - tridactyl-native - ] ++ optional config.programs.buku.enable bukubrow; - }; - extensions = with pkgs.nur.repos.rycee.firefox-addons; [ - sponsorblock - link-cleaner - a11ycss - canvasblocker - view-image - wappalyzer - auto-tab-discard - bitwarden - darkreader - decentraleyes - foxyproxy-standard - clearurls - df-youtube - tridactyl - old-reddit-redirect - privacy-badger - reddit-enhancement-suite - refined-github - stylus - temporary-containers - browserpass - tree-style-tab - multi-account-containers - ublock-origin - violentmonkey - ]; - profiles = { - main = { - id = 0; - isDefault = true; - settings = commonSettings; - userChrome = (kw.sassTemplate { name = "userChrome"; src = ./userChrome.sass; }).text; - containers.identities = [ - { id = 7; name = "Professional"; icon = "briefcase"; color = "red"; } - { id = 8; name = "Shopping"; icon = "cart"; color = "pink"; } - { id = 9; name = "Sensitive"; icon = "gift"; color = "orange"; } - { id = 10; name = "Private"; icon = "fence"; color = "blue"; } - ]; - }; - }; - }; - programs.firefox.tridactyl = let - xsel = if config.deploy.profile.sway then "${pkgs.wl-clipboard}/bin/wl-copy" else "${pkgs.xsel}/bin/xsel"; - urxvt = "${pkgs.kitty}/bin/kitty"; - mpv = "${config.programs.mpv.finalPackage}/bin/mpv"; - vim = "${config.programs.neovim.package}/bin/nvim"; - firefox = "${config.programs.firefox.package}/bin/firefox"; - in { - enable = true; - sanitise = { - local = true; - sync = true; - }; - themes = { - custom = '' - :root.TridactylThemeCustom { - --tridactyl-hintspan-font-family: monospace, courier, sans-serif; - --tridactyl-hintspan-font-size: 12px; - --tridactyl-hintspan-fg: #fff; - --tridactyl-hintspan-bg: #000088; - --tridactyl-hintspan-border-color: #000; - --tridactyl-hintspan-border-width: 1px; - --tridactyl-hintspan-border-style: dashed; - --tridactyl-hint-bg: #ffff99; - --tridactyl-hint-outline: 1px dotted #000; - --tridactyl-hint-active-bg: #00ff00; - --tridactyl-hint-active-outline: 1px dotted #000; - } - :root.TridactylThemeCustom .TridactylHintElem { - opacity: 0.3; - } - :root.TridactylThemeCustom span.TridactylHint { - padding: 1px; - margin-top: 8px; - margin-left: -8px; - opacity: 0.9; - text-shadow: black -1px -1px 0px, black -1px 0px 0px, black -1px 1px 0px, black 1px -1px 0px, black 1px 0px 0px, black 1px 1px 0px, black 0px 1px 0px, black 0px -1px 0px !important; - } - ''; - }; - extraConfig = mkMerge [ - "colors default" - "colors custom" - - (mkBefore ''jsb Promise.all(Object.keys(tri.config.get("searchurls")).forEach(u => tri.config.set("searchurls", u, "")))'') - "jsb localStorage.fixedamo = true" - ]; - - autocmd = { - docStart = [ - { urlPattern = ''^https:\/\/www\.reddit\.com''; cmd = ''js tri.excmds.urlmodify("-t", "www", "old")''; } - ]; - tabEnter = [ - { urlPattern = ".*"; cmd = "unfocus"; } # alternative to `allowautofocus=false` - ]; - }; - - exalias = { - wq = "qall"; - - # whee clipboard stuff - fn_getsel = ''jsb tri.native.run("${xsel} -op").then(r => r.content)''; - fn_getclip = ''jsb tri.native.run("${xsel} -ob").then(r => r.content)''; - fn_setsel = ''jsb -p tri.native.run("${xsel} -ip", JS_ARG)''; - fn_setclip = ''jsb -p tri.native.run("${xsel} -ib", JS_ARG)''; - - fn_noempty = "jsb -p return JS_ARG"; - }; - - bindings = [ - { key = ";y"; cmd = ''composite hint -pipe a[href]:not([display="none"]):not([href=""]) href | fn_setsel''; } - { key = ";Y"; cmd = ''composite hint -pipe a[href]:not([display="none"]):not([href=""]) href | fn_setclip''; } - { key = ";m"; cmd = ''composite hint -pipe a[href]:not([display="none"]):not([href=""]) href | shellescape | exclaim_quiet ${mpv}''; } - { key = "F"; cmd = ''composite hint -t -c a[href]:not([display="none"]) href''; } - # mpv --ontop --keepaspect-window --profile=protocol.http - - { mode = "hint"; key = "j"; mods = ["alt"]; cmd = "hint.focusBottomHint"; } - { mode = "hint"; key = "k"; mods = ["alt"]; cmd = "hint.focusTopHint"; } - { mode = "hint"; key = "h"; mods = ["alt"]; cmd = "hint.focusLeftHint"; } - { mode = "hint"; key = "l"; mods = ["alt"]; cmd = "hint.focusRightHint"; } - - # Fix hints on google search results - { urlPattern = ''www\.google\.com''; key = "f"; cmd = "hint -Jc .rc>.r>a"; } - { urlPattern = ''www\.google\.com''; key = "F"; cmd = "hint -Jtc .rc>.r>a"; } - - # Comment toggler for Reddit and Hacker News - { urlPattern = ''reddit\.com''; key = ";c"; cmd = ''hint -c [class*="expand"],[class="togg"]''; } - - # GitHub pull request checkout command to clipboard - { key = "ygp"; cmd = ''composite js /^https?:\/\/github\.com\/([.0-9a-zA-Z_-]*\/[.0-9a-zA-Z_-]*)\/pull\/([0-9]*)/.exec(document.location.href) | js -p `git fetch https://github.com/''${JS_ARG[1]}.git pull/''${JS_ARG[2]}/head:pull-''${JS_ARG[2]} && git checkout pull-''${JS_ARG[2]}` | fn_setsel''; } - - # Git{Hub,Lab} git clone via SSH yank (NOTE: for https just... copy the url!) - { key = "ygc"; cmd = ''composite js "git clone " + document.location.href.replace(/https?:\/\//,"git@").replace("/",":").replace(/$/,".git") | fn_setsel''; } - - # Git add remote (what if you want name to be upstream or something different? can I prompt via fillcmdline..?) - { key = "ygr"; cmd = ''composite js /^https?:\/\/(github\.com|gitlab\.com)\/([.0-9a-zA-Z_-]*)\/([.0-9a-zA-Z_-]*)/.exec(document.location.href) | js -p `git remote add ''${JS_ARG[3]} https://''${JS_ARG[1]/''${JS_ARG[2]}/''${JS_ARG[3]}.git && git fetch ''${JS_ARG[3]}` | fn_setsel''; } - - # I like wikiwand but I don't like the way it changes URLs - { urlPattern = ''wikiwand\.com''; key = "yy"; cmd = ''composite js document.location.href.replace("wikiwand.com/en","wikipedia.org/wiki") | fn_setsel''; } - - # attempt to maintain one tab per window: - # bind F hint -w - # bind T current_url winopen - # bind t fillcmdline winopen - - { key = "r"; cmd = "reload"; } - { key = "R"; cmd = "reloadhard"; } - { key = "d"; cmd = "tabclose"; } - - { key = "``"; cmd = "tab #"; } - - { key = "j"; cmd = "scrollline 6"; } - { key = "k"; cmd = "scrollline -6"; } - - { mode = ["normal" "input" "insert"]; key = "h"; mods = ["ctrl"]; cmd = "tabprev"; } - { mode = ["normal" "input" "insert"]; key = "l"; mods = ["ctrl"]; cmd = "tabnext"; } - { mode = ["normal" "input" "insert"]; key = "J"; mods = ["ctrl"]; cmd = "tabnext"; } - { mode = ["normal" "input" "insert"]; key = "K"; mods = ["ctrl"]; cmd = "tabprev"; } - # TODO: consider C-jk instead of C-hl? - { mode = ["normal" "input" "insert"]; key = "k"; mods = ["ctrl"]; cmd = "tabmove -1"; } - { mode = ["normal" "input" "insert"]; key = "j"; mods = ["ctrl"]; cmd = "tabmove +1"; } - { key = ""; cmd = "scrollpage 0.75"; } - { key = "f"; mods = ["ctrl"]; cmd = null; } - { key = "b"; mods = ["ctrl"]; cmd = null; } - { mode = "ex"; key = "a"; mods = ["ctrl"]; cmd = null; } - - # Make gu take you back to subreddit from comments - { urlPattern = ''reddit\.com''; key = "gu"; cmd = "urlparent 3"; } - - # inpage find (not recommended for actual use) - { key = "/"; mods = ["ctrl"]; cmd = "fillcmdline find"; } - { key = "?"; cmd = "fillcmdline find -?"; } - { key = "n"; cmd = "findnext 1"; } - { key = "N"; cmd = "findnext -1"; } - { key = ","; cmd = "nohlsearch"; } - - { key = "gi"; cmd = "focusinput -l"; } # this should be 0 but it never seems to focus anything visible or useful? - { key = "i"; cmd = "focusinput -l"; } - { key = "I"; cmd = "mode ignore"; } - { mode = "ignore"; key = ""; mods = ["shift"]; cmd = "composite mode normal ; hidecmdline"; } - - { key = ""; mods = ["shift"]; cmd = "composite fn_getsel | fillcmdline_notrail open"; } - { key = ""; mods = ["shift" "alt"]; cmd = "composite fn_getclip | fillcmdline_notrail open"; } - { key = "C"; mods = ["shift" "alt"]; cmd = "composite fn_getsel | fn_setclip"; } - { mode = ["ex" "input" "insert"]; key = ""; mods = ["shift"]; cmd = "composite fn_getsel | text.insert_text"; } - { mode = ["ex" "input" "insert"]; key = ""; mods = ["shift" "alt"]; cmd = "composite fn_getclip | text.insert_text"; } - { mode = ["ex" "input" "insert"]; key = "V"; mods = ["shift" "alt"]; cmd = "composite fn_getclip | text.insert_text"; } - { mode = ["ex" "input" "insert"]; key = "C"; mods = ["shift" "alt"]; cmd = "composite fn_getsel | fn_setclip"; } - - { mode = ["insert" "input"]; key = "e"; mods = ["ctrl"]; cmd = "editor"; } - - { key = ""; cmd = null; } - ]; - - settings = { - #allowautofocus = false; - - browser = firefox; - - editorcmd = ''${urxvt} -e ${vim} %f -c "normal %lG%cl"''; - - nag = false; - leavegithubalone = false; - newtabfocus = "page"; - # until empty newtab focus works... - tabopencontaineraware = false; - #storageloc = "local"; - #storageloc = "sync"; - hintuppercase = false; - hintchars = "fdsqjklmrezauiopwxcvghtybn"; - #hintfiltermode = "vimperator-reflow"; - #hintnames = "numeric"; - modeindicator = true; - modeindicatorshowkeys = true; - autocontainmode = "relaxed"; - - searchengine = "g"; - "searchurls.g" = "https://encrypted.google.com/search?q=%s"; - "searchurls.gh" = "https://github.com/search?q=%s"; - "searchurls.ghc" = "https://github.com/%s1/search?q=%s2"; - "searchurls.ghf" = "https://github.com/%s1/search?q=filename%3a%s2"; - "searchurls.ghp" = "https://github.com/%s1/pulls?q=%s2"; - "searchurls.ghi" = "https://github.com/%s1/issues?q=is%3aissue+%s2"; - "searchurls.gha" = "https://github.com/%s1/issues?q=%s2"; - "searchurls.w" = "https://en.wikipedia.org/wiki/Special:Search?search=%s"; - "searchurls.ddg" = "https://duckduckgo.com/?q=%s"; - "searchurls.r" = "https://reddit.com/r/%s"; - "searchurls.rs" = "https://doc.rust-lang.org/std/index.html?search=%s"; - "searchurls.crates" = "https://lib.rs/search?q=%s"; - "searchurls.docs" = "https://docs.rs/%s1/*/?search=%s2"; - "searchurls.nixos" = "https://search.nixos.org/options?channel=unstable&from=0&size=1000&sort=alpha_asc&query=%s"; - "searchurls.aur" = "https://aur.archlinux.org/packages/?K=%s"; - "searchurls.yt" = "https://www.youtube.com/results?search_query=%s"; - "searchurls.az" = "https://www.amazon.ca/s/ref=nb_sb_noss?url=search-alias%3Daps&field-keywords=%s"; - "searchurls.gw2" = "https://wiki.guildwars2.com/index.php?title=Special%3ASearch&search=%s&go=Go&ns0=1"; - "searchurls.gw2i" = "https://gw2efficiency.com/account/overview?filter.name=%s"; - "searchurls.gw2c" = "https://gw2efficiency.com/crafting/recipe-search?filter.orderBy=name&filter.search=%s"; - - putfrom = "selection"; - # set yankto selection - yankto = "both"; - externalclipboardcmd = xsel; - }; - urlSettings = { - allowautofocus = { - "play\\.rust-lang\\.org" = { value = true; }; - "typescriptlang\\.org/play" = { value = true; }; - }; - }; - }; -} diff --git a/users/kat/gui/fonts.nix b/users/kat/gui/fonts.nix deleted file mode 100644 index 78e03277..00000000 --- a/users/kat/gui/fonts.nix +++ /dev/null @@ -1,5 +0,0 @@ -{ config, ... }: - -{ - fonts.fontconfig.enable = true; -} diff --git a/users/kat/gui/foot.nix b/users/kat/gui/foot.nix deleted file mode 100644 index f984c6fc..00000000 --- a/users/kat/gui/foot.nix +++ /dev/null @@ -1,33 +0,0 @@ -{ config, lib, pkgs, ... }: - -with lib; - -{ - programs.foot = { - enable = true; - settings = { - main = { - term = "foot"; - locked-title = false; - font = "${config.kw.theme.font.termName}:size=${toString config.kw.theme.font.size}, Twitter Color Emoji:size=8"; - font-bold = "${config.kw.theme.font.termName}:size=${toString config.kw.theme.font.size}:style=Bold"; - font-italic = "${config.kw.theme.font.termName}:size=${toString config.kw.theme.font.size}:style=Italic"; - font-bold-italic = "${config.kw.theme.font.termName}:size=${toString config.kw.theme.font.size}:style=Bold Italic"; - dpi-aware = "no"; - }; - cursor = { - style = "beam"; - }; - bell = { - urgent = true; - notify = true; - }; - colors = { - alpha = "0.9"; - }; - key-bindings = { - show-urls-copy = "Control+Shift+i"; - }; - }; - }; -} diff --git a/users/kat/gui/hedgedoc.nix b/users/kat/gui/hedgedoc.nix deleted file mode 100644 index c31051cf..00000000 --- a/users/kat/gui/hedgedoc.nix +++ /dev/null @@ -1,10 +0,0 @@ -{ config, lib, pkgs, tf, ... }: { - home.sessionVariables = { - HEDGEDOC_SERVER = "https://md.kittywit.ch"; - HEDGEDOC_CONFIG_DIR = "${config.home.homeDirectory}/.config/hedgedoc"; - }; - - home.packages = with pkgs; [ - hedgedoc-cli - ]; -} diff --git a/users/kat/gui/nextcloud.nix b/users/kat/gui/nextcloud.nix deleted file mode 100644 index 9e3344b8..00000000 --- a/users/kat/gui/nextcloud.nix +++ /dev/null @@ -1,13 +0,0 @@ -{ config, pkgs, ... }: { - services = { - nextcloud-client = { - enable = true; - }; - gnome-keyring = { - enable = true; - }; - }; - home.packages = [ - pkgs.gnome3.seahorse - ]; -} diff --git a/users/kat/gui/xdg.nix b/users/kat/gui/xdg.nix deleted file mode 100644 index abd6c3b9..00000000 --- a/users/kat/gui/xdg.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ config, pkgs, ... }: - -{ - home.packages = with pkgs; [ - xdg-utils - ]; -} diff --git a/users/kat/i3/dunst.nix b/users/kat/i3/dunst.nix deleted file mode 100644 index 7c172340..00000000 --- a/users/kat/i3/dunst.nix +++ /dev/null @@ -1,49 +0,0 @@ -{ config, base16, pkgs, lib, ... }: with lib; { - services.dunst = { - enable = true; - iconTheme = { - inherit (config.gtk.iconTheme) package name; - size = mkDefault "32x32"; - }; - settings = with base16.map.hash.rgba; { - global = { - transparency = 10; - follow = "mouse"; - font = "${config.kw.theme.font.name} 9"; - width = "(0, 720)"; # min, max - idle_threshold = 60 * 3; - show_age_threshold = 60; - icon_position = "right"; - mouse_right_click = "do_action"; - mouse_middle_click = "context"; - mouse_left_click = "close_current"; - show_indicators = false; - fullscreen = "pushback"; # default is to "show" - #dmenu = "${config.programs.dmenu.package}/bin/dmenu"; - dmenu = "${config.programs.rofi.package}/bin/rofi"; - browser = "${pkgs.xdg-utils}/bin/xdg-open"; - }; - urgency_low = { - frame_color = background_light; - background = background_selection; - foreground = foreground_alt; - highlight = keyword; - timeout = 10; - }; - urgency_normal = { - frame_color = background_light; - background = background; - foreground = foreground; - highlight = keyword; - timeout = 30; - }; - urgency_critical = { - frame_color = link; # or url - background = background_light; - foreground = foreground; - highlight = keyword; - timeout = 60; - }; - }; - }; -} diff --git a/users/kat/i3/i3.nix b/users/kat/i3/i3.nix deleted file mode 100644 index a981265f..00000000 --- a/users/kat/i3/i3.nix +++ /dev/null @@ -1,309 +0,0 @@ -{ config, base16, pkgs, lib, ... }: with lib; -let - lockCmd = "${pkgs.i3lock}/bin/i3lock -nc 000000"; -in { - programs.zsh.loginExtra = '' - if [[ -z "''${TMUX-}" && -z "''${DISPLAY-}" && "''${XDG_VTNR-}" = 1 && $(${pkgs.coreutils}/bin/id -u) != 0 ]]; then - ${pkgs.xorg.xinit}/bin/startx - fi - ''; - - services = { - i3gopher.enable = true; - screen-locker = { - enable = true; - inherit lockCmd; - xautolock.enable = true; - }; - }; - - home.file.".xinitrc".text = '' - exec ~/.xsession - ''; - - xsession = { - enable = true; - windowManager.i3 = - let - cfg = config.xsession.windowManager.i3.config; - bindsym = k: v: "bindsym ${k} ${v}"; - bindWorkspace = key: workspace: { - "${cfg.modifier}+${key}" = "workspace number ${workspace}"; - "${cfg.modifier}+shift+${key}" = "move container to workspace number ${workspace}"; - }; - workspaceBindings = map (v: bindWorkspace v "${v}:${v}") [ - "1" - "2" - "3" - "4" - "5" - "6" - "7" - "8" - "9" - ] - ++ [ (bindWorkspace "0" "10:10") ] - ++ lib.imap1 (i: v: bindWorkspace v "${toString (10 + i)}:${v}") [ - "F1" - "F2" - "F3" - "F4" - "F5" - "F6" - "F7" - "F8" - "F9" - "F10" - "F11" - "F12" - ]; - workspaceBindings' = map (lib.mapAttrsToList bindsym) workspaceBindings; - workspaceBindingsStr = lib.concatStringsSep "\n" (lib.flatten workspaceBindings'); - in - { - enable = true; - package = pkgs.i3-gaps; - config = - let - pactl = "${config.home.nixos.hardware.pulseaudio.package or pkgs.pulseaudio}/bin/pactl"; - #dmenu = "${pkgs.wofi}/bin/wofi -idbt ${pkgs.kitty}/bin/kitty -s ~/.config/wofi/wofi.css -p '' -W 25%"; - dmenu = pkgs.writeShellScriptBin "rofi-wrap" ''${pkgs.rofi}/bin/rofi -combi-modi window,drun,ssh -show combi''; - in - { - - modes = { - "System (l) lock, (e) logout, (s) suspend, (h) hibernate, (r) reboot, (Shift+s) shutdown" = - { - "l" = "exec ${lockCmd}, mode default"; - "e" = "exit, mode default"; - "s" = "exec systemctl suspend, mode default"; - "h" = "exec systemctl hibernate, mode default"; - "r" = "exec systemctl reboot, mode default"; - "Shift+s" = "exec systemctl shutdown, mode default"; - "Return" = "mode default"; - "Escape" = "mode default"; - }; - }; - # bars = [{ command = "${pkgs.waybar}/bin/waybar"; }]; - bars = []; - - fonts = { - names = [ config.kw.theme.font.name ]; - style = "Regular"; - size = config.kw.theme.font.size; - }; - terminal = "${pkgs.kitty}/bin/kitty"; - #menu = "${pkgs.j4-dmenu-desktop}/bin/j4-dmenu-desktop --no-generic --dmenu=\"${dmenu}\" --term='${pkgs.kitty}/bin/kitty'"; - modifier = "Mod4"; - - assigns = { "12:F2" = [{ class = "screenstub"; }]; }; - startup = [ - { - command = "gsettings set org.gnome.desktop.interface cursor-theme 'Quintom_Snow'"; - } - { - command = "systemctl --user restart dunst"; - always = true; - } - { - command = "systemctl --user restart konawall.service"; - always = true; - } - ]; - - modes.resize = { - "a" = "resize shrink width 4 px or 4 ppt"; - "s" = "resize shrink height 4 px or 4 ppt"; - "w" = "resize grow height 4 px or 4 ppt"; - "d" = "resize grow width 4 px or 4 ppt"; - "Left" = "resize shrink width 4 px or 4 ppt"; - "Down" = "resize shrink height 4 px or 4 ppt"; - "Up" = "resize grow height 4 px or 4 ppt"; - "Right" = "resize grow width 4 px or 4 ppt"; - Return = ''mode "default"''; - Escape = ''mode "default"''; - "${cfg.modifier}+z" = ''mode "default"''; - }; - window = { - border = 1; - titlebar = false; - hideEdgeBorders = "smart"; - }; - - floating = { - border = 1; - titlebar = false; - }; - focus = { - forceWrapping = true; - }; - workspaceAutoBackAndForth = true; - - keybindings = { - "${cfg.modifier}+Return" = "exec ${cfg.terminal}"; - "${cfg.modifier}+x" = "exec ${lockCmd}"; - - # focus windows - regular - "${cfg.modifier}+Left" = "focus left"; - "${cfg.modifier}+Down" = "focus down"; - "${cfg.modifier}+Up" = "focus up"; - "${cfg.modifier}+Right" = "focus right"; - - # move window / container - regular - "${cfg.modifier}+shift+Left" = "move left"; - "${cfg.modifier}+shift+Down" = "move down"; - "${cfg.modifier}+shift+Up" = "move up"; - "${cfg.modifier}+shift+Right" = "move right"; - - # focus output - regular - "${cfg.modifier}+control+Left" = "focus output left"; - "${cfg.modifier}+control+Down" = "focus output down"; - "${cfg.modifier}+control+Up" = "focus output up"; - "${cfg.modifier}+control+Right" = "focus output right"; - - # move container to output - regular - "${cfg.modifier}+control+shift+Left" = "move container to output left"; - "${cfg.modifier}+control+shift+Down" = "move container to output down"; - "${cfg.modifier}+control+shift+Up" = "move container to output up"; - "${cfg.modifier}+control+shift+Right" = "move container to output right"; - - # move workspace to output - regular - "${cfg.modifier}+control+shift+Mod1+Left" = "move workspace to output left"; - "${cfg.modifier}+control+shift+Mod1+Down" = "move workspace to output down"; - "${cfg.modifier}+control+shift+Mod1+Up" = "move workspace to output up"; - "${cfg.modifier}+control+shift+Mod1+Right" = "move workspace to output right"; - - - # focus parent/child - "${cfg.modifier}+q" = "focus parent"; - "${cfg.modifier}+e" = "focus child"; - - # floating - "${cfg.modifier}+Shift+space" = "floating toggle"; - "${cfg.modifier}+space" = "focus mode_toggle"; - - # workspace history switching - "${cfg.modifier}+Tab" = "workspace back_and_forth"; - "${cfg.modifier}+Shift+Tab" = "exec ${config.services.i3gopher.focus-last}"; - - # multimedia / laptop - "XF86AudioLowerVolume" = "exec --no-startup-id ${pactl} set-sink-volume @DEFAULT_SINK@ -5%"; - "XF86AudioRaiseVolume" = "exec --no-startup-id ${pactl} set-sink-volume @DEFAULT_SINK@ +5%"; - "XF86AudioMute" = "exec --no-startup-id ${pactl} set-sink-mute @DEFAULT_SINK@ toggle"; - "XF86AudioMute+Shift" = "exec --no-startup-id ${pactl} set-source-mute @DEFAULT_SOURCE@ toggle"; - "XF86AudioMicMute" = "exec --no-startup-id ${pactl} set-source-mute @DEFAULT_SOURCE@ toggle"; - "XF86MonBrightnessDown" = "exec ${pkgs.light}/bin/light -U 5"; - "XF86MonBrightnessUp" = "exec ${pkgs.light}/bin/light -A 5"; - - # dmenu - "${cfg.modifier}+r" = "exec ${dmenu.exec}"; - - - # screenshots - upload - "${cfg.modifier}+Print" = "exec ${pkgs.sway-scrot}/bin/sway-scrot --notify upload screen"; - "${cfg.modifier}+Shift+Print" = "exec ${pkgs.sway-scrot}/bin/sway-scrot --notify upload area"; - "${cfg.modifier}+Mod1+Print" = "exec ${pkgs.sway-scrot}/bin/sway-scrot --notify upload active"; - "${cfg.modifier}+Mod1+Control+Print" = "exec ${pkgs.sway-scrot}/bin/sway-scrot --notify upload window"; - "${cfg.modifier}+Control+Print" = "exec ${pkgs.sway-scrot}/bin/sway-scrot --notify upload output"; - - # screenshots - clipboard - "Print" = "exec ${pkgs.sway-scrot}/bin/sway-scrot --notify copys screen"; - "Shift+Print" = "exec ${pkgs.sway-scrot}/bin/sway-scrot --notify copys area"; - "Mod1+Print" = "exec ${pkgs.sway-scrot}/bin/sway-scrot --notify copys active"; - "Mod1+Control+Print" = "exec ${pkgs.sway-scrot}/bin/sway-scrot --notify copys window"; - "Control+Print" = "exec ${pkgs.sway-scrot}/bin/sway-scrot --notify copys output"; - - # layout handling - "${cfg.modifier}+b" = "splith"; - "${cfg.modifier}+v" = "splitv"; - "${cfg.modifier}+o" = "layout stacking"; - "${cfg.modifier}+i" = "layout tabbed"; - "${cfg.modifier}+h" = "layout toggle split"; - "${cfg.modifier}+f" = "fullscreen"; - - # sway specific - "${cfg.modifier}+Shift+q" = "kill"; - "${cfg.modifier}+Shift+c" = "reload"; - "${cfg.modifier}+Mod1+Shift+c" = "restart"; - - # mode triggers - "${cfg.modifier}+Shift+r" = "mode resize"; - "${cfg.modifier}+Delete" = ''mode "System (l) lock, (e) logout, (s) suspend, (h) hibernate, (r) reboot, (Shift+s) shutdown"''; - }; - - colors = let inherit (config.kw.theme) base16; in - { - focused = { - border = base16.base01; - background = base16.base0D; - text = base16.base07; - indicator = base16.base0D; - childBorder = base16.base0D; - }; - focusedInactive = { - border = base16.base02; - background = base16.base04; - text = base16.base00; - indicator = base16.base04; - childBorder = base16.base04; - }; - unfocused = { - border = base16.base01; - background = base16.base02; - text = base16.base06; - indicator = base16.base02; - childBorder = base16.base02; - }; - urgent = { - border = base16.base03; - background = base16.base08; - text = base16.base00; - indicator = base16.base08; - childBorder = base16.base08; - }; - }; - }; - extraConfig = '' - title_align center - set $mode_gaps Gaps: (o) outer, (i) inner - set $mode_gaps_outer Outer Gaps: +|-|0 (local), Shift + +|-|0 (global) - set $mode_gaps_inner Inner Gaps: +|-|0 (local), Shift + +|-|0 (global) - bindsym ${cfg.modifier}+Shift+g mode "$mode_gaps" - - mode "$mode_gaps" { - bindsym o mode "$mode_gaps_outer" - bindsym i mode "$mode_gaps_inner" - bindsym Return mode "default" - bindsym Escape mode "default" - } - - mode "$mode_gaps_inner" { - bindsym equal gaps inner current plus 5 - bindsym minus gaps inner current minus 5 - bindsym 0 gaps inner current set 0 - - bindsym plus gaps inner all plus 5 - bindsym Shift+minus gaps inner all minus 5 - bindsym Shift+0 gaps inner all set 0 - - bindsym Return mode "default" - bindsym Escape mode "default" - } - - mode "$mode_gaps_outer" { - bindsym equal gaps outer current plus 5 - bindsym minus gaps outer current minus 5 - bindsym 0 gaps outer current set 0 - - bindsym plus gaps outer all plus 5 - bindsym Shift+minus gaps outer all minus 5 - bindsym Shift+0 gaps outer all set 0 - - bindsym Return mode "default" - bindsym Escape mode "default" - } - ${workspaceBindingsStr} - ''; - }; - }; - } diff --git a/users/kat/i3/keyboard.nix b/users/kat/i3/keyboard.nix deleted file mode 100644 index efe70297..00000000 --- a/users/kat/i3/keyboard.nix +++ /dev/null @@ -1,2 +0,0 @@ -{ config, ... }: { -} diff --git a/users/kat/i3/picom.nix b/users/kat/i3/picom.nix deleted file mode 100644 index 76775d5c..00000000 --- a/users/kat/i3/picom.nix +++ /dev/null @@ -1,19 +0,0 @@ -{ config, pkgs, lib, ... }: with lib; { - services.picom = { - enable = true; - experimentalBackends = mkDefault true; - package = mkDefault pkgs.picom-next; - opacityRule = [ - # https://wiki.archlinux.org/index.php/Picom#Tabbed_windows_(shadows_and_transparency) - "100:class_g = 'URxvt' && !_NET_WM_STATE@:32a" - "0:_NET_WM_STATE@[0]:32a *= '_NET_WM_STATE_HIDDEN'" - "0:_NET_WM_STATE@[1]:32a *= '_NET_WM_STATE_HIDDEN'" - "0:_NET_WM_STATE@[2]:32a *= '_NET_WM_STATE_HIDDEN'" - "0:_NET_WM_STATE@[3]:32a *= '_NET_WM_STATE_HIDDEN'" - "0:_NET_WM_STATE@[4]:32a *= '_NET_WM_STATE_HIDDEN'" - ]; - shadowExclude = [ - "_NET_WM_STATE@:32a *= '_NET_WM_STATE_HIDDEN'" - ]; - }; - } diff --git a/users/kat/i3/polybar.nix b/users/kat/i3/polybar.nix deleted file mode 100644 index 94705500..00000000 --- a/users/kat/i3/polybar.nix +++ /dev/null @@ -1,464 +0,0 @@ -{ config, base16, pkgs, lib, ... }: with lib; { - systemd.user.services.polybar.Service.Environment = mkForce [ - "PATH=/nix/store/bmh5zjsihnyim0pmhgnnmn4adribvns6-polybar-3.5.7/bin:/run/wrappers/bin" - "NOTMUCH_CONFIG=${config.home.sessionVariables.NOTMUCH_CONFIG}" - ]; - services.polybar = { - enable = true; - script = let - xrandr = filter: "${pkgs.xorg.xrandr}/bin/xrandr -q | ${pkgs.gnugrep}/bin/grep -F ' ${filter}' | ${pkgs.coreutils}/bin/cut -d' ' -f1"; - in mkIf config.xsession.enable '' - primary=$(${xrandr "connected primary"}) - for display in $(${xrandr "connected"}); do - export POLYBAR_MONITOR=$display - export POLYBAR_MONITOR_PRIMARY=$([[ $primary = $display ]] && echo true || echo false) - export POLYBAR_TRAY_POSITION=$([[ $primary = $display ]] && echo right || echo none) - polybar kat & - done - ''; - package = pkgs.polybarFull; - config = { - "bar/base" = { - modules-left = mkMerge [ - (mkIf config.xsession.windowManager.i3.enable (mkBefore [ "i3" ])) - [ "title" ] - ]; - modules-center = mkMerge [ - (mkAfter [ "arc" "hex" "miku" "date" ]) - ]; - modules-right = mkMerge [ - (mkOrder 1240 [ "pulseaudio" "headset" "mail" ]) - (mkOrder 1250 [ "cpu" "temp" "ram" "net-enp34s0" ]) - (mkOrder 1490 [ "gpg" ]) - ]; - }; - }; - settings = let - colours = base16.map.hash.argb; - warn-colour = colours.constant; # or deleted - in with colours; { - "bar/kat" = { - "inherit" = "bar/base"; - monitor = { - text = mkIf config.xsession.enable "\${env:POLYBAR_MONITOR:}"; - }; - height = 20; - enable-ipc = true; - tray = { - maxsize = 12; - position = "\${env:POLYBAR_TRAY_POSITION:right}"; - }; - offset = { - x = 0; - y = 0; - }; - dpi = { - x = 0; - y = 0; - }; - spacing = 0; - scroll = { - up = "#i3.prev"; - down = "#i3.next"; - }; - font = [ - "${config.kw.theme.font.name}:size=9;2" - "Font Awesome 5 Free Solid:size=9;2" - "Font Awesome 5 Free Brands:size=9;2" - ]; - padding = { - left = 1; - right = 1; - }; - separator = { - text = " "; - foreground = foreground_status; - }; - background = "#b219171c"; - foreground = foreground_alt; - border = { - bottom = { - size = 1; - color = background_light; - }; - }; - module-margin = 0; - #click-right = ""; menu of some sort? - }; - "module/i3" = mkIf config.xsession.windowManager.i3.enable { - type = "internal/i3"; - pin-workspaces = true; - strip-wsnumbers = true; - wrapping-scroll = false; - enable-scroll = false; # handled by bar instead - label = { - mode = { - padding = 2; - foreground = constant; - background = background_selection; - }; - focused = { - text = "%name%"; - padding = 2; - foreground = background_alt; - background = regex; - }; - unfocused = { - text = "%name%"; - padding = 2; - foreground = foreground_alt; - background = background_light; - }; - visible = { - text = "%name%"; - padding = 2; - foreground = foreground; - #background = background; - }; - urgent = { - text = "%name%"; - padding = 2; - foreground = foreground_status; - background = link; - }; - }; - }; - "module/title" = { - type = "internal/xwindow"; - label = { - text = "%title:0:50:%"; - padding = 1; - }; - format = { - text = "