From ebedec9768bffa8e4373112b62ef5d2d674fad32 Mon Sep 17 00:00:00 2001 From: Jacob Bachmann Date: Sat, 7 Sep 2024 15:10:22 +0200 Subject: [PATCH] feat: big refactor --- flake.lock | 84 +++++- flake.nix | 84 ++---- hosts/APPA/default.nix | 25 ++ hosts/APPA/hardware.nix | 78 ++++++ hosts/APPA/network.nix | 29 ++ hosts/APPA/services/adguard-home.nix | 73 +++++ hosts/APPA/services/default.nix | 9 + hosts/APPA/services/gitea.nix | 26 ++ hosts/APPA/services/homepage-dashboard.nix | 74 +++++ hosts/APPA/services/nginx.nix | 25 ++ hosts/APPA/services/postgresql.nix | 19 ++ hosts/{W530/default.nix => APPA/system.nix} | 38 +-- hosts/IROH/default.nix | 28 +- hosts/IROH/hardware.nix | 125 +++------ hosts/T430/default.nix | 28 +- hosts/T430/hardware.nix | 92 +++--- hosts/W530/hardware.nix | 83 ------ modules/aliases.nix | 36 --- modules/arr.nix | 24 -- modules/audio.nix | 35 --- modules/ausweisapp.nix | 6 - modules/bluetooth.nix | 8 - modules/ccache.nix | 5 - modules/core/applications.nix | 65 +++++ modules/core/audio.nix | 57 ++++ modules/core/bluetooth.nix | 17 ++ modules/core/common.nix | 33 +++ modules/core/default.nix | 89 ++++++ modules/{ => core}/keyd.nix | 4 +- modules/core/network.nix | 19 ++ modules/core/nvidia.nix | 17 ++ modules/core/power.nix | 55 ++++ modules/core/printing.nix | 38 +++ modules/{memtest86.nix => core/profiling.nix} | 3 +- modules/core/security.nix | 13 + modules/core/shell.nix | 44 +++ modules/core/virtualisation.nix | 32 +++ modules/dbus.nix | 6 - modules/default.nix | 159 +++-------- modules/desktop.nix | 69 ----- modules/desktop/applications.nix | 39 +++ modules/desktop/default.nix | 132 +++++++++ modules/{ => desktop}/fonts.nix | 8 +- modules/desktop/games.nix | 16 ++ modules/{ => desktop}/nautilus.nix | 12 +- modules/gstreamer.nix | 8 - modules/home-manager/applications.nix | 22 ++ .../home-manager}/audio.nix | 16 +- modules/home-manager/dconf.nix | 16 ++ modules/home-manager/default.nix | 57 ++++ .../modules => modules/home-manager}/git.nix | 9 +- .../home-manager}/gnupg.nix | 3 +- .../home-manager}/gui/common.nix | 3 +- .../home-manager}/gui/cursor.nix | 3 +- modules/home-manager/gui/default.nix | 13 + .../home-manager}/gui/gtk.nix | 5 +- .../home-manager}/gui/i3/autorandr.nix | 5 +- .../home-manager}/gui/i3/default.nix | 23 +- .../home-manager}/gui/i3/polybar.nix | 0 .../home-manager}/gui/i3/rofi.nix | 0 .../home-manager}/gui/programs/alacritty.nix | 13 +- .../gui/programs/chromium/default.nix | 4 - .../gui/programs/chromium/icons/LICENSE.md | 0 .../gui/programs/chromium/icons/chromium.png | Bin .../gui/programs/chromium/icons/outlook.png | Bin .../gui/programs/chromium/icons/spotify.png | Bin .../gui/programs/chromium/icons/teams.png | Bin .../gui/programs/chromium/icons/whatsapp.png | Bin modules/home-manager/gui/programs/default.nix | 62 ++++ .../home-manager}/gui/programs/discord.nix | 3 +- modules/home-manager/gui/programs/games.nix | 15 + .../home-manager}/gui/programs/keyring.nix | 9 +- .../home-manager}/gui/programs/kitty.nix | 13 +- .../home-manager}/gui/programs/obs.nix | 5 +- .../home-manager}/gui/programs/vscode.nix | 7 +- .../home-manager}/gui/programs/zathura.nix | 3 +- .../home-manager}/gui/sway/default.nix | 84 +++--- .../home-manager}/gui/sway/kanshi.nix | 4 +- .../home-manager}/gui/sway/swaync/config.json | 0 .../home-manager}/gui/sway/swaync/default.nix | 0 .../home-manager}/gui/sway/swaync/style.css | 0 .../home-manager}/gui/sway/swaync/swaync.nix | 0 .../home-manager}/gui/sway/wofi.nix | 5 +- .../home-manager}/gui/waybar.nix | 0 .../modules => modules/home-manager}/keyd.nix | 3 +- .../home-manager/neovim.nix | 16 +- .../home-manager}/scripts/default.nix | 7 +- .../home-manager}/scripts/git-clone-list.nix | 1 - .../home-manager}/scripts/nix-update.nix | 1 - modules/home-manager/scripts/pomodoro.nix | 19 ++ .../home-manager}/scripts/pootis.m4a | Bin modules/home-manager/shell.nix | 56 ++++ .../modules => modules/home-manager}/zsh.nix | 3 +- modules/i18n.nix | 14 - modules/kdeconnect.nix | 3 - modules/man.nix | 21 -- modules/network.nix | 12 - modules/nh.nix | 8 - modules/nix-ld.nix | 12 - modules/nix.nix | 28 -- modules/nvidia.nix | 11 - modules/ollama.nix | 6 - modules/opengl.nix | 16 -- modules/openssh.nix | 8 - modules/packages.nix | 64 ----- modules/power.nix | 14 - modules/printing.nix | 26 -- modules/ratbag.nix | 3 - modules/security.nix | 19 -- modules/services/default.nix | 6 + modules/services/flare-solvarr.nix | 26 ++ modules/services/jackett.nix | 12 + modules/services/syncthing.nix | 90 ++++++ modules/shell.nix | 22 -- modules/steam.nix | 10 - modules/syncthing.nix | 89 ------ modules/tts.nix | 17 -- modules/udisks2.nix | 6 - modules/virtualisation.nix | 36 --- modules/vpn.nix | 12 - modules/wine.nix | 5 - modules/xdg-portal.nix | 10 - overlays/fonts/iglesia-light.nix | 3 +- overlays/mfcl3750cdw.nix | 68 +++-- overlays/pppdf/default.nix | 7 +- secrets/passwords/gitea/db.age | Bin 0 -> 484 bytes secrets/secrets.nix | 23 ++ users/gandalf/default.nix | 32 --- users/gandalf/modules/dconf.nix | 13 - users/gandalf/modules/default.nix | 21 -- users/gandalf/modules/eza.nix | 7 - users/gandalf/modules/fzf.nix | 7 - users/gandalf/modules/gui/default.nix | 14 - .../gandalf/modules/gui/programs/default.nix | 58 ---- .../modules/gui/programs/flameshot/build.nix | 14 - .../gui/programs/flameshot/default.nix | 3 - .../gui/programs/flameshot/flameshot.nix | 5 - users/gandalf/modules/gui/programs/games.nix | 6 - users/gandalf/modules/lsd/dark.yaml | 41 --- users/gandalf/modules/lsd/default.nix | 16 -- users/gandalf/modules/lsd/light.yaml | 41 --- .../modules/neovim/config/.neoconf.json | 15 - users/gandalf/modules/neovim/config/LICENSE | 201 ------------- users/gandalf/modules/neovim/config/README.md | 4 - users/gandalf/modules/neovim/config/init.lua | 2 - .../neovim/config/lua/config/autocmds.lua | 3 - .../neovim/config/lua/config/keymaps.lua | 11 - .../modules/neovim/config/lua/config/lazy.lua | 60 ---- .../neovim/config/lua/config/options.lua | 6 - .../neovim/config/lua/plugins/example.lua | 265 ------------------ .../neovim/config/lua/plugins/mason.lua | 8 - .../neovim/config/lua/plugins/prisma.lua | 3 - .../gandalf/modules/neovim/config/stylua.toml | 3 - users/gandalf/modules/packages.nix | 25 -- users/gandalf/modules/scripts/pomodoro.nix | 23 -- users/gandalf/modules/ssh.nix | 15 - users/gandalf/modules/tmux.nix | 14 - users/gandalf/modules/xdg.nix | 16 -- users/gandalf/modules/yazi.nix | 13 - 159 files changed, 1927 insertions(+), 2222 deletions(-) create mode 100644 hosts/APPA/default.nix create mode 100644 hosts/APPA/hardware.nix create mode 100644 hosts/APPA/network.nix create mode 100644 hosts/APPA/services/adguard-home.nix create mode 100644 hosts/APPA/services/default.nix create mode 100644 hosts/APPA/services/gitea.nix create mode 100644 hosts/APPA/services/homepage-dashboard.nix create mode 100644 hosts/APPA/services/nginx.nix create mode 100644 hosts/APPA/services/postgresql.nix rename hosts/{W530/default.nix => APPA/system.nix} (50%) mode change 100755 => 100644 hosts/IROH/default.nix mode change 100755 => 100644 hosts/T430/default.nix delete mode 100644 hosts/W530/hardware.nix delete mode 100644 modules/aliases.nix delete mode 100644 modules/arr.nix delete mode 100644 modules/audio.nix delete mode 100644 modules/ausweisapp.nix delete mode 100644 modules/bluetooth.nix delete mode 100644 modules/ccache.nix create mode 100644 modules/core/applications.nix create mode 100644 modules/core/audio.nix create mode 100644 modules/core/bluetooth.nix create mode 100644 modules/core/common.nix create mode 100644 modules/core/default.nix rename modules/{ => core}/keyd.nix (95%) create mode 100644 modules/core/network.nix create mode 100644 modules/core/nvidia.nix create mode 100644 modules/core/power.nix create mode 100644 modules/core/printing.nix rename modules/{memtest86.nix => core/profiling.nix} (67%) create mode 100644 modules/core/security.nix create mode 100644 modules/core/shell.nix create mode 100644 modules/core/virtualisation.nix delete mode 100644 modules/dbus.nix delete mode 100644 modules/desktop.nix create mode 100644 modules/desktop/applications.nix create mode 100644 modules/desktop/default.nix rename modules/{ => desktop}/fonts.nix (73%) create mode 100644 modules/desktop/games.nix rename modules/{ => desktop}/nautilus.nix (65%) delete mode 100644 modules/gstreamer.nix create mode 100644 modules/home-manager/applications.nix rename {users/gandalf/modules => modules/home-manager}/audio.nix (68%) create mode 100644 modules/home-manager/dconf.nix create mode 100644 modules/home-manager/default.nix rename {users/gandalf/modules => modules/home-manager}/git.nix (70%) rename {users/gandalf/modules => modules/home-manager}/gnupg.nix (92%) rename {users/gandalf/modules => modules/home-manager}/gui/common.nix (98%) rename {users/gandalf/modules => modules/home-manager}/gui/cursor.nix (90%) create mode 100644 modules/home-manager/gui/default.nix rename {users/gandalf/modules => modules/home-manager}/gui/gtk.nix (93%) rename {users/gandalf/modules => modules/home-manager}/gui/i3/autorandr.nix (99%) rename {users/gandalf/modules => modules/home-manager}/gui/i3/default.nix (96%) rename {users/gandalf/modules => modules/home-manager}/gui/i3/polybar.nix (100%) rename {users/gandalf/modules => modules/home-manager}/gui/i3/rofi.nix (100%) rename {users/gandalf/modules => modules/home-manager}/gui/programs/alacritty.nix (88%) rename {users/gandalf/modules => modules/home-manager}/gui/programs/chromium/default.nix (99%) rename {users/gandalf/modules => modules/home-manager}/gui/programs/chromium/icons/LICENSE.md (100%) rename {users/gandalf/modules => modules/home-manager}/gui/programs/chromium/icons/chromium.png (100%) rename {users/gandalf/modules => modules/home-manager}/gui/programs/chromium/icons/outlook.png (100%) rename {users/gandalf/modules => modules/home-manager}/gui/programs/chromium/icons/spotify.png (100%) rename {users/gandalf/modules => modules/home-manager}/gui/programs/chromium/icons/teams.png (100%) rename {users/gandalf/modules => modules/home-manager}/gui/programs/chromium/icons/whatsapp.png (100%) create mode 100644 modules/home-manager/gui/programs/default.nix rename {users/gandalf/modules => modules/home-manager}/gui/programs/discord.nix (85%) create mode 100644 modules/home-manager/gui/programs/games.nix rename {users/gandalf/modules => modules/home-manager}/gui/programs/keyring.nix (62%) rename {users/gandalf/modules => modules/home-manager}/gui/programs/kitty.nix (88%) rename {users/gandalf/modules => modules/home-manager}/gui/programs/obs.nix (84%) rename {users/gandalf/modules => modules/home-manager}/gui/programs/vscode.nix (98%) rename {users/gandalf/modules => modules/home-manager}/gui/programs/zathura.nix (93%) rename {users/gandalf/modules => modules/home-manager}/gui/sway/default.nix (90%) rename {users/gandalf/modules => modules/home-manager}/gui/sway/kanshi.nix (99%) rename {users/gandalf/modules => modules/home-manager}/gui/sway/swaync/config.json (100%) rename {users/gandalf/modules => modules/home-manager}/gui/sway/swaync/default.nix (100%) rename {users/gandalf/modules => modules/home-manager}/gui/sway/swaync/style.css (100%) rename {users/gandalf/modules => modules/home-manager}/gui/sway/swaync/swaync.nix (100%) rename {users/gandalf/modules => modules/home-manager}/gui/sway/wofi.nix (95%) rename {users/gandalf/modules => modules/home-manager}/gui/waybar.nix (100%) rename {users/gandalf/modules => modules/home-manager}/keyd.nix (81%) rename users/gandalf/modules/neovim/default.nix => modules/home-manager/neovim.nix (91%) rename {users/gandalf/modules => modules/home-manager}/scripts/default.nix (67%) rename {users/gandalf/modules => modules/home-manager}/scripts/git-clone-list.nix (99%) rename {users/gandalf/modules => modules/home-manager}/scripts/nix-update.nix (99%) create mode 100644 modules/home-manager/scripts/pomodoro.nix rename {users/gandalf/modules => modules/home-manager}/scripts/pootis.m4a (100%) create mode 100644 modules/home-manager/shell.nix rename {users/gandalf/modules => modules/home-manager}/zsh.nix (98%) delete mode 100644 modules/i18n.nix delete mode 100644 modules/kdeconnect.nix delete mode 100644 modules/man.nix delete mode 100644 modules/network.nix delete mode 100644 modules/nh.nix delete mode 100644 modules/nix-ld.nix delete mode 100644 modules/nix.nix delete mode 100644 modules/nvidia.nix delete mode 100644 modules/ollama.nix delete mode 100644 modules/opengl.nix delete mode 100644 modules/openssh.nix delete mode 100644 modules/packages.nix delete mode 100644 modules/power.nix delete mode 100644 modules/printing.nix delete mode 100644 modules/ratbag.nix delete mode 100644 modules/security.nix create mode 100644 modules/services/default.nix create mode 100644 modules/services/flare-solvarr.nix create mode 100644 modules/services/jackett.nix create mode 100644 modules/services/syncthing.nix delete mode 100644 modules/shell.nix delete mode 100644 modules/steam.nix delete mode 100644 modules/syncthing.nix delete mode 100644 modules/tts.nix delete mode 100644 modules/udisks2.nix delete mode 100644 modules/virtualisation.nix delete mode 100644 modules/vpn.nix delete mode 100644 modules/wine.nix delete mode 100644 modules/xdg-portal.nix create mode 100644 secrets/passwords/gitea/db.age create mode 100644 secrets/secrets.nix delete mode 100644 users/gandalf/default.nix delete mode 100644 users/gandalf/modules/dconf.nix delete mode 100644 users/gandalf/modules/default.nix delete mode 100644 users/gandalf/modules/eza.nix delete mode 100644 users/gandalf/modules/fzf.nix delete mode 100644 users/gandalf/modules/gui/default.nix delete mode 100644 users/gandalf/modules/gui/programs/default.nix delete mode 100644 users/gandalf/modules/gui/programs/flameshot/build.nix delete mode 100644 users/gandalf/modules/gui/programs/flameshot/default.nix delete mode 100644 users/gandalf/modules/gui/programs/flameshot/flameshot.nix delete mode 100644 users/gandalf/modules/gui/programs/games.nix delete mode 100644 users/gandalf/modules/lsd/dark.yaml delete mode 100644 users/gandalf/modules/lsd/default.nix delete mode 100644 users/gandalf/modules/lsd/light.yaml delete mode 100644 users/gandalf/modules/neovim/config/.neoconf.json delete mode 100644 users/gandalf/modules/neovim/config/LICENSE delete mode 100644 users/gandalf/modules/neovim/config/README.md delete mode 100644 users/gandalf/modules/neovim/config/init.lua delete mode 100644 users/gandalf/modules/neovim/config/lua/config/autocmds.lua delete mode 100644 users/gandalf/modules/neovim/config/lua/config/keymaps.lua delete mode 100644 users/gandalf/modules/neovim/config/lua/config/lazy.lua delete mode 100644 users/gandalf/modules/neovim/config/lua/config/options.lua delete mode 100644 users/gandalf/modules/neovim/config/lua/plugins/example.lua delete mode 100644 users/gandalf/modules/neovim/config/lua/plugins/mason.lua delete mode 100644 users/gandalf/modules/neovim/config/lua/plugins/prisma.lua delete mode 100644 users/gandalf/modules/neovim/config/stylua.toml delete mode 100644 users/gandalf/modules/packages.nix delete mode 100644 users/gandalf/modules/scripts/pomodoro.nix delete mode 100644 users/gandalf/modules/ssh.nix delete mode 100644 users/gandalf/modules/tmux.nix delete mode 100644 users/gandalf/modules/xdg.nix delete mode 100644 users/gandalf/modules/yazi.nix diff --git a/flake.lock b/flake.lock index 9b3b003..d3a8366 100644 --- a/flake.lock +++ b/flake.lock @@ -1,6 +1,72 @@ { "nodes": { + "agenix": { + "inputs": { + "darwin": "darwin", + "home-manager": "home-manager", + "nixpkgs": [ + "nixpkgs" + ], + "systems": "systems" + }, + "locked": { + "lastModified": 1723293904, + "narHash": "sha256-b+uqzj+Wa6xgMS9aNbX4I+sXeb5biPDi39VgvSFqFvU=", + "owner": "ryantm", + "repo": "agenix", + "rev": "f6291c5935fdc4e0bef208cfc0dcab7e3f7a1c41", + "type": "github" + }, + "original": { + "owner": "ryantm", + "repo": "agenix", + "type": "github" + } + }, + "darwin": { + "inputs": { + "nixpkgs": [ + "agenix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1700795494, + "narHash": "sha256-gzGLZSiOhf155FW7262kdHo2YDeugp3VuIFb4/GGng0=", + "owner": "lnl7", + "repo": "nix-darwin", + "rev": "4b9b83d5a92e8c1fbfd8eb27eda375908c11ec4d", + "type": "github" + }, + "original": { + "owner": "lnl7", + "ref": "master", + "repo": "nix-darwin", + "type": "github" + } + }, "home-manager": { + "inputs": { + "nixpkgs": [ + "agenix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1703113217, + "narHash": "sha256-7ulcXOk63TIT2lVDSExj7XzFx09LpdSAPtvgtM7yQPE=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "3bfaacf46133c037bb356193bd2f1765d9dc82c1", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "home-manager", + "type": "github" + } + }, + "home-manager_2": { "inputs": { "nixpkgs": [ "nixpkgs" @@ -71,11 +137,27 @@ }, "root": { "inputs": { - "home-manager": "home-manager", + "agenix": "agenix", + "home-manager": "home-manager_2", "nixos-hardware": "nixos-hardware", "nixpkgs": "nixpkgs", "nixpkgs-unstable": "nixpkgs-unstable" } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } } }, "root": "root", diff --git a/flake.nix b/flake.nix index a4f1661..2b4a6f5 100644 --- a/flake.nix +++ b/flake.nix @@ -1,68 +1,40 @@ { - description = "Nix los hier"; + description = "nix los hier"; inputs = { nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05"; nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable"; - nixos-hardware.url = "github:NixOS/nixos-hardware/master"; - home-manager = { url = "github:nix-community/home-manager/release-24.05"; inputs.nixpkgs.follows = "nixpkgs"; }; - }; - outputs = { self, nixpkgs, ... }@inputs: { - nixosConfigurations = { - W530 = nixpkgs.lib.nixosSystem { - system = "x86_64-linux"; - specialArgs = inputs; - modules = [ - - ./modules - ./hosts/W530 - - inputs.home-manager.nixosModules.home-manager - - { - imports = [ ./users/gandalf ]; - } - - ]; - }; - T430 = nixpkgs.lib.nixosSystem { - system = "x86_64-linux"; - specialArgs = inputs; - modules = [ - - ./modules - ./hosts/T430 - - inputs.home-manager.nixosModules.home-manager - - { - imports = [ - ./users/gandalf - ]; - } - - ]; - }; - IROH = nixpkgs.lib.nixosSystem { - system = "x86_64-linux"; - specialArgs = inputs; - modules = [ - - ./modules - ./hosts/IROH - - inputs.home-manager.nixosModules.home-manager - - { - imports = [ ./users/gandalf ]; - } - - ]; - }; + agenix = { + url = "github:ryantm/agenix"; + inputs.nixpkgs.follows = "nixpkgs"; }; }; + outputs = + { nixpkgs, agenix, ... }@inputs: + let + mkSystem = host: { + "${host}" = nixpkgs.lib.nixosSystem rec { + system = "x86_64-linux"; + specialArgs = inputs; + modules = [ + (./hosts + "/${host}") + agenix.nixosModules.default + { environment.systemPackages = [ agenix.packages.${system}.default ]; } + ]; + }; + }; + in + { + nixosConfigurations = nixpkgs.lib.mergeAttrsList ( + nixpkgs.lib.forEach [ + "APPA" + "T430" + "IROH" + ] mkSystem + ); + }; } diff --git a/hosts/APPA/default.nix b/hosts/APPA/default.nix new file mode 100644 index 0000000..949ae4b --- /dev/null +++ b/hosts/APPA/default.nix @@ -0,0 +1,25 @@ +{ ... }@inputs: +{ + imports = [ + inputs.nixos-hardware.nixosModules.common-pc-laptop + inputs.nixos-hardware.nixosModules.common-pc-laptop-acpi_call + inputs.nixos-hardware.nixosModules.common-pc-laptop-ssd + ./services + ./hardware.nix + ./network.nix + ./system.nix + ../../modules + ]; + + bchmnn = { + git = { + signing = { + key = "0x7753026D577922A6"; + }; + }; + + collections = { + cli-utils.enable = true; + }; + }; +} diff --git a/hosts/APPA/hardware.nix b/hosts/APPA/hardware.nix new file mode 100644 index 0000000..e0601b7 --- /dev/null +++ b/hosts/APPA/hardware.nix @@ -0,0 +1,78 @@ +{ + config, + lib, + modulesPath, + ... +}: +{ + imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; + + boot.initrd.availableKernelModules = [ + "xhci_pci" + "ehci_pci" + "ahci" + "usb_storage" + "sd_mod" + "sdhci_pci" + ]; + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = { + device = "/dev/disk/by-label/ROOT"; + fsType = "btrfs"; + options = [ + "subvol=@" + "compress=zstd" + "noatime" + ]; + }; + + fileSystems."/nix" = { + device = "/dev/disk/by-label/ROOT"; + fsType = "btrfs"; + options = [ + "subvol=@nix" + "compress=zstd" + "noatime" + ]; + }; + + fileSystems."/boot" = { + device = "/dev/disk/by-label/EFI"; + fsType = "vfat"; + options = [ + "fmask=0022" + "dmask=0022" + ]; + }; + + fileSystems."/home" = { + device = "/dev/disk/by-label/HOME"; + fsType = "btrfs"; + options = [ + "subvol=@" + "compress=zstd" + "noatime" + ]; + }; + + fileSystems."/var/lib" = { + device = "/dev/disk/by-label/HOME"; + fsType = "btrfs"; + options = [ + "subvol=@varlib" + "compress=zstd" + "noatime" + ]; + }; + + swapDevices = [ ]; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/hosts/APPA/network.nix b/hosts/APPA/network.nix new file mode 100644 index 0000000..1aff028 --- /dev/null +++ b/hosts/APPA/network.nix @@ -0,0 +1,29 @@ +{ + networking = { + firewall.enable = true; + hostName = "APPA"; + useDHCP = false; + interfaces.enp0s25 = { + useDHCP = false; + ipv4.addresses = [ + { + address = "192.168.2.40"; + prefixLength = 24; + } + ]; + ipv6.addresses = [ + { + address = "fdd2:59e7:4ee1:1:2642:c13b:9bbc:7bd3"; + prefixLength = 64; + } + ]; + }; + defaultGateway = { + address = "192.168.2.1"; + }; + defaultGateway6 = { + address = "fdd2:59e7:4ee1:0001::1"; + interface = "enp0s25"; + }; + }; +} diff --git a/hosts/APPA/services/adguard-home.nix b/hosts/APPA/services/adguard-home.nix new file mode 100644 index 0000000..be9eb8a --- /dev/null +++ b/hosts/APPA/services/adguard-home.nix @@ -0,0 +1,73 @@ +{ config, ... }: +{ + services.adguardhome = { + enable = true; + mutableSettings = true; + allowDHCP = true; + host = "127.0.0.1"; + port = 8001; + settings = { + users = [ + { + name = "admin"; + password = "$2a$10$7FLDb/cr3SCtKiojXbFGnOjk6rWC0z9GMafV.YWMvewUcgua1eF/m"; + } + ]; + dns = { + ratelimit = 0; + }; + filtering = { + rewrites = [ + { + domain = "dryb.org"; + answer = "192.168.2.40"; + } + { + domain = "speedport.dryb.org"; + answer = "192.168.2.1"; + } + { + domain = "tplink.dryb.org"; + answer = "192.168.2.30"; + } + { + domain = "adguard.dryb.org"; + answer = "192.168.2.40"; + } + { + domain = config.services.gitea.domain; + answer = "192.168.2.40"; + } + ]; + }; + dhcp = { + enabled = true; + interface_name = "enp0s25"; + local_domain_name = "dryb.org"; + dhcpv4 = { + gateway_ip = "192.168.2.1"; + subnet_mask = "255.255.255.0"; + range_start = "192.168.2.100"; + range_end = "192.168.2.255"; + lease_duration = 86400; + icmp_timeout_msec = 1000; + }; + dhcpv6 = { + range_start = "fdd2::1"; + lease_duration = 86400; + ra_slaac_only = true; + ra_allow_slaac = true; + }; + }; + }; + }; + + networking.firewall = { + allowedTCPPorts = [ 53 ]; + allowedUDPPorts = [ + 53 + 67 + 547 + ]; + }; +} diff --git a/hosts/APPA/services/default.nix b/hosts/APPA/services/default.nix new file mode 100644 index 0000000..3ef8546 --- /dev/null +++ b/hosts/APPA/services/default.nix @@ -0,0 +1,9 @@ +{ + imports = [ + ./adguard-home.nix + ./gitea.nix + ./homepage-dashboard.nix + ./nginx.nix + ./postgresql.nix + ]; +} diff --git a/hosts/APPA/services/gitea.nix b/hosts/APPA/services/gitea.nix new file mode 100644 index 0000000..d3bb603 --- /dev/null +++ b/hosts/APPA/services/gitea.nix @@ -0,0 +1,26 @@ +{ config, ... }: +{ + age.secrets.passwords-gitea-db = { + file = ../../../secrets/passwords/gitea/db.age; + mode = "640"; + owner = config.services.gitea.user; + group = config.services.gitea.group; + }; + + services.gitea = rec { + enable = true; + appName = "dryb.org: Gitea Service"; + database = { + type = "postgres"; + passwordFile = config.age.secrets.passwords-gitea-db.path; + }; + domain = "git.dryb.org"; + rootUrl = "http://${domain}/"; + httpPort = 8003; + settings = { + service = { + DISABLE_REGISTRATION = true; + }; + }; + }; +} diff --git a/hosts/APPA/services/homepage-dashboard.nix b/hosts/APPA/services/homepage-dashboard.nix new file mode 100644 index 0000000..e74b985 --- /dev/null +++ b/hosts/APPA/services/homepage-dashboard.nix @@ -0,0 +1,74 @@ +{ + services.homepage-dashboard = { + enable = true; + listenPort = 8002; + settings = { + title = "dryb.org"; + layout = { + "Network" = { + style = "row"; + columns = 3; + }; + "IOT" = { + style = "row"; + columns = 3; + }; + }; + }; + services = [ + { + "Network" = [ + { + "Adguard Home" = { + description = "http://adguard.dryb.org"; + href = "http://adguard.dryb.org"; + icon = "adguard-home"; + }; + } + { + "Speedport Smart 4" = { + description = "https://speedport.dryb.org (192.168.2.1)"; + href = "https://speedport.dryb.org"; + icon = "mdi-router-network-wireless"; + }; + } + { + "TP-Link TL-SG1016DE" = { + description = "http://tplink.dryb.org (192.168.2.30)"; + href = "http://tplink.dryb.org"; + icon = "mdi-switch"; + }; + } + ]; + } + { + "IOT" = [ + { + "Shelly Infra" = { + description = "http://shelly-infra.dryb.org (192.168.2.50)"; + href = "http://shelly-infra.dryb.org"; + icon = "shelly"; + ping = "shelly-infra.dryb.org"; + }; + } + { + "Shelly Workstation" = { + description = "http://shelly-workstation.dryb.org (192.168.2.51)"; + href = "http://shelly-workstation.dryb.org"; + icon = "shelly"; + ping = "shelly-workstation.dryb.org"; + }; + } + { + "Shelly Test" = { + description = "http://shelly-test.dryb.org (192.168.2.52)"; + href = "http://shelly-test.dryb.org"; + icon = "shelly"; + ping = "shelly-test.dryb.org"; + }; + } + ]; + } + ]; + }; +} diff --git a/hosts/APPA/services/nginx.nix b/hosts/APPA/services/nginx.nix new file mode 100644 index 0000000..e1a401c --- /dev/null +++ b/hosts/APPA/services/nginx.nix @@ -0,0 +1,25 @@ +{ config, ... }: +{ + services.nginx = { + enable = true; + virtualHosts."dryb.org" = { + locations."/" = { + proxyPass = "http://127.0.0.1:8002"; + }; + }; + virtualHosts."adguard.dryb.org" = { + locations."/" = { + proxyPass = "http://127.0.0.1:8001"; + }; + }; + virtualHosts."${config.services.gitea.domain}" = { + locations."/" = { + proxyPass = "http://127.0.0.1:8003"; + }; + }; + }; + + networking.firewall = { + allowedTCPPorts = [ 80 ]; + }; +} diff --git a/hosts/APPA/services/postgresql.nix b/hosts/APPA/services/postgresql.nix new file mode 100644 index 0000000..30ec212 --- /dev/null +++ b/hosts/APPA/services/postgresql.nix @@ -0,0 +1,19 @@ +{ config, ... }: +{ + + services.postgresql = { + enable = true; + ensureDatabases = [ config.services.gitea.user ]; + + # type database DBuser auth-method mapping + authentication = '' + local gitea all ident map=gitea-users + ''; + + # name sysuser dbuser + identMap = '' + gitea-users gitea gitea + ''; + }; + +} diff --git a/hosts/W530/default.nix b/hosts/APPA/system.nix similarity index 50% rename from hosts/W530/default.nix rename to hosts/APPA/system.nix index 3b9f144..bb4efad 100644 --- a/hosts/W530/default.nix +++ b/hosts/APPA/system.nix @@ -1,16 +1,5 @@ -{ ... }@inputs: { - - imports = [ - ./hardware.nix - inputs.nixos-hardware.nixosModules.common-pc-laptop - inputs.nixos-hardware.nixosModules.common-pc-laptop-acpi_call - inputs.nixos-hardware.nixosModules.common-pc-laptop-ssd - ]; - - networking.hostName = "W530"; - +{ bchmnn = { - power = { tlp = { settings = { @@ -30,32 +19,7 @@ }; }; }; - - - gui = { - enable = true; - greeter.enable = false; - flavour = [ "sway" ]; - }; - nvidia.enable = false; - audio = { - enable = true; - pipewire-wine-fix.enable = false; - }; - bluetooth.enable = true; - printing.enable = true; - vpn.enable = true; - sync.enable = false; - - devenv.enable = true; - virtualisation.enable = true; - games.enable = false; - ratbag.enable = true; - - ai.enable = false; - }; services.logind.lidSwitch = "ignore"; - } diff --git a/hosts/IROH/default.nix b/hosts/IROH/default.nix old mode 100755 new mode 100644 index 191b599..6ee3d31 --- a/hosts/IROH/default.nix +++ b/hosts/IROH/default.nix @@ -1,17 +1,18 @@ -{ ... }@inputs: { +{ ... }@inputs: +{ imports = [ - ./hardware.nix inputs.nixos-hardware.nixosModules.common-cpu-intel inputs.nixos-hardware.nixosModules.common-pc inputs.nixos-hardware.nixosModules.common-pc-ssd inputs.nixos-hardware.nixosModules.common-gpu-nvidia-nonprime + ./hardware.nix + ../../modules ]; networking.hostName = "IROH"; bchmnn = { - gui = { enable = true; greeter.enable = false; @@ -24,16 +25,21 @@ }; bluetooth.enable = false; printing.enable = true; - vpn.enable = true; - sync.enable = true; - devenv.enable = true; - virtualisation.enable = true; - games.enable = true; - ratbag.enable = true; - - ai.enable = false; + collections = { + cli-utils.enable = true; + profiling.enable = true; + development.enable = true; + vpn.enable = true; + virtualisation.enable = true; + games.enable = true; + }; + services = { + flare-solvarr.enable = true; + jackett.enable = true; + syncthing.enable = true; + }; }; } diff --git a/hosts/IROH/hardware.nix b/hosts/IROH/hardware.nix index ad6a81d..156a40b 100644 --- a/hosts/IROH/hardware.nix +++ b/hosts/IROH/hardware.nix @@ -1,10 +1,27 @@ -{ config, lib, modulesPath, ... }: - +{ + config, + lib, + modulesPath, + ... +}: { imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; - boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod" ]; - boot.kernelModules = [ "kvm-intel" "nvidia" "nvidia_modeset" "nvidia_uvm" "nvidia_drm" ]; + boot.initrd.availableKernelModules = [ + "xhci_pci" + "ahci" + "nvme" + "usbhid" + "usb_storage" + "sd_mod" + ]; + boot.kernelModules = [ + "kvm-intel" + "nvidia" + "nvidia_modeset" + "nvidia_uvm" + "nvidia_drm" + ]; boot.loader.systemd-boot.enable = true; boot.loader.efi.canTouchEfiVariables = true; @@ -16,92 +33,42 @@ "resume_offset=533760" "nvidia_drm.modeset=1" "nvidia.NVreg_PreserveVideoMemoryAllocations=1" - # "intel_pstate=disable" ]; - /* - hardware.nvidia.package = - config.boot.kernelPackages.nvidiaPackages.mkDriver { - version = "555.52.04"; - sha256_64bit = "sha256-nVOubb7zKulXhux9AruUTVBQwccFFuYGWrU1ZiakRAI="; - sha256_aarch64 = "sha256-Kt60kTTO3mli66De2d1CAoE3wr0yUbBe7eqCIrYHcWk="; - openSha256 = "sha256-wDimW8/rJlmwr1zQz8+b1uvxxxbOf3Bpk060lfLKuy0="; - settingsSha256 = "sha256-PMh5efbSEq7iqEMBr2+VGQYkBG73TGUh6FuDHZhmwHk="; - persistencedSha256 = "sha256-KAYIvPjUVilQQcD04h163MHmKcQrn2a8oaXujL2Bxro="; - }; - */ - - /* - hardware.nvidia.package = - config.boot.kernelPackages.nvidiaPackages.mkDriver { - version = "560.28.03"; - sha256_64bit = "sha256-martv18vngYBJw1IFUCAaYr+uc65KtlHAMdLMdtQJ+Y="; - sha256_aarch64 = "sha256-+u0ZolZcZoej4nqPGmZn5qpyynLvu2QSm9Rd3wLdDmM="; - openSha256 = "sha256-asGpqOpU0tIO9QqceA8XRn5L27OiBFuI9RZ1NjSVwaM="; - settingsSha256 = "sha256-b4nhUMCzZc3VANnNb0rmcEH6H7SK2D5eZIplgPV59c8="; - persistencedSha256 = "sha256-MhITuC8tH/IPhCOUm60SrPOldOpitk78mH0rg+egkTE="; - }; - */ - - /* - hardware.nvidia.package = - let - rcu_patch = pkgs.fetchpatch { - url = "https://github.com/gentoo/gentoo/raw/c64caf53/x11-drivers/nvidia-drivers/files/nvidia-drivers-470.223.02-gpl-pfn_valid.patch"; - hash = "sha256-eZiQQp2S/asE7MfGvfe6dA/kdCvek9SYa/FFGp24dVg="; - }; - in - config.boot.kernelPackages.nvidiaPackages.mkDriver { - version = "535.154.05"; - sha256_64bit = "sha256-fpUGXKprgt6SYRDxSCemGXLrEsIA6GOinp+0eGbqqJg="; - sha256_aarch64 = "sha256-G0/GiObf/BZMkzzET8HQjdIcvCSqB1uhsinro2HLK9k="; - openSha256 = "sha256-wvRdHguGLxS0mR06P5Qi++pDJBCF8pJ8hr4T8O6TJIo="; - settingsSha256 = "sha256-9wqoDEWY4I7weWW05F4igj1Gj9wjHsREFMztfEmqm10="; - persistencedSha256 = "sha256-d0Q3Lk80JqkS1B54Mahu2yY/WocOqFFbZVBh+ToGhaE="; - patches = [ rcu_patch ]; - }; - */ - boot.resumeDevice = "/dev/disk/by-label/ROOT"; - fileSystems."/" = - { - device = "/dev/disk/by-label/ROOT"; - fsType = "btrfs"; - options = [ "subvol=@" ]; - }; + fileSystems."/" = { + device = "/dev/disk/by-label/ROOT"; + fsType = "btrfs"; + options = [ "subvol=@" ]; + }; - fileSystems."/nix" = - { - device = "/dev/disk/by-label/ROOT"; - fsType = "btrfs"; - options = [ "subvol=@nix" ]; - }; + fileSystems."/nix" = { + device = "/dev/disk/by-label/ROOT"; + fsType = "btrfs"; + options = [ "subvol=@nix" ]; + }; - fileSystems."/swap" = - { - device = "/dev/disk/by-label/ROOT"; - fsType = "btrfs"; - options = [ "subvol=@swap" ]; - }; + fileSystems."/swap" = { + device = "/dev/disk/by-label/ROOT"; + fsType = "btrfs"; + options = [ "subvol=@swap" ]; + }; - fileSystems."/boot" = - { - device = "/dev/disk/by-label/EFI"; - fsType = "vfat"; - }; + fileSystems."/boot" = { + device = "/dev/disk/by-label/EFI"; + fsType = "vfat"; + }; - fileSystems."/home" = - { - device = "/dev/disk/by-label/HOME"; - fsType = "btrfs"; - options = [ "subvol=@" ]; - }; + fileSystems."/home" = { + device = "/dev/disk/by-label/HOME"; + fsType = "btrfs"; + options = [ "subvol=@" ]; + }; - swapDevices = [{ device = "/swap/swapfile"; }]; + swapDevices = [ { device = "/swap/swapfile"; } ]; networking.useDHCP = lib.mkDefault true; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; } - diff --git a/hosts/T430/default.nix b/hosts/T430/default.nix old mode 100755 new mode 100644 index 69008bf..dc70f5a --- a/hosts/T430/default.nix +++ b/hosts/T430/default.nix @@ -1,17 +1,18 @@ -{ ... }@inputs: { +{ ... }@inputs: +{ imports = [ - ./hardware.nix inputs.nixos-hardware.nixosModules.lenovo-thinkpad-t430 inputs.nixos-hardware.nixosModules.common-pc-laptop inputs.nixos-hardware.nixosModules.common-pc-laptop-acpi_call inputs.nixos-hardware.nixosModules.common-pc-laptop-ssd + ./hardware.nix + ../../modules ]; networking.hostName = "T430"; bchmnn = { - gui = { enable = true; greeter.enable = false; @@ -24,16 +25,21 @@ }; bluetooth.enable = true; printing.enable = true; - vpn.enable = true; - sync.enable = true; - devenv.enable = true; - virtualisation.enable = true; - games.enable = true; - ratbag.enable = true; - - ai.enable = false; + collections = { + cli-utils.enable = true; + profiling.enable = true; + development.enable = true; + vpn.enable = true; + virtualisation.enable = true; + games.enable = true; + }; + services = { + flare-solvarr.enable = true; + jackett.enable = true; + syncthing.enable = true; + }; }; } diff --git a/hosts/T430/hardware.nix b/hosts/T430/hardware.nix index f90bcb7..625e0ed 100644 --- a/hosts/T430/hardware.nix +++ b/hosts/T430/hardware.nix @@ -1,9 +1,21 @@ -{ config, lib, modulesPath, ... }: - +{ + config, + lib, + modulesPath, + ... +}: { imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; - boot.initrd.availableKernelModules = [ "xhci_pci" "ehci_pci" "ahci" "usb_storage" "sd_mod" "sr_mod" "sdhci_pci" ]; + boot.initrd.availableKernelModules = [ + "xhci_pci" + "ehci_pci" + "ahci" + "usb_storage" + "sd_mod" + "sr_mod" + "sdhci_pci" + ]; boot.loader.systemd-boot.enable = true; boot.loader.efi.canTouchEfiVariables = true; @@ -11,47 +23,53 @@ boot.resumeDevice = "/dev/disk/by-label/ROOT"; boot.initrd.luks.devices."cryptlvm".device = "/dev/disk/by-uuid/b7a904b2-cceb-47fc-832a-701e386a95db"; - fileSystems."/" = - { - device = "/dev/disk/by-label/ROOT"; - fsType = "btrfs"; - options = [ "subvol=@" "compress=zstd" "noatime" ]; - }; + fileSystems."/" = { + device = "/dev/disk/by-label/ROOT"; + fsType = "btrfs"; + options = [ + "subvol=@" + "compress=zstd" + "noatime" + ]; + }; - fileSystems."/home" = - { - device = "/dev/disk/by-label/ROOT"; - fsType = "btrfs"; - options = [ "subvol=@home" "compress=zstd" "noatime" ]; - }; + fileSystems."/home" = { + device = "/dev/disk/by-label/ROOT"; + fsType = "btrfs"; + options = [ + "subvol=@home" + "compress=zstd" + "noatime" + ]; + }; - fileSystems."/nix" = - { - device = "/dev/disk/by-label/ROOT"; - fsType = "btrfs"; - options = [ "subvol=@nix" "compress=zstd" "noatime" ]; - }; + fileSystems."/nix" = { + device = "/dev/disk/by-label/ROOT"; + fsType = "btrfs"; + options = [ + "subvol=@nix" + "compress=zstd" + "noatime" + ]; + }; - fileSystems."/swap" = - { - device = "/dev/disk/by-label/ROOT"; - fsType = "btrfs"; - options = [ "subvol=@swap" "noatime" ]; - }; + fileSystems."/swap" = { + device = "/dev/disk/by-label/ROOT"; + fsType = "btrfs"; + options = [ + "subvol=@swap" + "noatime" + ]; + }; - fileSystems."/boot" = - { - device = "/dev/disk/by-label/EFI"; - fsType = "vfat"; - }; + fileSystems."/boot" = { + device = "/dev/disk/by-label/EFI"; + fsType = "vfat"; + }; - swapDevices = [{ - device = "/swap/swapfile"; - }]; + swapDevices = [ { device = "/swap/swapfile"; } ]; networking.useDHCP = lib.mkDefault true; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; } - - diff --git a/hosts/W530/hardware.nix b/hosts/W530/hardware.nix deleted file mode 100644 index adee462..0000000 --- a/hosts/W530/hardware.nix +++ /dev/null @@ -1,83 +0,0 @@ -{ config, lib, modulesPath, ... }: - -{ - imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; - - boot.initrd.availableKernelModules = [ "xhci_pci" "ehci_pci" "ahci" "firewire_ohci" "usb_storage" "sd_mod" "sr_mod" "sdhci_pci" ]; - boot.loader.systemd-boot.enable = true; - boot.loader.efi.canTouchEfiVariables = true; - - boot.kernelParams = [ "resume_offset=9364344" ]; - boot.resumeDevice = "/dev/disk/by-uuid/2e6bd7f5-74f0-4047-a0ab-5679b877a9fe"; - boot.initrd.luks.devices."cryptlvm".device = "/dev/disk/by-uuid/d04a2c58-4116-45d6-aa6e-2002556e6d22"; - - fileSystems."/" = - { - device = "/dev/disk/by-uuid/2e6bd7f5-74f0-4047-a0ab-5679b877a9fe"; - fsType = "btrfs"; - options = [ "subvol=@" "compress=zstd" "noatime" ]; - }; - - fileSystems."/home" = - { - device = "/dev/disk/by-uuid/2e6bd7f5-74f0-4047-a0ab-5679b877a9fe"; - fsType = "btrfs"; - options = [ "subvol=@home" "compress=zstd" "noatime" ]; - }; - - fileSystems."/root" = - { - device = "/dev/disk/by-uuid/2e6bd7f5-74f0-4047-a0ab-5679b877a9fe"; - fsType = "btrfs"; - options = [ "subvol=@root" "compress=zstd" "noatime" ]; - }; - - fileSystems."/srv" = - { - device = "/dev/disk/by-uuid/2e6bd7f5-74f0-4047-a0ab-5679b877a9fe"; - fsType = "btrfs"; - options = [ "subvol=@srv" "compress=zstd" "noatime" ]; - }; - - fileSystems."/var/log" = - { - device = "/dev/disk/by-uuid/2e6bd7f5-74f0-4047-a0ab-5679b877a9fe"; - fsType = "btrfs"; - options = [ "subvol=@log" "compress=zstd" "noatime" ]; - }; - - fileSystems."/var/cache" = - { - device = "/dev/disk/by-uuid/2e6bd7f5-74f0-4047-a0ab-5679b877a9fe"; - fsType = "btrfs"; - options = [ "subvol=@cache" "compress=zstd" "noatime" ]; - }; - - fileSystems."/tmp" = - { - device = "/dev/disk/by-uuid/2e6bd7f5-74f0-4047-a0ab-5679b877a9fe"; - fsType = "btrfs"; - options = [ "subvol=@tmp" "compress=zstd" "noatime" ]; - }; - - fileSystems."/swap" = - { - device = "/dev/disk/by-uuid/2e6bd7f5-74f0-4047-a0ab-5679b877a9fe"; - fsType = "btrfs"; - options = [ "subvol=@swap" "noatime" ]; - }; - - fileSystems."/boot" = - { - device = "/dev/disk/by-uuid/A410-7E4F"; - fsType = "vfat"; - }; - - swapDevices = [{ - device = "/swap/swapfile"; - }]; - - networking.useDHCP = lib.mkDefault true; - nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; - hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; -} diff --git a/modules/aliases.nix b/modules/aliases.nix deleted file mode 100644 index c2d9cf4..0000000 --- a/modules/aliases.nix +++ /dev/null @@ -1,36 +0,0 @@ -{ - - ls = "eza --group-directories-first --hyperlink --icons"; - la = "eza --group-directories-first --hyperlink --icons -la"; - lt = "eza --group-directories-first --hyperlink --icons -la --tree"; - llt = "unbuffer eza --group-directories-first --hyperlink --icons -la --tree | less -r"; - # ls = "lsd --color=auto --hyperlink=auto"; - # la = "lsd -lAh --group-directories-first --hyperlink=auto"; - # lt = "lsd -lAh --group-directories-first --tree --hyperlink=auto"; - # llt = "unbuffer lsd -lAh --group-directories-first --tree --hyperlink=auto | less -r"; - - gg = "cd ~/code"; - # gs = "git status"; - gl = "git log --oneline"; - glg = "git log --oneline --graph --decorate --all"; - gaa = "git add --all"; - gc = "git commit -m"; - gp = "git push"; - - ta = "tmux attach"; - - nec = "nvim --cmd \"cd $(readlink -f /etc/nixos)\""; - ncc = "sudo nixos-rebuild switch --upgrade-all --flake \"$(readlink -f /etc/nixos)\""; - nup = "sudo nix-channel --update"; - ngc = "sudo nix-collect-garbage -d"; - - dcup = "docker-compose up --detach --remove-orphans"; - dka = "docker kill $(docker ps -q)"; - drmc = "docker container rm $(docker container ls -aq)"; - drmi = "docker image rm $(docker image ls -aq)"; - drmv = "docker volume rm $(docker volume ls -q)"; - - lsip = "curl -s 'https://nordvpn.com/wp-admin/admin-ajax.php?action=get_user_info_data' | jq"; - xo = "xdg-open"; - y = "yazi"; -} diff --git a/modules/arr.nix b/modules/arr.nix deleted file mode 100644 index 78a48ae..0000000 --- a/modules/arr.nix +++ /dev/null @@ -1,24 +0,0 @@ -{ - services.jackett = { - enable = true; - }; - - virtualisation = { - oci-containers = { - containers = { - flare-solvarr = { - image = "ghcr.io/flaresolverr/flaresolverr:latest"; - autoStart = true; - ports = [ "127.0.0.1:8191:8191" ]; - environment = { - LOG_LEVEL = "info"; - LOG_HTML = "false"; - CAPTCHA_SOLVER = "hcaptcha-solver"; - TZ = "Europe/Berlin"; - }; - }; - }; - }; - }; - -} diff --git a/modules/audio.nix b/modules/audio.nix deleted file mode 100644 index b91e60a..0000000 --- a/modules/audio.nix +++ /dev/null @@ -1,35 +0,0 @@ -{ pkgs, config, lib, ... }: lib.mkIf config.bchmnn.audio.enable { - services.pipewire = lib.mkIf (!builtins.elem "gnome" config.bchmnn.gui.flavour) { - enable = true; - audio.enable = true; - pulse.enable = true; - alsa.enable = true; - alsa.support32Bit = true; - jack.enable = true; - wireplumber.enable = true; - extraConfig.pipewire = lib.mkIf config.bchmnn.audio.pipewire-wine-fix.enable { - "90-wine-config" = { - "context.properties" = { - # "default.clock.rate" = 48000; - "default.clock.allowed-rates" = [ 44100 48000 ]; - # "default.clock.quantum" = 2048; - # "default.clock.min-quantum" = 1024; - }; - }; - }; - extraConfig.pipewire-pulse = lib.mkIf config.bchmnn.audio.pipewire-wine-fix.enable { - "90-wine-config" = { - "pulse.properties" = { - "pulse.min.req" = "1024/48000"; - # "pulse.min.frag" = "1024/48000"; - # "pulse.min.quantum" = "1024/48000"; - }; - }; - }; - }; - - environment.systemPackages = with pkgs; [ - alsa-utils - pulseaudio - ]; -} diff --git a/modules/ausweisapp.nix b/modules/ausweisapp.nix deleted file mode 100644 index 5e9f655..0000000 --- a/modules/ausweisapp.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ config, lib, ... }: lib.mkIf config.bchmnn.gui.enable { - programs.ausweisapp = { - enable = true; - openFirewall = true; - }; -} diff --git a/modules/bluetooth.nix b/modules/bluetooth.nix deleted file mode 100644 index 49e0579..0000000 --- a/modules/bluetooth.nix +++ /dev/null @@ -1,8 +0,0 @@ -{ config, lib, ... }: lib.mkIf config.bchmnn.bluetooth.enable { - hardware.bluetooth = { - enable = true; - powerOnBoot = true; - }; - - services.blueman.enable = true; -} diff --git a/modules/ccache.nix b/modules/ccache.nix deleted file mode 100644 index bdfbaef..0000000 --- a/modules/ccache.nix +++ /dev/null @@ -1,5 +0,0 @@ -{ - programs.ccache = { - enable = true; - }; -} diff --git a/modules/core/applications.nix b/modules/core/applications.nix new file mode 100644 index 0000000..8d1efae --- /dev/null +++ b/modules/core/applications.nix @@ -0,0 +1,65 @@ +{ + pkgs, + config, + lib, + ... +}: +{ + + environment.systemPackages = + lib.optionals config.bchmnn.collections.cli-utils.enable [ + pkgs.pciutils # a collection of programs for inspecting and manipulating configuration of pci devices + pkgs.usbutils # tools for working with usb devices, such as lsusb + pkgs.lshw # provide detailed information on the hardware configuration of the machine + pkgs.git # distributed version control system + pkgs.gnumake # a tool to control the generation of non-source files from sources + pkgs.parallel # shell tool for executing jobs in parallel + pkgs.mercurial # a fast, lightweight scm system for very large distributed projects + pkgs.wget # tool for retrieving files using http, https, and ftp + pkgs.unstable.neovim-unwrapped # vim text editor fork focused on extensibility and agility + pkgs.neofetch # a fast, highly customizable system info script + pkgs.eza # a modern, maintained replacement for ls + pkgs.ripgrep # a utility that combines the usability of the silver searcher with the raw speed of grep + pkgs.ripgrep-all # ripgrep, but also search in pdfs, e-books, office documents, zip, tar.gz, and more + pkgs.expect # a tool for automating interactive applications + pkgs.jq # a lightweight and flexible command-line json processor + pkgs.unzip # an extraction utility for archives compressed in .zip format + pkgs.unrar # utility for rar archives + pkgs.libsecret # a library for storing and retrieving passwords and other secrets + pkgs.xidel # command line tool to download and extract data from html/xml pages as well as json apis + pkgs.nvd # nix/nixos package version diff tool + pkgs.inotify-tools # a c library and a set of command-line programs providing a simple interface to inotify + pkgs.mkcert # a simple tool for making locally-trusted development certificates + pkgs.hexedit + ] + ++ lib.optionals (config.bchmnn.collections.cli-utils.enable && config.bchmnn.nvidia.enable) [ + pkgs.nvtopPackages.full + ] + ++ lib.optionals config.bchmnn.collections.development.enable [ + pkgs.gcc13 + pkgs.clang + pkgs.universal-ctags # a maintained ctags implementation + pkgs.rustc + pkgs.cargo # downloads your rust project's dependencies and builds your project + pkgs.go # go programming language + (pkgs.python312.withPackages ( + p: with p; [ + ptpython # an advanced python repl + ipython # ipython: productive interactive computing + pycryptodome # self-contained cryptographic library + gmpy2 # interface to gmp, mpfr, and mpc for python 3.7+ + ] + )) + pkgs.lua + pkgs.nixpkgs-fmt + pkgs.openjdk17 + pkgs.javaPackages.openjfx17 + pkgs.gradle_7 + pkgs.maven + pkgs.ant + pkgs.nodejs_20 + pkgs.nodenv + pkgs.nodePackages.yarn + pkgs.nodePackages.pnpm + ]; +} diff --git a/modules/core/audio.nix b/modules/core/audio.nix new file mode 100644 index 0000000..4f0c948 --- /dev/null +++ b/modules/core/audio.nix @@ -0,0 +1,57 @@ +{ + pkgs, + config, + lib, + ... +}: +{ + options.bchmnn = { + audio = { + enable = lib.mkEnableOption "audio"; + pipewire-wine-fix = { + enable = lib.mkEnableOption "pipewire-wine-fix"; + }; + }; + }; + + config = { + services.pipewire = + lib.mkIf (config.bchmnn.audio.enable && (!builtins.elem "gnome" config.bchmnn.gui.flavour)) + { + enable = true; + audio.enable = true; + pulse.enable = true; + alsa.enable = true; + alsa.support32Bit = true; + jack.enable = true; + wireplumber.enable = true; + extraConfig.pipewire = lib.mkIf config.bchmnn.audio.pipewire-wine-fix.enable { + "90-wine-config" = { + "context.properties" = { + # "default.clock.rate" = 48000; + "default.clock.allowed-rates" = [ + 44100 + 48000 + ]; + # "default.clock.quantum" = 2048; + # "default.clock.min-quantum" = 1024; + }; + }; + }; + extraConfig.pipewire-pulse = lib.mkIf config.bchmnn.audio.pipewire-wine-fix.enable { + "90-wine-config" = { + "pulse.properties" = { + "pulse.min.req" = "1024/48000"; + # "pulse.min.frag" = "1024/48000"; + # "pulse.min.quantum" = "1024/48000"; + }; + }; + }; + }; + + environment.systemPackages = lib.optionals config.bchmnn.audio.enable [ + pkgs.alsa-utils + pkgs.pulseaudio + ]; + }; +} diff --git a/modules/core/bluetooth.nix b/modules/core/bluetooth.nix new file mode 100644 index 0000000..e2ab57a --- /dev/null +++ b/modules/core/bluetooth.nix @@ -0,0 +1,17 @@ +{ config, lib, ... }: +{ + options.bchmnn = { + bluetooth = { + enable = lib.mkEnableOption "bluetooth"; + }; + }; + + config = lib.mkIf config.bchmnn.bluetooth.enable { + hardware.bluetooth = { + enable = true; + powerOnBoot = true; + }; + + services.blueman.enable = true; + }; +} diff --git a/modules/core/common.nix b/modules/core/common.nix new file mode 100644 index 0000000..e6af69f --- /dev/null +++ b/modules/core/common.nix @@ -0,0 +1,33 @@ +{ + aliases = { + ls = "eza --group-directories-first --hyperlink --icons"; + la = "eza --group-directories-first --hyperlink --icons -la"; + lt = "eza --group-directories-first --hyperlink --icons -la --tree"; + llt = "unbuffer eza --group-directories-first --hyperlink --icons -la --tree | less -r"; + + gg = "cd ~/code"; + # gs = "git status"; + gl = "git log --oneline"; + glg = "git log --oneline --graph --decorate --all"; + gaa = "git add --all"; + gc = "git commit -m"; + gp = "git push"; + + ta = "tmux attach"; + + nec = "nvim --cmd \"cd $(readlink -f /etc/nixos)\""; + ncc = "sudo nixos-rebuild switch --upgrade-all --flake \"$(readlink -f /etc/nixos)\""; + nup = "sudo nix-channel --update"; + ngc = "sudo nix-collect-garbage -d"; + + dcup = "docker-compose up --detach --remove-orphans"; + dka = "docker kill $(docker ps -q)"; + drmc = "docker container rm $(docker container ls -aq)"; + drmi = "docker image rm $(docker image ls -aq)"; + drmv = "docker volume rm $(docker volume ls -q)"; + + lsip = "curl -s 'https://nordvpn.com/wp-admin/admin-ajax.php?action=get_user_info_data' | jq"; + xo = "xdg-open"; + y = "yazi"; + }; +} diff --git a/modules/core/default.nix b/modules/core/default.nix new file mode 100644 index 0000000..b4d0c2b --- /dev/null +++ b/modules/core/default.nix @@ -0,0 +1,89 @@ +{ pkgs, ... }@inputs: +{ + imports = [ + ./applications.nix + ./audio.nix + ./bluetooth.nix + ./keyd.nix + ./network.nix + ./nvidia.nix + ./power.nix + ./printing.nix + ./profiling.nix + ./security.nix + ./shell.nix + ./virtualisation.nix + ]; + + nix = { + settings = { + experimental-features = [ + "nix-command" + "flakes" + ]; + auto-optimise-store = true; + }; + }; + + nixpkgs = { + overlays = [ + (self: super: { + unstable = import inputs.nixpkgs-unstable { system = super.system; }; + mfcl3750cdwlpr = (super.callPackage ../../overlays/mfcl3750cdw.nix { }).driver; + mfcl3750cdwcupswrapper = (super.callPackage ../../overlays/mfcl3750cdw.nix { }).cupswrapper; + pppdf = (super.python3Packages.callPackage ../../overlays/pppdf { }); + iglesia-light = (super.callPackage ../../overlays/fonts/iglesia-light.nix { }); + }) + ]; + config = { + allowUnfree = true; + allowUnfreePredicate = (_: true); + }; + }; + + # provide libraries for non-nix binaries + # programs.nix-ld = { + # enable = true; + # libraries = [ + # # glibc + # # libcxx + # # libllvm + # # ncurses + # ]; + # }; + + system.stateVersion = "23.05"; + + time.timeZone = "Europe/Berlin"; + + i18n = { + defaultLocale = "en_US.UTF-8"; + supportedLocales = [ + "en_US.UTF-8/UTF-8" + "de_DE.UTF-8/UTF-8" + ]; + }; + + console = { + font = "Lat2-Terminus16"; + keyMap = "us"; + }; + + programs.dconf.enable = true; + services.dbus = { + enable = true; + packages = with pkgs; [ + gcr # gnome crypto services (daemon and tools) + dconf + ]; + }; + + programs.ccache = { + enable = true; + }; + + services.openssh = { + enable = true; + openFirewall = true; + }; +} diff --git a/modules/keyd.nix b/modules/core/keyd.nix similarity index 95% rename from modules/keyd.nix rename to modules/core/keyd.nix index f3b36c0..9625d6d 100644 --- a/modules/keyd.nix +++ b/modules/core/keyd.nix @@ -27,9 +27,7 @@ let }; in { - environment.systemPackages = with pkgs; [ - keyd - ]; + environment.systemPackages = with pkgs; [ keyd ]; # Enable keyd and remap keys services.keyd = { enable = true; diff --git a/modules/core/network.nix b/modules/core/network.nix new file mode 100644 index 0000000..bfe5dba --- /dev/null +++ b/modules/core/network.nix @@ -0,0 +1,19 @@ +{ + config, + lib, + pkgs, + ... +}: +{ + networking.networkmanager.enable = true; + systemd.services = { + NetworkManager-wait-online.enable = false; + }; + environment.systemPackages = lib.optionals (config.bchmnn.collections.vpn.enable) [ + pkgs.openvpn3 + pkgs.mullvad-vpn + pkgs.wireguard-tools # tools for the wireguard secure network tunnel + ]; + services.mullvad-vpn.enable = config.bchmnn.collections.vpn.enable; + services.tailscale.enable = config.bchmnn.collections.vpn.enable; +} diff --git a/modules/core/nvidia.nix b/modules/core/nvidia.nix new file mode 100644 index 0000000..aadadfe --- /dev/null +++ b/modules/core/nvidia.nix @@ -0,0 +1,17 @@ +{ config, lib, ... }: +{ + options.bchmnn = { + nvidia = { + enable = lib.mkEnableOption "nvidia"; + }; + }; + + config = lib.mkIf config.bchmnn.nvidia.enable { + services.xserver.videoDrivers = [ "nvidia" ]; + hardware.nvidia = { + modesetting.enable = true; + powerManagement.enable = true; + nvidiaSettings = true; + }; + }; +} diff --git a/modules/core/power.nix b/modules/core/power.nix new file mode 100644 index 0000000..9ff432a --- /dev/null +++ b/modules/core/power.nix @@ -0,0 +1,55 @@ +{ + pkgs, + lib, + config, + ... +}: +{ + + options.bchmnn = { + + power = { + tlp = { + settings = lib.mkOption { + type = + with lib.types; + attrsOf (oneOf [ + bool + int + float + str + (listOf str) + ]); + default = { + # performance | powersave + CPU_SCALING_GOVERNOR_ON_AC = "performance"; + CPU_SCALING_GOVERNOR_ON_BAT = "powersave"; + # performance | balance_performance | default | balance_power | power + CPU_ENERGY_PERF_POLICY_ON_AC = "performance"; + CPU_ENERGY_PERF_POLICY_ON_BAT = "power"; + # performance | balanced | low-power + PLATFORM_PROFILE_ON_AC = "performance"; + PLATFORM_PROFILE_ON_BAT = "low-power"; + CPU_MIN_PERF_ON_AC = 0; + CPU_MAX_PERF_ON_AC = 100; + CPU_MIN_PERF_ON_BAT = 0; + CPU_MAX_PERF_ON_BAT = 100; + }; + }; + }; + }; + }; + + config = { + powerManagement = { + enable = true; + }; + + services.tlp = { + enable = !builtins.elem "gnome" config.bchmnn.gui.flavour; + settings = config.bchmnn.power.tlp.settings; + }; + + environment.systemPackages = with pkgs; [ powertop ]; + }; +} diff --git a/modules/core/printing.nix b/modules/core/printing.nix new file mode 100644 index 0000000..d3d1bf7 --- /dev/null +++ b/modules/core/printing.nix @@ -0,0 +1,38 @@ +{ + pkgs, + lib, + config, + ... +}: +{ + options.bchmnn = { + printing = { + enable = lib.mkEnableOption "printing"; + }; + }; + + config = lib.mkIf config.bchmnn.printing.enable { + services.printing = { + enable = true; + drivers = [ pkgs.mfcl3750cdwcupswrapper ]; + }; + + services.avahi = { + enable = true; + nssmdns4 = true; + openFirewall = true; + }; + + hardware.printers = { + ensurePrinters = [ + { + name = "Brother-MFC-L3750CDW-series"; + location = "Home"; + deviceUri = "dnssd://Brother%20MFC-L3750CDW%20series._ipp._tcp.local/?uuid=e3248000-80ce-11db-8000-b4220094c09b"; + model = "brother_mfcl3750cdw_printer_en.ppd"; + } + ]; + ensureDefaultPrinter = "Brother-MFC-L3750CDW-series"; + }; + }; +} diff --git a/modules/memtest86.nix b/modules/core/profiling.nix similarity index 67% rename from modules/memtest86.nix rename to modules/core/profiling.nix index 184d002..39ffb9b 100644 --- a/modules/memtest86.nix +++ b/modules/core/profiling.nix @@ -1,4 +1,5 @@ -{ config, ... }: { +{ config, lib, ... }: +lib.mkIf config.bchmnn.collections.profiling.enable { boot.loader.systemd-boot.memtest86.enable = config.boot.loader.systemd-boot.enable; boot.loader.grub.memtest86.enable = config.boot.loader.grub.enable; } diff --git a/modules/core/security.nix b/modules/core/security.nix new file mode 100644 index 0000000..bbd206d --- /dev/null +++ b/modules/core/security.nix @@ -0,0 +1,13 @@ +{ config, lib, ... }: +{ + security.polkit.enable = true; + security.rtkit.enable = true; + networking.firewall = { + enable = true; + allowedTCPPorts = lib.optionals (config.bchmnn.collections.development.enable) [ + 3000 + 6969 + 8080 + ]; + }; +} diff --git a/modules/core/shell.nix b/modules/core/shell.nix new file mode 100644 index 0000000..890d44d --- /dev/null +++ b/modules/core/shell.nix @@ -0,0 +1,44 @@ +{ pkgs, ... }: +let + common = import ./common.nix; +in +{ + programs.zsh = { + enable = true; + }; + + users.users.gandalf = { + shell = pkgs.zsh; + }; + + environment = { + shellAliases = common.aliases; + }; + + programs = { + htop.enable = true; + iftop.enable = true; + }; + + documentation = { + enable = true; + doc.enable = true; + dev.enable = true; + man = { + enable = true; + generateCaches = true; + man-db.enable = true; + }; + + }; + + environment.systemPackages = with pkgs; [ + man-pages + man-pages-posix + ncurses + ]; + + programs.nh = { + enable = true; + }; +} diff --git a/modules/core/virtualisation.nix b/modules/core/virtualisation.nix new file mode 100644 index 0000000..3c8ee10 --- /dev/null +++ b/modules/core/virtualisation.nix @@ -0,0 +1,32 @@ +{ + config, + lib, + pkgs, + ... +}: +lib.mkIf config.bchmnn.collections.virtualisation.enable { + virtualisation = { + libvirtd.enable = true; + /* + podman = { + enable = true; + # create a `docker` alias for podman, to use it as a drop-in replacement + dockerCompat = true; + # required for containers under podman-compose to be able to talk to each other. + defaultNetwork.settings.dns_enabled = true; + }; + */ + docker = { + enable = true; + }; + oci-containers = { + backend = "docker"; + # backend = "podman"; + }; + containers = { + enable = true; + }; + }; + hardware.nvidia-container-toolkit.enable = config.bchmnn.nvidia.enable; + environment.systemPackages = with pkgs; [ virtiofsd ]; +} diff --git a/modules/dbus.nix b/modules/dbus.nix deleted file mode 100644 index 4efb5ff..0000000 --- a/modules/dbus.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ pkgs, ... }: { - services.dbus = { - enable = true; - packages = with pkgs; [ gcr dconf ]; - }; -} diff --git a/modules/default.nix b/modules/default.nix index fc887a3..374ed82 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -1,133 +1,54 @@ -{ lib, ... }: { - - # options affecting multiple modules +{ lib, ... }: +{ options.bchmnn = with lib; { + user = { + extraGroups = mkOption { + type = types.listOf types.str; + default = [ + "wheel" + "networkmanager" + "libvirtd" + "docker" + "wireshark" + ]; + }; + }; - power = { - tlp = { - settings = mkOption { - type = with types; attrsOf (oneOf [ bool int float str (listOf str) ]); - default = { - # performance | powersave - CPU_SCALING_GOVERNOR_ON_AC = "performance"; - CPU_SCALING_GOVERNOR_ON_BAT = "powersave"; - # performance | balance_performance | default | balance_power | power - CPU_ENERGY_PERF_POLICY_ON_AC = "performance"; - CPU_ENERGY_PERF_POLICY_ON_BAT = "power"; - # performance | balanced | low-power - PLATFORM_PROFILE_ON_AC = "performance"; - PLATFORM_PROFILE_ON_BAT = "low-power"; - CPU_MIN_PERF_ON_AC = 0; - CPU_MAX_PERF_ON_AC = 100; - CPU_MIN_PERF_ON_BAT = 0; - CPU_MAX_PERF_ON_BAT = 100; - }; + git = { + signing = { + key = mkOption { + type = types.str; + default = "732A612DAD28067D"; }; }; }; - - gui = { - enable = mkEnableOption "gui"; - greeter = { - enable = mkEnableOption "greeter"; + collections = { + cli-utils = { + enable = mkEnableOption "cli-utils"; }; - flavour = mkOption { - type = types.listOf types.str; - default = [ "sway" ]; - example = [ "sway" "i3" ]; - description = '' - The flavour (WM) for your system to use - ''; + profiling = { + enable = mkEnableOption "profiling"; + }; + development = { + enable = mkEnableOption "development"; + }; + vpn = { + enable = mkEnableOption "vpn"; + }; + virtualisation = { + enable = mkEnableOption "virtualisation"; + }; + games = { + enable = mkEnableOption "games"; }; }; - - nvidia = { - enable = mkEnableOption "nvidia"; - }; - - audio = { - enable = mkEnableOption "audio"; - pipewire-wine-fix = { - enable = mkEnableOption "pipewire-wine-fix"; - }; - }; - - bluetooth = { - enable = mkEnableOption "bluetooth"; - }; - - printing = { - enable = mkEnableOption "printing"; - }; - - vpn = { - enable = mkEnableOption "vpn"; - }; - - sync = { - enable = mkEnableOption "sync"; - }; - - devenv = { - enable = mkEnableOption "devenv"; - }; - - virtualisation = { - enable = mkEnableOption "virtualisation"; - }; - - games = { - enable = mkEnableOption "games"; - }; - - ai = { - enable = mkEnableOption "ai"; - }; - - ratbag = { - enable = mkEnableOption "ratbag"; - }; - }; imports = [ - ./arr.nix - ./audio.nix - ./ausweisapp.nix - ./bluetooth.nix - ./ccache.nix - ./desktop.nix - ./dbus.nix - ./fonts.nix - ./gstreamer.nix - ./i18n.nix - ./kdeconnect.nix - ./keyd.nix - ./man.nix - ./memtest86.nix - ./nautilus.nix - ./network.nix - ./nh.nix - ./nix-ld.nix - ./nix.nix - ./nvidia.nix - ./ollama.nix - ./opengl.nix - ./openssh.nix - ./power.nix - ./packages.nix - ./printing.nix - ./ratbag.nix - ./security.nix - ./shell.nix - ./steam.nix - ./syncthing.nix - ./tts.nix - ./udisks2.nix - ./virtualisation.nix - ./vpn.nix - ./wine.nix - ./xdg-portal.nix + ./core + ./desktop + ./home-manager + ./services ]; } diff --git a/modules/desktop.nix b/modules/desktop.nix deleted file mode 100644 index d644e02..0000000 --- a/modules/desktop.nix +++ /dev/null @@ -1,69 +0,0 @@ -{ lib, pkgs, config, ... }: with config.bchmnn; lib.mkIf (gui.enable && gui.flavour != [ ]) { - - environment.pathsToLink = [ "/libexec" ]; # links /libexec from derivations to /run/current-system/sw - - programs.sway.enable = builtins.elem "sway" gui.flavour; - services.xserver.windowManager.i3.enable = builtins.elem "i3" gui.flavour; - - services.libinput.enable = true; - - services.xserver = { - enable = (builtins.elem "i3" gui.flavour || builtins.elem "gnome" gui.flavour); - desktopManager.gnome.enable = builtins.elem "gnome" gui.flavour; - displayManager = { - gdm.enable = builtins.elem "gnome" gui.flavour; - startx.enable = builtins.elem "i3" gui.flavour; - }; - }; - - environment.systemPackages = with pkgs; [ - (writeShellScriptBin "sway-run" '' - export WLR_NO_HARDWARE_CURSORS=1 - exec ${sway}/bin/sway "$@" - '') - ]; - - environment = { - etc = { - "greetd/environments".text = (lib.strings.concatLines gui.flavour); - "greetd/kanshi-config".text = '' - profile nomad { - output "LVDS-1" enable - } - profile iroh { - output "DP-3" enable mode 2560x1440 position 0,0 - output "DP-2" enable mode 2560x1440 position 2560,0 - output "DP-1" enable mode 2560x1440 position 5120,0 - } - profile station { - output "LVDS-1" disable - output "Dell Inc. DELL U2515H 9X2VY5490XUL" enable mode 1920x1080 position 0,0 - output "Dell Inc. DELL U2515H 9X2VY5C7138L" enable mode 1920x1080 position 1920,0 - output "HJW VGA TO HDMI 0x00000100" enable mode 1920x1080 position 3840,0 - } - ''; - "greetd/sway-config".text = '' - exec "${pkgs.kanshi}/bin/kanshi --config /etc/greetd/kanshi-config" - exec "${pkgs.greetd.gtkgreet}/bin/gtkgreet -l; swaymsg exit" - - bindsym Mod4+shift+e exec swaynag \ - -t warning \ - -m 'What do you want to do?' \ - -b 'Poweroff' 'systemctl poweroff' \ - -b 'Reboot' 'systemctl reboot' - - include /etc/sway/config.d/* - ''; - }; - }; - - services.greetd = { - enable = gui.greeter.enable; - settings = { - default_session = { - command = "sway-run --config /etc/greetd/sway-config" + lib.optionalString nvidia.enable " --unsupported-gpu"; - }; - }; - }; - -} diff --git a/modules/desktop/applications.nix b/modules/desktop/applications.nix new file mode 100644 index 0000000..8f953d7 --- /dev/null +++ b/modules/desktop/applications.nix @@ -0,0 +1,39 @@ +{ + config, + lib, + pkgs, + ... +}: +lib.mkIf config.bchmnn.gui.enable { + + environment.systemPackages = + lib.optionals (config.bchmnn.collections.cli-utils.enable) [ + pkgs.libnotify # a library that sends desktop notifications to a notification daemon + pkgs.xdg-utils # a set of command line tools that assist applications with a variety of desktop integration tasks + ] + ++ lib.optionals (config.bchmnn.collections.development.enable) [ + pkgs.ghidra-bin + pkgs.mongodb-compass + ] + ++ lib.optionals (lib.elem "sway" config.bchmnn.gui.flavour) [ + pkgs.qt5.qtwayland + pkgs.qt6.qtwayland + pkgs.wineWowPackages.waylandFull + ]; + + programs = { + kdeconnect.enable = true; + ausweisapp = { + enable = true; + openFirewall = true; + }; + wireshark.enable = config.bchmnn.collections.development.enable; + virt-manager.enable = config.bchmnn.collections.virtualisation.enable; + }; + + services.ratbagd.enable = true; + # needed for udiskie + services.udisks2.enable = true; + # enable gvfs to mount android devices + services.gvfs.enable = true; +} diff --git a/modules/desktop/default.nix b/modules/desktop/default.nix new file mode 100644 index 0000000..380d7b5 --- /dev/null +++ b/modules/desktop/default.nix @@ -0,0 +1,132 @@ +{ + config, + lib, + pkgs, + ... +}: +{ + imports = [ + ./applications.nix + ./fonts.nix + ./games.nix + ./nautilus.nix + ]; + + options.bchmnn = { + gui = { + enable = lib.mkEnableOption "gui"; + greeter = { + enable = lib.mkEnableOption "greeter"; + }; + flavour = lib.mkOption { + type = lib.types.listOf lib.types.str; + default = [ "sway" ]; + example = [ + "sway" + "i3" + ]; + description = '' + The flavour (WM) for your system to use + ''; + }; + }; + }; + + config = lib.mkIf (config.bchmnn.gui.enable && config.bchmnn.gui.flavour != [ ]) { + environment.pathsToLink = [ "/libexec" ]; # links /libexec from derivations to /run/current-system/sw + programs.sway.enable = builtins.elem "sway" config.bchmnn.gui.flavour; + services.xserver.windowManager.i3.enable = builtins.elem "i3" config.bchmnn.gui.flavour; + services.libinput.enable = true; + services.xserver = { + enable = ( + builtins.elem "i3" config.bchmnn.gui.flavour || builtins.elem "gnome" config.bchmnn.gui.flavour + ); + desktopManager.gnome.enable = builtins.elem "gnome" config.bchmnn.gui.flavour; + displayManager = { + gdm.enable = builtins.elem "gnome" config.bchmnn.gui.flavour; + startx.enable = builtins.elem "i3" config.bchmnn.gui.flavour; + }; + }; + environment.systemPackages = [ + (pkgs.writeShellScriptBin "sway-run" '' + export WLR_NO_HARDWARE_CURSORS=1 + exec ${pkgs.sway}/bin/sway "$@" + '') + ]; + environment = { + etc = { + "greetd/environments".text = (lib.strings.concatLines config.bchmnn.gui.flavour); + "greetd/kanshi-config".text = '' + profile nomad { + output "LVDS-1" enable + } + profile iroh { + output "DP-3" enable mode 2560x1440 position 0,0 + output "DP-2" enable mode 2560x1440 position 2560,0 + output "DP-1" enable mode 2560x1440 position 5120,0 + } + profile station { + output "LVDS-1" disable + output "Dell Inc. DELL U2515H 9X2VY5490XUL" enable mode 1920x1080 position 0,0 + output "Dell Inc. DELL U2515H 9X2VY5C7138L" enable mode 1920x1080 position 1920,0 + output "HJW VGA TO HDMI 0x00000100" enable mode 1920x1080 position 3840,0 + } + ''; + "greetd/sway-config".text = '' + exec "${pkgs.kanshi}/bin/kanshi --config /etc/greetd/kanshi-config" + exec "${pkgs.greetd.gtkgreet}/bin/gtkgreet -l; swaymsg exit" + + bindsym Mod4+shift+e exec swaynag \ + -t warning \ + -m 'What do you want to do?' \ + -b 'Poweroff' 'systemctl poweroff' \ + -b 'Reboot' 'systemctl reboot' + + include /etc/sway/config.d/* + ''; + }; + }; + services.greetd = { + enable = config.bchmnn.gui.greeter.enable; + settings = { + default_session = { + command = + "sway-run --config /etc/greetd/sway-config" + + lib.optionalString config.bchmnn.nvidia.enable " --unsupported-gpu"; + }; + }; + }; + + # TODO workaround to get swaylock accepting pw + # https://github.com/NixOS/nixpkgs/issues/158025 + security.pam.services = lib.mkIf (lib.elem "sway" config.bchmnn.gui.flavour) { swaylock = { }; }; + + xdg.portal = { + enable = true; + wlr.enable = true; + config.common.default = "*"; + extraPortals = lib.optionals (lib.elem "sway" config.bchmnn.gui.flavour) [ + pkgs.xdg-desktop-portal-wlr + ]; + }; + environment.sessionVariables.GST_PLUGIN_SYSTEM_PATH_1_0 = + lib.makeSearchPathOutput "lib" "lib/gstreamer-1.0" + ( + with pkgs.gst_all_1; + [ + gst-plugins-base + gst-plugins-good + gst-plugins-bad + gst-plugins-ugly + ] + ); + hardware.opengl = { + enable = true; + driSupport = true; + driSupport32Bit = true; + }; + environment.variables = + lib.mkIf (builtins.elem pkgs.intel-media-driver config.hardware.opengl.extraPackages) + { LIBVA_DRIVER_NAME = "iHD"; }; + }; +} diff --git a/modules/fonts.nix b/modules/desktop/fonts.nix similarity index 73% rename from modules/fonts.nix rename to modules/desktop/fonts.nix index 16ba0b5..b3ebb16 100644 --- a/modules/fonts.nix +++ b/modules/desktop/fonts.nix @@ -1,4 +1,10 @@ -{ pkgs, ... }: { +{ + pkgs, + lib, + config, + ... +}: +lib.mkIf (config.bchmnn.gui.enable) { # Add fonts fonts = { enableDefaultPackages = true; diff --git a/modules/desktop/games.nix b/modules/desktop/games.nix new file mode 100644 index 0000000..89fb3d0 --- /dev/null +++ b/modules/desktop/games.nix @@ -0,0 +1,16 @@ +{ + pkgs, + config, + lib, + ... +}: +lib.mkIf config.bchmnn.collections.games.enable { + programs.steam = { + enable = true; + }; + + environment.systemPackages = [ + pkgs.mangohud + pkgs.gamemode + ]; +} diff --git a/modules/nautilus.nix b/modules/desktop/nautilus.nix similarity index 65% rename from modules/nautilus.nix rename to modules/desktop/nautilus.nix index ba8710d..6b79a37 100644 --- a/modules/nautilus.nix +++ b/modules/desktop/nautilus.nix @@ -1,4 +1,10 @@ -{ pkgs, lib, config, ... }: with config.bchmnn; lib.mkIf (gui.enable && gui.flavour != [ ]) { +{ + pkgs, + lib, + config, + ... +}: +lib.mkIf (config.bchmnn.gui.enable && config.bchmnn.gui.flavour != [ ]) { programs.nautilus-open-any-terminal = { enable = true; terminal = "kitty"; @@ -6,9 +12,7 @@ environment = { sessionVariables.NAUTILUS_4_EXTENSION_DIR = "${pkgs.gnome.nautilus-python}/lib/nautilus/extensions-4"; - pathsToLink = [ - "/share/nautilus-python/extensions" - ]; + pathsToLink = [ "/share/nautilus-python/extensions" ]; systemPackages = with pkgs; [ gnome.nautilus diff --git a/modules/gstreamer.nix b/modules/gstreamer.nix deleted file mode 100644 index 3878547..0000000 --- a/modules/gstreamer.nix +++ /dev/null @@ -1,8 +0,0 @@ -{ lib, pkgs, ... }: { - environment.sessionVariables.GST_PLUGIN_SYSTEM_PATH_1_0 = lib.makeSearchPathOutput "lib" "lib/gstreamer-1.0" (with pkgs.gst_all_1; [ - gst-plugins-base - gst-plugins-good - gst-plugins-bad - gst-plugins-ugly - ]); -} diff --git a/modules/home-manager/applications.nix b/modules/home-manager/applications.nix new file mode 100644 index 0000000..fa59733 --- /dev/null +++ b/modules/home-manager/applications.nix @@ -0,0 +1,22 @@ +{ pkgs, ... }: +{ + home.packages = [ + pkgs.gopass # slightly more awesome standard unix password manager for teams. written in go + pkgs.gopass-jsonapi # enables communication with gopass via json messages + pkgs.yt-dlp # command-line tool to download videos from youtube.com and other sites (youtube-dl fork) + pkgs.gdu # fast disk usage analyzer with console interface written in go + pkgs.duf # disk usage/free utility - a better 'df' alternative + pkgs.stress # simple workload generator for posix systems. it imposes a configurable amount of cpu, memory, i/o, and disk stress on the system + pkgs.s-tui # stress-terminal ui monitoring tool + pkgs.fio # flexible io tester - an io benchmark tool + pkgs.ffmpeg # complete, cross-platform solution to record, convert and stream audio and video + pkgs.texliveFull # tex live environment + pkgs.imagemagick # software suite to create, edit, compose, or convert bitmap images + pkgs.ghostscript # postscript interpreter (mainline version) + pkgs.pdftk # command-line tool for working with pdfs + pkgs.ventoy-full # bootable usb solution + pkgs.unstable.isisdl # downloader for isis of tu-berlin + pkgs.sage # open source mathematics software, free alternative to magma, maple, mathematica, and matlab + pkgs.filebrowser # filebrowser is a web application for managing files and directories + ]; +} diff --git a/users/gandalf/modules/audio.nix b/modules/home-manager/audio.nix similarity index 68% rename from users/gandalf/modules/audio.nix rename to modules/home-manager/audio.nix index 2ca8897..9eec7d4 100644 --- a/users/gandalf/modules/audio.nix +++ b/modules/home-manager/audio.nix @@ -1,4 +1,5 @@ -{ +{ lib, nixosConfig, ... }: +lib.mkIf nixosConfig.bchmnn.audio.enable { xdg.configFile."wireplumber/wireplumber.conf.d/51-scarlett-samplerate.conf" = { text = '' monitor.alsa.rules = [ @@ -21,19 +22,6 @@ } } } - # { - # matches = [ - # { - # node.nick = "Scarlett 2i2 USB" - # } - # ] - # actions = { - # update-props = { - # audio.rate = 48000 - # api.acp.probe-rate = 48000 - # } - # } - # } ] ''; }; diff --git a/modules/home-manager/dconf.nix b/modules/home-manager/dconf.nix new file mode 100644 index 0000000..fd15a37 --- /dev/null +++ b/modules/home-manager/dconf.nix @@ -0,0 +1,16 @@ +{ lib, nixosConfig, ... }: +{ + + dconf.settings = { + "org/virt-manager/virt-manager/connections" = + lib.mkIf nixosConfig.bchmnn.collections.virtualisation.enable + { + autoconnect = [ "qemu:///system" ]; + uris = [ "qemu:///system" ]; + }; + "org/gnome/desktop/interface" = { + "color-scheme" = "prefer-light"; + }; + }; + +} diff --git a/modules/home-manager/default.nix b/modules/home-manager/default.nix new file mode 100644 index 0000000..357bbb4 --- /dev/null +++ b/modules/home-manager/default.nix @@ -0,0 +1,57 @@ +{ config, ... }@inputs: +let + common = import ../core/common.nix; +in +{ + + imports = [ inputs.home-manager.nixosModules.home-manager ]; + + users.users.gandalf = { + isNormalUser = true; + extraGroups = config.bchmnn.user.extraGroups; + }; + + home-manager.useGlobalPkgs = true; + home-manager.useUserPackages = true; + home-manager.extraSpecialArgs = { + inherit inputs; + }; + + home-manager.users.gandalf = rec { + imports = [ + ./gui + ./scripts + ./applications.nix + ./audio.nix + ./dconf.nix + ./git.nix + ./gnupg.nix + ./keyd.nix + ./neovim.nix + ./shell.nix + ./zsh.nix + ]; + + config = { + home = { + username = "gandalf"; + homeDirectory = "/home/gandalf"; + shellAliases = common.aliases; + stateVersion = "23.05"; + }; + + xdg.userDirs = { + enable = true; + createDirectories = true; + desktop = "${config.home.homeDirectory}/tmp"; + documents = "${config.home.homeDirectory}/docs"; + download = "${config.home.homeDirectory}/dl"; + music = "${config.home.homeDirectory}/music"; + pictures = "${config.home.homeDirectory}/pics"; + publicShare = "${config.home.homeDirectory}/public"; + templates = "${config.home.homeDirectory}/templates"; + videos = "${config.home.homeDirectory}/vids"; + }; + }; + }; +} diff --git a/users/gandalf/modules/git.nix b/modules/home-manager/git.nix similarity index 70% rename from users/gandalf/modules/git.nix rename to modules/home-manager/git.nix index 115a8bd..56c9bb3 100644 --- a/users/gandalf/modules/git.nix +++ b/modules/home-manager/git.nix @@ -1,15 +1,18 @@ -{ ... }: { +{ nixosConfig, ... }: +{ programs.git = { enable = true; lfs.enable = true; signing = { signByDefault = true; - key = "732A612DAD28067D"; + key = nixosConfig.bchmnn.git.signing.key; }; userEmail = "jacob.bachmann@posteo.de"; userName = "Jacob Bachmann"; extraConfig = { - init = { defaultBranch = "main"; }; + init = { + defaultBranch = "main"; + }; core.editor = "nvim"; pull.rebase = false; push.autoSetupRemote = true; diff --git a/users/gandalf/modules/gnupg.nix b/modules/home-manager/gnupg.nix similarity index 92% rename from users/gandalf/modules/gnupg.nix rename to modules/home-manager/gnupg.nix index 223d0be..54f052f 100644 --- a/users/gandalf/modules/gnupg.nix +++ b/modules/home-manager/gnupg.nix @@ -1,4 +1,5 @@ -{ pkgs, ... }: { +{ pkgs, ... }: +{ programs.gpg = { enable = true; }; diff --git a/users/gandalf/modules/gui/common.nix b/modules/home-manager/gui/common.nix similarity index 98% rename from users/gandalf/modules/gui/common.nix rename to modules/home-manager/gui/common.nix index 33c0fba..6f7d0d1 100644 --- a/users/gandalf/modules/gui/common.nix +++ b/modules/home-manager/gui/common.nix @@ -1,4 +1,5 @@ -{ pkgs, lib, ... }: { +{ pkgs, lib, ... }: +{ colorschemes = rec { custom = { black = "#000000"; diff --git a/users/gandalf/modules/gui/cursor.nix b/modules/home-manager/gui/cursor.nix similarity index 90% rename from users/gandalf/modules/gui/cursor.nix rename to modules/home-manager/gui/cursor.nix index 4b97034..8442b1a 100644 --- a/users/gandalf/modules/gui/cursor.nix +++ b/modules/home-manager/gui/cursor.nix @@ -1,4 +1,5 @@ -{ pkgs, ... }: { +{ pkgs, ... }: +{ home.pointerCursor = { name = "macOS-Monterey"; package = pkgs.apple-cursor; diff --git a/modules/home-manager/gui/default.nix b/modules/home-manager/gui/default.nix new file mode 100644 index 0000000..5689edf --- /dev/null +++ b/modules/home-manager/gui/default.nix @@ -0,0 +1,13 @@ +{ lib, nixosConfig, ... }: +{ + imports = + with lib; + with nixosConfig.bchmnn; + optionals gui.enable [ + ./cursor.nix + ./gtk.nix + ./programs + ] + ++ optionals (gui.enable && elem "sway" gui.flavour) [ ./sway ] + ++ optionals (gui.enable && elem "i3" gui.flavour) [ ./i3 ]; +} diff --git a/users/gandalf/modules/gui/gtk.nix b/modules/home-manager/gui/gtk.nix similarity index 93% rename from users/gandalf/modules/gui/gtk.nix rename to modules/home-manager/gui/gtk.nix index af90475..655836a 100644 --- a/users/gandalf/modules/gui/gtk.nix +++ b/modules/home-manager/gui/gtk.nix @@ -1,5 +1,5 @@ -{ ... }: { - +{ ... }: +{ gtk = { enable = true; gtk3.extraConfig = { @@ -9,5 +9,4 @@ gtk-application-prefer-dark-theme = 0; }; }; - } diff --git a/users/gandalf/modules/gui/i3/autorandr.nix b/modules/home-manager/gui/i3/autorandr.nix similarity index 99% rename from users/gandalf/modules/gui/i3/autorandr.nix rename to modules/home-manager/gui/i3/autorandr.nix index fd99b55..8ee920e 100644 --- a/users/gandalf/modules/gui/i3/autorandr.nix +++ b/modules/home-manager/gui/i3/autorandr.nix @@ -1,5 +1,5 @@ -{ ... }: { - +{ ... }: +{ programs.autorandr = { enable = true; @@ -52,5 +52,4 @@ }; }; }; - } diff --git a/users/gandalf/modules/gui/i3/default.nix b/modules/home-manager/gui/i3/default.nix similarity index 96% rename from users/gandalf/modules/gui/i3/default.nix rename to modules/home-manager/gui/i3/default.nix index c9223dd..7437dc5 100644 --- a/users/gandalf/modules/gui/i3/default.nix +++ b/modules/home-manager/gui/i3/default.nix @@ -1,16 +1,22 @@ -{ pkgs, lib, config, ... }: +{ + pkgs, + lib, + config, + ... +}: let - cfg = config.xsession.windowManager.i3.config; # common = (import ../common.nix) { pkgs = pkgs; lib = lib; }; - common = (import ../common.nix) { inherit pkgs; inherit lib; }; + common = (import ../common.nix) { + inherit pkgs; + inherit lib; + }; start-polybar = pkgs.writeShellScript "start-polybar" '' ${pkgs.polybarFull}/bin/polybar-msg cmd quit echo "---" | tee -a /tmp/polybar.log ${pkgs.polybarFull}/bin/polybar 2>&1 | tee -a /tmp/polybar.log & disown ''; - in { @@ -49,7 +55,9 @@ in menu = "${config.programs.rofi.package}/bin/rofi -show drun"; startup = with pkgs; [ { command = "${start-polybar}"; } - { command = "${gnome.gnome-keyring}/bin/gnome-keyring-daemon --start --components=ssh,secrets,pkcs11"; } + { + command = "${gnome.gnome-keyring}/bin/gnome-keyring-daemon --start --components=ssh,secrets,pkcs11"; + } { command = "${autorandr}/bin/autorandr -c"; } { command = "${feh}/bin/feh --bg-fill ${common.wallpaper.default}"; } { command = "${networkmanagerapplet}/bin/nm-applet"; } @@ -58,7 +66,10 @@ in { command = "${nextcloud-client}/bin/nextcloud"; } { command = "${plasma5Packages.kdeconnect-kde}/bin/kdeconnect-indicator"; } { command = "${system-config-printer}/bin/system-config-printer-applet"; } - { command = "${config.programs.kitty.package}/bin/kitty --class dropdown --title dropdown"; always = true; } + { + command = "${config.programs.kitty.package}/bin/kitty --class dropdown --title dropdown"; + always = true; + } ]; fonts = { names = [ common.font ]; diff --git a/users/gandalf/modules/gui/i3/polybar.nix b/modules/home-manager/gui/i3/polybar.nix similarity index 100% rename from users/gandalf/modules/gui/i3/polybar.nix rename to modules/home-manager/gui/i3/polybar.nix diff --git a/users/gandalf/modules/gui/i3/rofi.nix b/modules/home-manager/gui/i3/rofi.nix similarity index 100% rename from users/gandalf/modules/gui/i3/rofi.nix rename to modules/home-manager/gui/i3/rofi.nix diff --git a/users/gandalf/modules/gui/programs/alacritty.nix b/modules/home-manager/gui/programs/alacritty.nix similarity index 88% rename from users/gandalf/modules/gui/programs/alacritty.nix rename to modules/home-manager/gui/programs/alacritty.nix index 6f957f4..8637672 100644 --- a/users/gandalf/modules/gui/programs/alacritty.nix +++ b/modules/home-manager/gui/programs/alacritty.nix @@ -1,6 +1,9 @@ { pkgs, lib, ... }: let - common = (import ../common.nix) { pkgs = pkgs; lib = lib; }; + common = (import ../common.nix) { + pkgs = pkgs; + lib = lib; + }; alabaster-theme-patch = builtins.toFile "alabaster.patch" '' diff --git a/alabaster.toml b/alabaster.toml index df312d3..f5e5499 100644 @@ -21,11 +24,9 @@ let [colors.normal] ''; - alacritty-theme-patched = pkgs.alacritty-theme.overrideAttrs (final: previous: { - patches = [ - alabaster-theme-patch - ]; - }); + alacritty-theme-patched = pkgs.alacritty-theme.overrideAttrs ( + final: previous: { patches = [ alabaster-theme-patch ]; } + ); in { programs.alacritty = { diff --git a/users/gandalf/modules/gui/programs/chromium/default.nix b/modules/home-manager/gui/programs/chromium/default.nix similarity index 99% rename from users/gandalf/modules/gui/programs/chromium/default.nix rename to modules/home-manager/gui/programs/chromium/default.nix index 007057b..b01089d 100644 --- a/users/gandalf/modules/gui/programs/chromium/default.nix +++ b/modules/home-manager/gui/programs/chromium/default.nix @@ -1,6 +1,5 @@ { config, pkgs, ... }: let - icons = { chromium = ./icons/chromium.png; spotify = ./icons/spotify.png; @@ -8,7 +7,6 @@ let outlook = ./icons/outlook.png; whatsapp = ./icons/whatsapp.png; }; - in { @@ -63,6 +61,4 @@ in Icon=${icons.whatsapp} ''; }; - } - diff --git a/users/gandalf/modules/gui/programs/chromium/icons/LICENSE.md b/modules/home-manager/gui/programs/chromium/icons/LICENSE.md similarity index 100% rename from users/gandalf/modules/gui/programs/chromium/icons/LICENSE.md rename to modules/home-manager/gui/programs/chromium/icons/LICENSE.md diff --git a/users/gandalf/modules/gui/programs/chromium/icons/chromium.png b/modules/home-manager/gui/programs/chromium/icons/chromium.png similarity index 100% rename from users/gandalf/modules/gui/programs/chromium/icons/chromium.png rename to modules/home-manager/gui/programs/chromium/icons/chromium.png diff --git a/users/gandalf/modules/gui/programs/chromium/icons/outlook.png b/modules/home-manager/gui/programs/chromium/icons/outlook.png similarity index 100% rename from users/gandalf/modules/gui/programs/chromium/icons/outlook.png rename to modules/home-manager/gui/programs/chromium/icons/outlook.png diff --git a/users/gandalf/modules/gui/programs/chromium/icons/spotify.png b/modules/home-manager/gui/programs/chromium/icons/spotify.png similarity index 100% rename from users/gandalf/modules/gui/programs/chromium/icons/spotify.png rename to modules/home-manager/gui/programs/chromium/icons/spotify.png diff --git a/users/gandalf/modules/gui/programs/chromium/icons/teams.png b/modules/home-manager/gui/programs/chromium/icons/teams.png similarity index 100% rename from users/gandalf/modules/gui/programs/chromium/icons/teams.png rename to modules/home-manager/gui/programs/chromium/icons/teams.png diff --git a/users/gandalf/modules/gui/programs/chromium/icons/whatsapp.png b/modules/home-manager/gui/programs/chromium/icons/whatsapp.png similarity index 100% rename from users/gandalf/modules/gui/programs/chromium/icons/whatsapp.png rename to modules/home-manager/gui/programs/chromium/icons/whatsapp.png diff --git a/modules/home-manager/gui/programs/default.nix b/modules/home-manager/gui/programs/default.nix new file mode 100644 index 0000000..1cabc44 --- /dev/null +++ b/modules/home-manager/gui/programs/default.nix @@ -0,0 +1,62 @@ +{ + pkgs, + lib, + nixosConfig, + ... +}: +{ + imports = [ + ./alacritty.nix + ./chromium + ./discord.nix + ./games.nix + ./keyring.nix + ./kitty.nix + ./obs.nix + ./vscode.nix + ./zathura.nix + ]; + + home.packages = + with pkgs; + [ + + firefox # a web browser built from firefox source tree + thunderbird # a full-featured e-mail client + speechd # common interface to speech synthesis - https://support.mozilla.org/en-us/kb/speechd-setup + tor-browser # privacy-focused browser routing traffic through the tor network + qbittorrent # featureful free software bittorrent client + element-desktop # a feature-rich client for matrix.org + + telegram-desktop # telegram desktop messaging app + signal-desktop # private, simple, and secure messenger + zoom-us # zoom.us video conferencing application + + gnome.simple-scan # simple scanning utility + gnome.gnome-font-viewer # program that can preview fonts and create thumbnails for fonts + pppdf + feh # a light-weight image viewer + mpv + vlc # cross-platform media player and streaming server + zathura # a highly customizable and functional pdf viewer + neovide # a simple graphical user interface for neovim + + gimp # the gnu image manipulation program + (calibre.override { unrarSupport = true; }) + libreoffice # comprehensive, professional-quality productivity suite, a variant of openoffice.org + xournalpp # a handwriting notetaking software with pdf annotation support + libsForQt5.okular # kde document viewer + carla # audio plugin host + picard # musicbrainz picard audio file tagger + anki # spaced repetition flashcard program + + ] + ++ lib.optionals nixosConfig.bchmnn.printing.enable [ + system-config-printer # graphical user interface for cups administration + + ] + ++ lib.optionals nixosConfig.services.ratbagd.enable [ + piper # gtk frontend for ratbagd mouse config daemon + + ]; +} diff --git a/users/gandalf/modules/gui/programs/discord.nix b/modules/home-manager/gui/programs/discord.nix similarity index 85% rename from users/gandalf/modules/gui/programs/discord.nix rename to modules/home-manager/gui/programs/discord.nix index 30eefaa..23a0b06 100644 --- a/users/gandalf/modules/gui/programs/discord.nix +++ b/modules/home-manager/gui/programs/discord.nix @@ -1,4 +1,5 @@ -{ pkgs, ... }: { +{ pkgs, ... }: +{ home.packages = with pkgs; [ vesktop # alternate client for discord with vencord built-in ]; diff --git a/modules/home-manager/gui/programs/games.nix b/modules/home-manager/gui/programs/games.nix new file mode 100644 index 0000000..f18ac0b --- /dev/null +++ b/modules/home-manager/gui/programs/games.nix @@ -0,0 +1,15 @@ +{ + nixosConfig, + lib, + pkgs, + ... +}: +lib.mkIf nixosConfig.bchmnn.collections.games.enable { + home.packages = with pkgs; [ + openjdk17 # the open-source java development kit + prismlauncher # a free, open source launcher for minecraft + # retroarchFull # multi-platform emulator frontend for libretro cores + celestia # real-time 3d simulation of space + extremetuxracer # high speed arctic racing game based on tux racer + ]; +} diff --git a/users/gandalf/modules/gui/programs/keyring.nix b/modules/home-manager/gui/programs/keyring.nix similarity index 62% rename from users/gandalf/modules/gui/programs/keyring.nix rename to modules/home-manager/gui/programs/keyring.nix index f87398b..b58293e 100644 --- a/users/gandalf/modules/gui/programs/keyring.nix +++ b/modules/home-manager/gui/programs/keyring.nix @@ -1,5 +1,5 @@ -{ pkgs, ... }: { - +{ pkgs, ... }: +{ services.gnome-keyring = { enable = true; components = [ @@ -9,8 +9,5 @@ ]; }; - home.packages = with pkgs; [ - gnome.seahorse - ]; - + home.packages = with pkgs; [ gnome.seahorse ]; } diff --git a/users/gandalf/modules/gui/programs/kitty.nix b/modules/home-manager/gui/programs/kitty.nix similarity index 88% rename from users/gandalf/modules/gui/programs/kitty.nix rename to modules/home-manager/gui/programs/kitty.nix index 87d0108..63734f9 100644 --- a/users/gandalf/modules/gui/programs/kitty.nix +++ b/modules/home-manager/gui/programs/kitty.nix @@ -1,6 +1,9 @@ { pkgs, lib, ... }: let - common = (import ../common.nix) { pkgs = pkgs; lib = lib; }; + common = (import ../common.nix) { + pkgs = pkgs; + lib = lib; + }; kitty-alabaster-theme-patch = builtins.toFile "kitty-theme-alabaster.patch" '' diff --git a/themes/Alabaster.conf b/themes/Alabaster.conf index 7989049..b0c180e 100644 @@ -41,11 +44,9 @@ let #: kitty window border colors and terminal bell colors ''; - kitty-theme-patched = pkgs.kitty-themes.overrideAttrs (final: previous: { - patches = [ - kitty-alabaster-theme-patch - ]; - }); + kitty-theme-patched = pkgs.kitty-themes.overrideAttrs ( + final: previous: { patches = [ kitty-alabaster-theme-patch ]; } + ); in { programs.kitty = { diff --git a/users/gandalf/modules/gui/programs/obs.nix b/modules/home-manager/gui/programs/obs.nix similarity index 84% rename from users/gandalf/modules/gui/programs/obs.nix rename to modules/home-manager/gui/programs/obs.nix index bf2bc7c..6e3b369 100644 --- a/users/gandalf/modules/gui/programs/obs.nix +++ b/modules/home-manager/gui/programs/obs.nix @@ -1,8 +1,7 @@ -{ pkgs, ... }: { - +{ pkgs, ... }: +{ programs.obs-studio = { enable = true; plugins = [ pkgs.obs-studio-plugins.wlrobs ]; }; - } diff --git a/users/gandalf/modules/gui/programs/vscode.nix b/modules/home-manager/gui/programs/vscode.nix similarity index 98% rename from users/gandalf/modules/gui/programs/vscode.nix rename to modules/home-manager/gui/programs/vscode.nix index 0a2f9bd..9f98001 100644 --- a/users/gandalf/modules/gui/programs/vscode.nix +++ b/modules/home-manager/gui/programs/vscode.nix @@ -1,6 +1,9 @@ { pkgs, lib, ... }: let - common = (import ../common.nix) { pkgs = pkgs; lib = lib; }; + common = (import ../common.nix) { + pkgs = pkgs; + lib = lib; + }; in { programs.vscode = { @@ -129,7 +132,6 @@ in "editor.defaultFormatter" = "jnoortheen.nix-ide"; }; - "git.autofetch" = true; "json.schemaDownload.enable" = true; "javascript.updateImportsOnFileMove.enabled" = "always"; @@ -170,4 +172,3 @@ in ]; }; } - diff --git a/users/gandalf/modules/gui/programs/zathura.nix b/modules/home-manager/gui/programs/zathura.nix similarity index 93% rename from users/gandalf/modules/gui/programs/zathura.nix rename to modules/home-manager/gui/programs/zathura.nix index 0d88c40..467b787 100644 --- a/users/gandalf/modules/gui/programs/zathura.nix +++ b/modules/home-manager/gui/programs/zathura.nix @@ -1,4 +1,5 @@ -{ ... }: { +{ ... }: +{ # a highly customizable and functional pdf viewer programs.zathura = { enable = true; diff --git a/users/gandalf/modules/gui/sway/default.nix b/modules/home-manager/gui/sway/default.nix similarity index 90% rename from users/gandalf/modules/gui/sway/default.nix rename to modules/home-manager/gui/sway/default.nix index d1712c2..a420c3c 100644 --- a/users/gandalf/modules/gui/sway/default.nix +++ b/modules/home-manager/gui/sway/default.nix @@ -1,12 +1,18 @@ -{ pkgs, lib, config, nixosConfig, ... }: +{ + pkgs, + lib, + config, + nixosConfig, + ... +}: let - cfg = config.wayland.windowManager.sway.config; - common = (import ../common.nix) { pkgs = pkgs; lib = lib; }; - + common = (import ../common.nix) { + pkgs = pkgs; + lib = lib; + }; in { - imports = [ ./kanshi.nix ./swaync @@ -45,40 +51,44 @@ in gtk = true; }; xwayland = true; - extraSessionCommands = with lib; with nixosConfig.bchmnn; '' - export CLUTTER_BACKEND=wayland; - export GDK_BACKEND=wayland; - export GDK_DPI_SCALE=1; - export NIXOS_OZONE_WL=1; - export MOZ_ENABLE_WAYLAND=1; - export MOZ_USE_XINPUT2=1; - export XDG_SESSION_TYPE=wayland; - export XDG_CURRENT_DESKTOP=sway; + extraSessionCommands = + with lib; + with nixosConfig.bchmnn; + '' + export CLUTTER_BACKEND=wayland; + export GDK_BACKEND=wayland; + export GDK_DPI_SCALE=1; + export NIXOS_OZONE_WL=1; + export MOZ_ENABLE_WAYLAND=1; + export MOZ_USE_XINPUT2=1; + export XDG_SESSION_TYPE=wayland; + export XDG_CURRENT_DESKTOP=sway; - # sdl - export SDL_VIDEODRIVER=wayland + # sdl + export SDL_VIDEODRIVER=wayland - # qt - export QT_QPA_PLATFORM=wayland-egl - export QT_WAYLAND_DISABLE_WINDOWDECORATION=1 + # qt + export QT_QPA_PLATFORM=wayland-egl + export QT_WAYLAND_DISABLE_WINDOWDECORATION=1 - # java - export _JAVA_AWT_WM_NONREPARENTING=1 - export _JAVA_OPTIONS="-Dawt.useSystemAAFontSettings=on"; + # java + export _JAVA_AWT_WM_NONREPARENTING=1 + export _JAVA_OPTIONS="-Dawt.useSystemAAFontSettings=on"; - '' + optionalString nvidia.enable '' - # nvidia - export WLR_RENDERER=vulkan; - # export LIBVA_DRIVER_NAME,nvidia; - # export GBM_BACKEND=nvidia-drm; - export __GL_GSYNC_ALLOWED=0; - export __GL_VRR_ALLOWED=0; - export __GLX_VENDOR_LIBRARY_NAME=nvidia; - export WLR_NO_HARDWARE_CURSORS=1; + '' + + optionalString nvidia.enable '' + # nvidia + export WLR_RENDERER=vulkan; + # export LIBVA_DRIVER_NAME,nvidia; + # export GBM_BACKEND=nvidia-drm; + export __GL_GSYNC_ALLOWED=0; + export __GL_VRR_ALLOWED=0; + export __GLX_VENDOR_LIBRARY_NAME=nvidia; + export WLR_NO_HARDWARE_CURSORS=1; - # xwayland compat - export XWAYLAND_NO_GLAMOR=1; - ''; + # xwayland compat + export XWAYLAND_NO_GLAMOR=1; + ''; config = { modifier = "Mod4"; terminal = "${config.programs.kitty.package}/bin/kitty"; @@ -92,7 +102,9 @@ in # { command = "${nixosConfig.systemd.package}/bin/systemctl --user stop xdg-desktop-portal xdg-desktop-portal-wlr"; } # { command = "${nixosConfig.systemd.package}/bin/systemctl --user start xdg-desktop-portal xdg-desktop-portal-wlr"; } # { command = "${dbus}/bin/dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK"; } - { command = "${config.programs.waybar.package}/bin/waybar -c ${config.xdg.configHome}/waybar/swaybar.json -s ${config.xdg.configHome}/waybar/swaybar.css"; } + { + command = "${config.programs.waybar.package}/bin/waybar -c ${config.xdg.configHome}/waybar/swaybar.json -s ${config.xdg.configHome}/waybar/swaybar.css"; + } { command = "${dbus}/bin/dbus-update-activation-environment --all"; } { command = "${kanshi}/bin/kanshi"; } { command = "${networkmanagerapplet}/bin/nm-applet"; } @@ -340,6 +352,4 @@ in workspace 1 ''; }; - } - diff --git a/users/gandalf/modules/gui/sway/kanshi.nix b/modules/home-manager/gui/sway/kanshi.nix similarity index 99% rename from users/gandalf/modules/gui/sway/kanshi.nix rename to modules/home-manager/gui/sway/kanshi.nix index db0147f..264a0dd 100644 --- a/users/gandalf/modules/gui/sway/kanshi.nix +++ b/modules/home-manager/gui/sway/kanshi.nix @@ -1,5 +1,5 @@ -{ ... }: { - +{ ... }: +{ services.kanshi = { enable = true; diff --git a/users/gandalf/modules/gui/sway/swaync/config.json b/modules/home-manager/gui/sway/swaync/config.json similarity index 100% rename from users/gandalf/modules/gui/sway/swaync/config.json rename to modules/home-manager/gui/sway/swaync/config.json diff --git a/users/gandalf/modules/gui/sway/swaync/default.nix b/modules/home-manager/gui/sway/swaync/default.nix similarity index 100% rename from users/gandalf/modules/gui/sway/swaync/default.nix rename to modules/home-manager/gui/sway/swaync/default.nix diff --git a/users/gandalf/modules/gui/sway/swaync/style.css b/modules/home-manager/gui/sway/swaync/style.css similarity index 100% rename from users/gandalf/modules/gui/sway/swaync/style.css rename to modules/home-manager/gui/sway/swaync/style.css diff --git a/users/gandalf/modules/gui/sway/swaync/swaync.nix b/modules/home-manager/gui/sway/swaync/swaync.nix similarity index 100% rename from users/gandalf/modules/gui/sway/swaync/swaync.nix rename to modules/home-manager/gui/sway/swaync/swaync.nix diff --git a/users/gandalf/modules/gui/sway/wofi.nix b/modules/home-manager/gui/sway/wofi.nix similarity index 95% rename from users/gandalf/modules/gui/sway/wofi.nix rename to modules/home-manager/gui/sway/wofi.nix index ce00cee..14bd597 100644 --- a/users/gandalf/modules/gui/sway/wofi.nix +++ b/modules/home-manager/gui/sway/wofi.nix @@ -1,6 +1,9 @@ { pkgs, lib, ... }: let - common = (import ../common.nix) { pkgs = pkgs; lib = lib; }; + common = (import ../common.nix) { + pkgs = pkgs; + lib = lib; + }; in { programs.wofi = { diff --git a/users/gandalf/modules/gui/waybar.nix b/modules/home-manager/gui/waybar.nix similarity index 100% rename from users/gandalf/modules/gui/waybar.nix rename to modules/home-manager/gui/waybar.nix diff --git a/users/gandalf/modules/keyd.nix b/modules/home-manager/keyd.nix similarity index 81% rename from users/gandalf/modules/keyd.nix rename to modules/home-manager/keyd.nix index 4150bf8..977bbae 100644 --- a/users/gandalf/modules/keyd.nix +++ b/modules/home-manager/keyd.nix @@ -1,3 +1,4 @@ -{ pkgs, ... }: { +{ pkgs, ... }: +{ home.file.".XCompose".source = "${pkgs.keyd}/share/keyd/keyd.compose"; } diff --git a/users/gandalf/modules/neovim/default.nix b/modules/home-manager/neovim.nix similarity index 91% rename from users/gandalf/modules/neovim/default.nix rename to modules/home-manager/neovim.nix index 62b390e..1e67eed 100644 --- a/users/gandalf/modules/neovim/default.nix +++ b/modules/home-manager/neovim.nix @@ -1,13 +1,8 @@ -{ pkgs, ... }: { - - /* - xdg.configFile."nvim" = { - source = ./config; - recursive = true; - }; - */ - +{ pkgs, ... }: +{ home.packages = with pkgs; [ + gcc + nodejs_20 tree-sitter # parser generator tool and an incremental parsing library lua-language-server # language server that offers lua language support clang-tools # standalone command line tools for c++ development @@ -15,6 +10,8 @@ rustfmt # tool for formatting rust code according to style guidelines gopls # official language server for the go language nixd # nix language server + nil # yet another language server for nix + nixfmt-rfc-style # official formatter for nix code nodePackages.pyright # type checker for the python language ruff # an extremely fast python linter black # uncompromising python code formatter @@ -38,5 +35,4 @@ defaultEditor = true; vimAlias = true; }; - } diff --git a/users/gandalf/modules/scripts/default.nix b/modules/home-manager/scripts/default.nix similarity index 67% rename from users/gandalf/modules/scripts/default.nix rename to modules/home-manager/scripts/default.nix index 18aba38..09fe312 100644 --- a/users/gandalf/modules/scripts/default.nix +++ b/modules/home-manager/scripts/default.nix @@ -1,7 +1,6 @@ -{ pkgs, nixosConfig, ... }: { - imports = [ - ./pomodoro.nix - ]; +{ pkgs, nixosConfig, ... }: +{ + imports = [ ./pomodoro.nix ]; home.packages = [ (import ./git-clone-list.nix { inherit pkgs; }) (import ./nix-update.nix { inherit pkgs nixosConfig; }) diff --git a/users/gandalf/modules/scripts/git-clone-list.nix b/modules/home-manager/scripts/git-clone-list.nix similarity index 99% rename from users/gandalf/modules/scripts/git-clone-list.nix rename to modules/home-manager/scripts/git-clone-list.nix index cd370b5..3837f51 100644 --- a/users/gandalf/modules/scripts/git-clone-list.nix +++ b/modules/home-manager/scripts/git-clone-list.nix @@ -1,5 +1,4 @@ { pkgs }: - pkgs.writeShellScriptBin "git-clone-list" '' reset="\e[0m" bold="\e[1m" diff --git a/users/gandalf/modules/scripts/nix-update.nix b/modules/home-manager/scripts/nix-update.nix similarity index 99% rename from users/gandalf/modules/scripts/nix-update.nix rename to modules/home-manager/scripts/nix-update.nix index c115359..118e79c 100644 --- a/users/gandalf/modules/scripts/nix-update.nix +++ b/modules/home-manager/scripts/nix-update.nix @@ -1,5 +1,4 @@ { pkgs, nixosConfig }: - pkgs.writeShellScriptBin "nuf" '' reset="\e[0m" red="\e[31m" diff --git a/modules/home-manager/scripts/pomodoro.nix b/modules/home-manager/scripts/pomodoro.nix new file mode 100644 index 0000000..b7ffe93 --- /dev/null +++ b/modules/home-manager/scripts/pomodoro.nix @@ -0,0 +1,19 @@ +{ pkgs, ... }: +let + pootis = ./pootis.m4a; +in +{ + home.packages = [ + pkgs.openpomodoro-cli + (pkgs.writeShellScriptBin "pomostart" '' + clear + ${pkgs.openpomodoro-cli}/bin/openpomodoro-cli start --wait $@ + while ${pkgs.mpv}/bin/mpv ${pootis} > /dev/null 2>&1; do :; done + '') + (pkgs.writeShellScriptBin "pomobreak" '' + clear + ${pkgs.openpomodoro-cli}/bin/openpomodoro-cli break --wait $@ + while ${pkgs.mpv}/bin/mpv ${pootis} > /dev/null 2>&1; do :; done + '') + ]; +} diff --git a/users/gandalf/modules/scripts/pootis.m4a b/modules/home-manager/scripts/pootis.m4a similarity index 100% rename from users/gandalf/modules/scripts/pootis.m4a rename to modules/home-manager/scripts/pootis.m4a diff --git a/modules/home-manager/shell.nix b/modules/home-manager/shell.nix new file mode 100644 index 0000000..fd36ee5 --- /dev/null +++ b/modules/home-manager/shell.nix @@ -0,0 +1,56 @@ +{ + nixosConfig, + lib, + pkgs, + ... +}: +{ + + home.file.".XCompose".source = "${pkgs.keyd}/share/keyd/keyd.compose"; + + programs.ssh = { + enable = true; + addKeysToAgent = "yes"; + includes = [ "config.d/*" ]; + }; + + home.file.".ssh/config.d/.keep".source = builtins.toFile "keep" ""; + + services.ssh-agent = { + enable = true; + }; + + programs.tmux = { + enable = true; + newSession = true; + terminal = "screen-256color"; + + clock24 = true; + escapeTime = 0; + historyLimit = 10000; + + mouse = true; + keyMode = "vi"; + }; + + programs.eza = { + enable = true; + enableBashIntegration = true; + enableZshIntegration = true; + }; + + programs.fzf = { + enable = true; + enableBashIntegration = true; + enableZshIntegration = true; + }; + + programs.yazi = { + enable = true; + }; + + home.packages = [ + pkgs.exiftool + pkgs.mediainfo + ] ++ lib.optionals nixosConfig.bchmnn.gui.enable [ pkgs.ueberzugpp ]; +} diff --git a/users/gandalf/modules/zsh.nix b/modules/home-manager/zsh.nix similarity index 98% rename from users/gandalf/modules/zsh.nix rename to modules/home-manager/zsh.nix index cd403f6..d3b297f 100644 --- a/users/gandalf/modules/zsh.nix +++ b/modules/home-manager/zsh.nix @@ -1,4 +1,5 @@ -{ config, ... }: { +{ config, ... }: +{ programs.zsh = { enable = true; enableCompletion = true; diff --git a/modules/i18n.nix b/modules/i18n.nix deleted file mode 100644 index 819373d..0000000 --- a/modules/i18n.nix +++ /dev/null @@ -1,14 +0,0 @@ -{ ... }: { - # Set your time zone. - time.timeZone = "Europe/Berlin"; - - # Select internationalisation properties. - i18n = { - defaultLocale = "en_US.UTF-8"; - supportedLocales = [ "en_US.UTF-8/UTF-8" "de_DE.UTF-8/UTF-8" ]; - }; - console = { - font = "Lat2-Terminus16"; - keyMap = "us"; - }; -} diff --git a/modules/kdeconnect.nix b/modules/kdeconnect.nix deleted file mode 100644 index 4223e0c..0000000 --- a/modules/kdeconnect.nix +++ /dev/null @@ -1,3 +0,0 @@ -{ config, ... }: { - programs.kdeconnect.enable = config.bchmnn.gui.enable; -} diff --git a/modules/man.nix b/modules/man.nix deleted file mode 100644 index be6bedc..0000000 --- a/modules/man.nix +++ /dev/null @@ -1,21 +0,0 @@ -{ pkgs, ... }: { - - documentation = { - enable = true; - doc.enable = true; - dev.enable = true; - man = { - enable = true; - generateCaches = true; - man-db.enable = true; - }; - - }; - - environment.systemPackages = with pkgs; [ - man-pages - man-pages-posix - ncurses - ]; - -} diff --git a/modules/network.nix b/modules/network.nix deleted file mode 100644 index 2ae863f..0000000 --- a/modules/network.nix +++ /dev/null @@ -1,12 +0,0 @@ -{ pkgs, ... }: { - networking.networkmanager.enable = true; - - systemd.services = { - NetworkManager-wait-online.enable = false; - }; - - programs.wireshark = { - enable = true; - package = pkgs.wireshark; - }; -} diff --git a/modules/nh.nix b/modules/nh.nix deleted file mode 100644 index 158b652..0000000 --- a/modules/nh.nix +++ /dev/null @@ -1,8 +0,0 @@ -{ - programs.nh = { - enable = true; - # clean.enable = true; - # clean.extraArgs = "--keep-since 4d --keep 3"; - # flake = "/etc/nixos"; - }; -} diff --git a/modules/nix-ld.nix b/modules/nix-ld.nix deleted file mode 100644 index c33421b..0000000 --- a/modules/nix-ld.nix +++ /dev/null @@ -1,12 +0,0 @@ -{ pkgs, ... }: { - # provide libraries for non-nix binaries - programs.nix-ld = { - enable = true; - libraries = with pkgs; [ - glibc - libcxx - libllvm - ncurses - ]; - }; -} diff --git a/modules/nix.nix b/modules/nix.nix deleted file mode 100644 index 12f4c9a..0000000 --- a/modules/nix.nix +++ /dev/null @@ -1,28 +0,0 @@ -{ ... }@inputs: { - nix = { - settings = { - experimental-features = [ "nix-command" "flakes" ]; - auto-optimise-store = true; - }; - }; - - nixpkgs = { - overlays = [ - (self: super: { - unstable = import inputs.nixpkgs-unstable { - system = super.system; - }; - mfcl3750cdwlpr = (super.callPackage ../overlays/mfcl3750cdw.nix { }).driver; - mfcl3750cdwcupswrapper = (super.callPackage ../overlays/mfcl3750cdw.nix { }).cupswrapper; - pppdf = (super.python3Packages.callPackage ../overlays/pppdf { }); - iglesia-light = (super.callPackage ../overlays/fonts/iglesia-light.nix { }); - }) - ]; - config = { - allowUnfree = true; - allowUnfreePredicate = (_: true); - }; - }; - - system.stateVersion = "23.05"; -} diff --git a/modules/nvidia.nix b/modules/nvidia.nix deleted file mode 100644 index 9f660dc..0000000 --- a/modules/nvidia.nix +++ /dev/null @@ -1,11 +0,0 @@ -{ config, lib, ... }: lib.mkIf config.bchmnn.nvidia.enable { - - services.xserver.videoDrivers = [ "nvidia" ]; - - hardware.nvidia = { - modesetting.enable = true; - powerManagement.enable = true; - nvidiaSettings = true; - }; - -} diff --git a/modules/ollama.nix b/modules/ollama.nix deleted file mode 100644 index 85c76ed..0000000 --- a/modules/ollama.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ lib, config, ... }: lib.mkIf config.bchmnn.ai.enable { - services.ollama = { - enable = true; - acceleration = if config.bchmnn.nvidia.enable then "cuda" else null; - }; -} diff --git a/modules/opengl.nix b/modules/opengl.nix deleted file mode 100644 index 5bc63e5..0000000 --- a/modules/opengl.nix +++ /dev/null @@ -1,16 +0,0 @@ -{ config, lib, pkgs, ... }: { - hardware.opengl = { - enable = true; - driSupport = true; - driSupport32Bit = true; - }; - - environment.variables = lib.mkIf ( - builtins.elem - pkgs.intel-media-driver - config.hardware.opengl.extraPackages - ) { - LIBVA_DRIVER_NAME = "iHD"; - }; - -} diff --git a/modules/openssh.nix b/modules/openssh.nix deleted file mode 100644 index 6c73afa..0000000 --- a/modules/openssh.nix +++ /dev/null @@ -1,8 +0,0 @@ -{ ... }: { - - services.openssh = { - enable = true; - openFirewall = true; - }; - -} diff --git a/modules/packages.nix b/modules/packages.nix deleted file mode 100644 index 6a7dd36..0000000 --- a/modules/packages.nix +++ /dev/null @@ -1,64 +0,0 @@ -{ lib, pkgs, config, ... }: { - environment.systemPackages = with pkgs; with config.bchmnn; [ - pciutils # a collection of programs for inspecting and manipulating configuration of pci devices - usbutils # tools for working with usb devices, such as lsusb - lshw # provide detailed information on the hardware configuration of the machine - git # distributed version control system - gnumake # a tool to control the generation of non-source files from sources - parallel # shell tool for executing jobs in parallel - mercurial # a fast, lightweight scm system for very large distributed projects - wget # tool for retrieving files using http, https, and ftp - unstable.neovim-unwrapped # vim text editor fork focused on extensibility and agility - neofetch # a fast, highly customizable system info script - lsd # the next gen ls command - eza # a modern, maintained replacement for ls - ripgrep # a utility that combines the usability of the silver searcher with the raw speed of grep - ripgrep-all # ripgrep, but also search in pdfs, e-books, office documents, zip, tar.gz, and more - expect # a tool for automating interactive applications - jq # a lightweight and flexible command-line json processor - unzip # an extraction utility for archives compressed in .zip format - unrar # utility for rar archives - libsecret # a library for storing and retrieving passwords and other secrets - xidel # command line tool to download and extract data from html/xml pages as well as json apis - nvd # nix/nixos package version diff tool - inotify-tools # a c library and a set of command-line programs providing a simple interface to inotify - wireguard-tools # tools for the wireguard secure network tunnel - mkcert # a simple tool for making locally-trusted development certificates - ] ++ lib.optionals (devenv.enable) [ - # languages - gcc13 - clang - universal-ctags # a maintained ctags implementation - rustc - cargo # downloads your rust project's dependencies and builds your project - go # go programming language - (python312.withPackages (p: with p; [ - ptpython # an advanced python repl - ipython # ipython: productive interactive computing - pycryptodome # self-contained cryptographic library - gmpy2 # interface to gmp, mpfr, and mpc for python 3.7+ - ])) - lua - nixpkgs-fmt - openjdk17 - javaPackages.openjfx17 - gradle_7 - maven - ant - nodejs_20 - nodenv - nodePackages.yarn - nodePackages.pnpm - mongodb-compass - ghidra-bin - hexedit - ] ++ lib.optionals (gui.enable) [ - libnotify # a library that sends desktop notifications to a notification daemon - xdg-utils # a set of command line tools that assist applications with a variety of desktop integration tasks - ] ++ lib.optionals (gui.enable && lib.elem "sway" gui.flavour) [ - qt5.qtwayland - qt6.qtwayland - ] ++ lib.optionals (nvidia.enable) [ - nvtopPackages.full - ]; -} diff --git a/modules/power.nix b/modules/power.nix deleted file mode 100644 index 8df4076..0000000 --- a/modules/power.nix +++ /dev/null @@ -1,14 +0,0 @@ -{ pkgs, config, ... }: with config.bchmnn; { - powerManagement = { - enable = true; - }; - - services.tlp = { - enable = !builtins.elem "gnome" gui.flavour; - settings = power.tlp.settings; - }; - - environment.systemPackages = with pkgs; [ - powertop - ]; -} diff --git a/modules/printing.nix b/modules/printing.nix deleted file mode 100644 index 2a11d72..0000000 --- a/modules/printing.nix +++ /dev/null @@ -1,26 +0,0 @@ -{ pkgs, lib, config, ... }: lib.mkIf config.bchmnn.printing.enable { - services.printing = { - enable = true; - drivers = [ - pkgs.mfcl3750cdwcupswrapper - ]; - }; - - services.avahi = { - enable = true; - nssmdns4 = true; - openFirewall = true; - }; - - hardware.printers = { - ensurePrinters = [ - { - name = "Brother-MFC-L3750CDW-series"; - location = "Home"; - deviceUri = "dnssd://Brother%20MFC-L3750CDW%20series._ipp._tcp.local/?uuid=e3248000-80ce-11db-8000-b4220094c09b"; - model = "brother_mfcl3750cdw_printer_en.ppd"; - } - ]; - ensureDefaultPrinter = "Brother-MFC-L3750CDW-series"; - }; -} diff --git a/modules/ratbag.nix b/modules/ratbag.nix deleted file mode 100644 index b47f7e9..0000000 --- a/modules/ratbag.nix +++ /dev/null @@ -1,3 +0,0 @@ -{ - services.ratbagd.enable = true; -} diff --git a/modules/security.nix b/modules/security.nix deleted file mode 100644 index 8ba9b4c..0000000 --- a/modules/security.nix +++ /dev/null @@ -1,19 +0,0 @@ -{ config, lib, ... }: { - - security.polkit.enable = true; - security.rtkit.enable = true; - networking.firewall.enable = true; - -} // (lib.mkIf (lib.elem "sway" config.bchmnn.gui.flavour) { - - # TODO workaround to get swaylock accepting pw - # https://github.com/NixOS/nixpkgs/issues/158025 - security.pam.services.swaylock = { }; - -}) // (lib.mkIf (config.bchmnn.devenv.enable) { - - networking.firewall = { - allowedTCPPorts = [ 3000 6969 8080 ]; - }; - -}) diff --git a/modules/services/default.nix b/modules/services/default.nix new file mode 100644 index 0000000..3e63e6d --- /dev/null +++ b/modules/services/default.nix @@ -0,0 +1,6 @@ +{ + imports = [ + ./flare-solvarr.nix + ./jackett.nix + ]; +} diff --git a/modules/services/flare-solvarr.nix b/modules/services/flare-solvarr.nix new file mode 100644 index 0000000..c1c48da --- /dev/null +++ b/modules/services/flare-solvarr.nix @@ -0,0 +1,26 @@ +{ config, lib, ... }: +{ + options.bchmnn.services.flare-solvarr = { + enable = lib.mkEnableOption "flare-solvarr"; + }; + + config = lib.mkIf (config.bchmnn.services.flare-solvarr.enable) { + virtualisation = { + oci-containers = { + containers = { + flare-solvarr = { + image = "ghcr.io/flaresolverr/flaresolverr:latest"; + autoStart = true; + ports = [ "127.0.0.1:8191:8191" ]; + environment = { + LOG_LEVEL = "info"; + LOG_HTML = "false"; + CAPTCHA_SOLVER = "hcaptcha-solver"; + TZ = "Europe/Berlin"; + }; + }; + }; + }; + }; + }; +} diff --git a/modules/services/jackett.nix b/modules/services/jackett.nix new file mode 100644 index 0000000..09a77cd --- /dev/null +++ b/modules/services/jackett.nix @@ -0,0 +1,12 @@ +{ config, lib, ... }: +{ + options.bchmnn.services.jackett = { + enable = lib.mkEnableOption "jackett"; + }; + + config = { + services.jackett = { + enable = config.bchmnn.services.jackett.enable; + }; + }; +} diff --git a/modules/services/syncthing.nix b/modules/services/syncthing.nix new file mode 100644 index 0000000..696b990 --- /dev/null +++ b/modules/services/syncthing.nix @@ -0,0 +1,90 @@ +{ lib, config, ... }: +lib.mkIf config.bchmnn.sync.enable { + + options.bchmnn.services.syncthing = { + enable = lib.mkEnableOption "syncthing"; + }; + + config = lib.mkIf (config.bchmnn.services.syncthing.enable) { + services.syncthing = { + enable = false; + openDefaultPorts = true; + + settings = { + devices = { + T430 = { + id = "UGQINNI-SC6F24X-5JE7YTP-LZLORTX-7GQ5NKK-YMRDRPK-JHRTWUV-4ILUJQQ"; + }; + IROH = { + id = "PJA2MBA-66PQQEO-5KICONS-FGHDH46-YRV2X5Y-47UUP77-QXI2WNS-R33FPAK"; + }; + }; + + folders = { + "dl" = { + path = "~/dl"; + id = "z97eb-myxtp"; + devices = [ + "IROH" + "T430" + ]; + }; + "docs" = { + path = "~/docs"; + id = "rhh6x-dmymv"; + devices = [ + "IROH" + "T430" + ]; + }; + "music" = { + path = "~/music"; + id = "umzur-ncrf6"; + devices = [ + "IROH" + "T430" + ]; + }; + "orgfiles" = { + path = "~/orgfiles"; + id = "0f5t9-dl5l5"; + devices = [ ]; + versioning = { + type = "simple"; + params.keep = "5"; + }; + }; + "pics" = { + path = "~/pics"; + id = "cuejs-esf7u"; + devices = [ + "IROH" + "T430" + ]; + }; + "tmp" = { + path = "~/tmp"; + id = "d6k5d-hdxyh"; + devices = [ + "IROH" + "T430" + ]; + }; + "vids" = { + path = "~/vids"; + id = "bjx9u-ujjwi"; + devices = [ + "IROH" + "T430" + ]; + }; + }; + }; + + user = "gandalf"; + group = "users"; + dataDir = "/home/gandalf"; + + }; + }; +} diff --git a/modules/shell.nix b/modules/shell.nix deleted file mode 100644 index c55412a..0000000 --- a/modules/shell.nix +++ /dev/null @@ -1,22 +0,0 @@ -{ pkgs, ... }: -let - aliases = import ./aliases.nix; -in -{ - programs.zsh = { - enable = true; - }; - - users.users.gandalf = { - shell = pkgs.zsh; - }; - - environment = { - shellAliases = aliases; - }; - - programs = { - htop.enable = true; - iftop.enable = true; - }; -} diff --git a/modules/steam.nix b/modules/steam.nix deleted file mode 100644 index df3cb72..0000000 --- a/modules/steam.nix +++ /dev/null @@ -1,10 +0,0 @@ -{ pkgs, config, lib, ... }: lib.mkIf config.bchmnn.games.enable { - programs.steam = { - enable = true; - }; - - environment.systemPackages = with pkgs; [ - mangohud - gamemode - ]; -} diff --git a/modules/syncthing.nix b/modules/syncthing.nix deleted file mode 100644 index ba3be30..0000000 --- a/modules/syncthing.nix +++ /dev/null @@ -1,89 +0,0 @@ -{ lib, config, ... }: lib.mkIf config.bchmnn.sync.enable { - - services.syncthing = { - enable = true; - openDefaultPorts = true; - - settings = { - devices = { - T430 = { - id = "UGQINNI-SC6F24X-5JE7YTP-LZLORTX-7GQ5NKK-YMRDRPK-JHRTWUV-4ILUJQQ"; - }; - IROH = { - id = "PJA2MBA-66PQQEO-5KICONS-FGHDH46-YRV2X5Y-47UUP77-QXI2WNS-R33FPAK"; - }; - J4M35-BL0ND = { - id = "R32FFUU-KZXHRUY-GPUOSQV-7ZBDQ5J-3EW2LHG-VAT6VZ7-WRTG46A-7CYCAQL"; - }; - }; - - folders = { - "dl" = { - path = "~/dl"; - id = "z97eb-myxtp"; - devices = [ - "IROH" - "T430" - ]; - }; - "docs" = { - path = "~/docs"; - id = "rhh6x-dmymv"; - devices = [ - "IROH" - "T430" - ]; - }; - "music" = { - path = "~/music"; - id = "umzur-ncrf6"; - devices = [ - "IROH" - "T430" - ]; - }; - "orgfiles" = { - path = "~/orgfiles"; - id = "0f5t9-dl5l5"; - devices = [ - "J4M35-BL0ND" - ]; - versioning = { - type = "simple"; - params.keep = "5"; - }; - }; - "pics" = { - path = "~/pics"; - id = "cuejs-esf7u"; - devices = [ - "IROH" - "T430" - ]; - }; - "tmp" = { - path = "~/tmp"; - id = "d6k5d-hdxyh"; - devices = [ - "IROH" - "T430" - ]; - }; - "vids" = { - path = "~/vids"; - id = "bjx9u-ujjwi"; - devices = [ - "IROH" - "T430" - ]; - }; - }; - }; - - user = "gandalf"; - group = "users"; - dataDir = "/home/gandalf"; - - }; - -} diff --git a/modules/tts.nix b/modules/tts.nix deleted file mode 100644 index 4d8194d..0000000 --- a/modules/tts.nix +++ /dev/null @@ -1,17 +0,0 @@ -{ lib, config, ... }: lib.mkIf config.bchmnn.ai.enable { - - virtualisation = { - oci-containers = { - containers = { - coqui-ai-tts = { - image = "ghcr.io/coqui-ai/tts:latest"; - autoStart = true; - ports = ["127.0.0.1:5002:5002"]; - entrypoint = "/bin/bash"; - cmd = []; - }; - }; - }; - }; - -} diff --git a/modules/udisks2.nix b/modules/udisks2.nix deleted file mode 100644 index fa4f855..0000000 --- a/modules/udisks2.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ ... }: { - # needed for udiskie - services.udisks2.enable = true; - # enable gvfs to mount android devices - services.gvfs.enable = true; -} diff --git a/modules/virtualisation.nix b/modules/virtualisation.nix deleted file mode 100644 index 47f5b25..0000000 --- a/modules/virtualisation.nix +++ /dev/null @@ -1,36 +0,0 @@ -{ config, lib, pkgs, ... }: lib.mkIf config.bchmnn.virtualisation.enable { - - # virt-manager - virtualisation = { - libvirtd.enable = true; - /* - podman = { - enable = true; - # create a `docker` alias for podman, to use it as a drop-in replacement - dockerCompat = true; - # required for containers under podman-compose to be able to talk to each other. - defaultNetwork.settings.dns_enabled = true; - }; - */ - docker = { - enable = true; - }; - oci-containers = { - backend = "docker"; - # backend = "podman"; - }; - containers = { - enable = true; - }; - }; - - hardware.nvidia-container-toolkit.enable = config.bchmnn.nvidia.enable; - - programs = { - dconf.enable = true; - virt-manager.enable = true; - }; - - environment.systemPackages = with pkgs; [ virtiofsd ]; - -} diff --git a/modules/vpn.nix b/modules/vpn.nix deleted file mode 100644 index f5f4bc6..0000000 --- a/modules/vpn.nix +++ /dev/null @@ -1,12 +0,0 @@ -{ pkgs, lib, config, ... }: lib.mkIf config.bchmnn.vpn.enable { - - environment.systemPackages = with pkgs; [ - openvpn3 - mullvad-vpn - ]; - - services.mullvad-vpn.enable = true; - - services.tailscale.enable = true; - -} diff --git a/modules/wine.nix b/modules/wine.nix deleted file mode 100644 index 41143de..0000000 --- a/modules/wine.nix +++ /dev/null @@ -1,5 +0,0 @@ -{ pkgs, ... }: { - environment.systemPackages = with pkgs; [ - wineWowPackages.waylandFull - ]; -} diff --git a/modules/xdg-portal.nix b/modules/xdg-portal.nix deleted file mode 100644 index 3fde11c..0000000 --- a/modules/xdg-portal.nix +++ /dev/null @@ -1,10 +0,0 @@ -{ lib, config, pkgs, ... }: lib.mkIf config.bchmnn.gui.enable { - xdg.portal = { - enable = true; - wlr.enable = true; - config.common.default = "*"; - extraPortals = with lib; with config.bchmnn; optionals (elem "sway" gui.flavour) [ - pkgs.xdg-desktop-portal-wlr - ]; - }; -} diff --git a/overlays/fonts/iglesia-light.nix b/overlays/fonts/iglesia-light.nix index 8693785..85f3205 100644 --- a/overlays/fonts/iglesia-light.nix +++ b/overlays/fonts/iglesia-light.nix @@ -1,4 +1,5 @@ -{ pkgs }: pkgs.stdenv.mkDerivation { +{ pkgs }: +pkgs.stdenv.mkDerivation { pname = "iglesia-light-typeface"; version = "1.009"; diff --git a/overlays/mfcl3750cdw.nix b/overlays/mfcl3750cdw.nix index 8b2e5f7..c3cca23 100644 --- a/overlays/mfcl3750cdw.nix +++ b/overlays/mfcl3750cdw.nix @@ -1,17 +1,17 @@ -{ pkgsi686Linux -, stdenv -, fetchurl -, dpkg -, makeWrapper -, coreutils -, ghostscript -, gnugrep -, gnused -, which -, perl -, lib +{ + pkgsi686Linux, + stdenv, + fetchurl, + dpkg, + makeWrapper, + coreutils, + ghostscript, + gnugrep, + gnused, + which, + perl, + lib, }: - let model = "mfcl3750cdw"; version = "1.0.2-0"; @@ -20,14 +20,16 @@ let sha256 = "3a0d5f09a265208fdd1b8266ef36286ec294c7a4befa327be81141efabe8590b"; }; reldir = "opt/brother/Printers/${model}/"; - in rec { driver = pkgsi686Linux.stdenv.mkDerivation rec { inherit src version; name = "${model}drv-${version}"; - nativeBuildInputs = [ dpkg makeWrapper ]; + nativeBuildInputs = [ + dpkg + makeWrapper + ]; unpackPhase = "dpkg-deb -x $src $out"; @@ -38,9 +40,15 @@ rec { --replace "BR_PRT_PATH =~" "BR_PRT_PATH = \"$dir\"; #" \ --replace "PRINTER =~" "PRINTER = \"${model}\"; #" wrapProgram $dir/lpd/filter_${model} \ - --prefix PATH : ${lib.makeBinPath [ - coreutils ghostscript gnugrep gnused which - ]} + --prefix PATH : ${ + lib.makeBinPath [ + coreutils + ghostscript + gnugrep + gnused + which + ] + } # need to use i686 glibc here, these are 32bit proprietary binaries patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \ $dir/lpd/brmfcl3750cdwfilter @@ -51,7 +59,10 @@ rec { homepage = "http://www.brother.com/"; sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ]; license = lib.licenses.unfree; - platforms = [ "x86_64-linux" "i686-linux" ]; + platforms = [ + "x86_64-linux" + "i686-linux" + ]; maintainers = [ lib.maintainers.bchmnn ]; }; }; @@ -60,7 +71,10 @@ rec { inherit version src; name = "${model}cupswrapper-${version}"; - nativeBuildInputs = [ dpkg makeWrapper ]; + nativeBuildInputs = [ + dpkg + makeWrapper + ]; unpackPhase = "dpkg-deb -x $src $out"; @@ -74,7 +88,13 @@ rec { --replace "PRINTER =~" "PRINTER = \"${model}\"; #" wrapProgram $dir/cupswrapper/brother_lpdwrapper_${model} \ - --prefix PATH : ${lib.makeBinPath [ coreutils gnugrep gnused ]} + --prefix PATH : ${ + lib.makeBinPath [ + coreutils + gnugrep + gnused + ] + } mkdir -p $out/lib/cups/filter mkdir -p $out/share/cups/model @@ -91,9 +111,11 @@ rec { homepage = "http://www.brother.com/"; sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ]; license = lib.licenses.gpl2; - platforms = [ "x86_64-linux" "i686-linux" ]; + platforms = [ + "x86_64-linux" + "i686-linux" + ]; maintainers = [ lib.maintainers.bchmnn ]; }; }; } - diff --git a/overlays/pppdf/default.nix b/overlays/pppdf/default.nix index 1cf671d..36f6393 100644 --- a/overlays/pppdf/default.nix +++ b/overlays/pppdf/default.nix @@ -1,4 +1,9 @@ -{ pkgs, lib, buildPythonApplication, python3Packages }: +{ + pkgs, + lib, + buildPythonApplication, + python3Packages, +}: buildPythonApplication { pname = "pppdf"; version = "1.0.0"; diff --git a/secrets/passwords/gitea/db.age b/secrets/passwords/gitea/db.age new file mode 100644 index 0000000000000000000000000000000000000000..64ac79a8584dd538e996d17679fec852fa5eb909 GIT binary patch literal 484 zcmYdHPt{G$OD?J`D9Oyv)5|YP*Do{V(zR14F3!+RO))YxHMCUlcMI`K4OB2P@N}~b zs|^F?j3_b+2sX^FD0I`#il|Jk@Z{1?bPEc!$P5dz2y+cE z4GAd`R*we*3B_pNO zBDp*wG(tPeJjgV}#3enj$hkn<#{}KB($t{Jsz8MjXJbcSXVU;T$L#bh_e{%Vp9s@n z%j_!C(lR%<^h^`i($wvPd&?gHW#XT?-?OZT|(H6H(um?|+W<$se}q&;CqEN#D*8ptHF*`Smf$)X>)S zwbBP3>%W`o&S<{q3g7JCCr?@^{*K>KT-I>x&i;") -unmap("t", "") -unmap("t", "") -unmap("t", "") diff --git a/users/gandalf/modules/neovim/config/lua/config/lazy.lua b/users/gandalf/modules/neovim/config/lua/config/lazy.lua deleted file mode 100644 index 33ab758..0000000 --- a/users/gandalf/modules/neovim/config/lua/config/lazy.lua +++ /dev/null @@ -1,60 +0,0 @@ -local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" -if not vim.loop.fs_stat(lazypath) then - -- bootstrap lazy.nvim - -- stylua: ignore - vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", "--branch=stable", lazypath }) -end -vim.opt.rtp:prepend(vim.env.LAZY or lazypath) - -require("lazy").setup({ - spec = { - -- add LazyVim and import its plugins - { "LazyVim/LazyVim", import = "lazyvim.plugins" }, - -- import any extras modules here - { import = "lazyvim.plugins.extras.coding.copilot" }, - { import = "lazyvim.plugins.extras.dap.core" }, - { import = "lazyvim.plugins.extras.dap.nlua" }, - { import = "lazyvim.plugins.extras.formatting.prettier" }, - { import = "lazyvim.plugins.extras.lang.clangd" }, - { import = "lazyvim.plugins.extras.lang.go" }, - { import = "lazyvim.plugins.extras.lang.java" }, - { import = "lazyvim.plugins.extras.lang.json" }, - { import = "lazyvim.plugins.extras.lang.markdown" }, - { import = "lazyvim.plugins.extras.lang.rust" }, - { import = "lazyvim.plugins.extras.lang.tailwind" }, - { import = "lazyvim.plugins.extras.lang.typescript" }, - { import = "lazyvim.plugins.extras.lang.yaml" }, - { import = "lazyvim.plugins.extras.linting.eslint" }, - -- { import = "lazyvim.plugins.extras.lang.typescript" }, - -- { import = "lazyvim.plugins.extras.lang.json" }, - -- { import = "lazyvim.plugins.extras.ui.mini-animate" }, - -- import/override with your plugins - { import = "plugins" }, - }, - defaults = { - -- By default, only LazyVim plugins will be lazy-loaded. Your custom plugins will load during startup. - -- If you know what you're doing, you can set this to `true` to have all your custom plugins lazy-loaded by default. - lazy = false, - -- It's recommended to leave version=false for now, since a lot the plugin that support versioning, - -- have outdated releases, which may break your Neovim install. - version = false, -- always use the latest git commit - -- version = "*", -- try installing the latest stable version for plugins that support semver - }, - install = { colorscheme = { "tokyonight", "habamax" } }, - checker = { enabled = true }, -- automatically check for plugin updates - performance = { - rtp = { - -- disable some rtp plugins - disabled_plugins = { - "gzip", - -- "matchit", - -- "matchparen", - -- "netrwPlugin", - "tarPlugin", - "tohtml", - "tutor", - "zipPlugin", - }, - }, - }, -}) diff --git a/users/gandalf/modules/neovim/config/lua/config/options.lua b/users/gandalf/modules/neovim/config/lua/config/options.lua deleted file mode 100644 index 77ef947..0000000 --- a/users/gandalf/modules/neovim/config/lua/config/options.lua +++ /dev/null @@ -1,6 +0,0 @@ --- Options are automatically loaded before lazy.nvim startup --- Default options that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/options.lua --- Add any additional options here - --- Set the filetype for .y files to be the same as .lex files -vim.api.nvim_exec([[ au BufRead,BufNewFile *.y set filetype=lex ]], false) diff --git a/users/gandalf/modules/neovim/config/lua/plugins/example.lua b/users/gandalf/modules/neovim/config/lua/plugins/example.lua deleted file mode 100644 index f84ebdc..0000000 --- a/users/gandalf/modules/neovim/config/lua/plugins/example.lua +++ /dev/null @@ -1,265 +0,0 @@ --- since this is just an example spec, don't actually load anything here and return an empty spec --- stylua: ignore -if true then return {} end - --- every spec file under the "plugins" directory will be loaded automatically by lazy.nvim --- --- In your plugin files, you can: --- * add extra plugins --- * disable/enabled LazyVim plugins --- * override the configuration of LazyVim plugins -return { - -- add gruvbox - { "ellisonleao/gruvbox.nvim" }, - - -- Configure LazyVim to load gruvbox - { - "LazyVim/LazyVim", - opts = { - colorscheme = "gruvbox", - }, - }, - - -- change trouble config - { - "folke/trouble.nvim", - -- opts will be merged with the parent spec - opts = { use_diagnostic_signs = true }, - }, - - -- disable trouble - { "folke/trouble.nvim", enabled = false }, - - -- add symbols-outline - { - "simrat39/symbols-outline.nvim", - cmd = "SymbolsOutline", - keys = { { "cs", "SymbolsOutline", desc = "Symbols Outline" } }, - config = true, - }, - - -- override nvim-cmp and add cmp-emoji - { - "hrsh7th/nvim-cmp", - dependencies = { "hrsh7th/cmp-emoji" }, - ---@param opts cmp.ConfigSchema - opts = function(_, opts) - table.insert(opts.sources, { name = "emoji" }) - end, - }, - - -- change some telescope options and a keymap to browse plugin files - { - "nvim-telescope/telescope.nvim", - keys = { - -- add a keymap to browse plugin files - -- stylua: ignore - { - "fp", - function() require("telescope.builtin").find_files({ cwd = require("lazy.core.config").options.root }) end, - desc = "Find Plugin File", - }, - }, - -- change some options - opts = { - defaults = { - layout_strategy = "horizontal", - layout_config = { prompt_position = "top" }, - sorting_strategy = "ascending", - winblend = 0, - }, - }, - }, - - -- add telescope-fzf-native - { - "telescope.nvim", - dependencies = { - "nvim-telescope/telescope-fzf-native.nvim", - build = "make", - config = function() - require("telescope").load_extension("fzf") - end, - }, - }, - - -- add pyright to lspconfig - { - "neovim/nvim-lspconfig", - ---@class PluginLspOpts - opts = { - ---@type lspconfig.options - servers = { - -- pyright will be automatically installed with mason and loaded with lspconfig - pyright = {}, - }, - }, - }, - - -- add tsserver and setup with typescript.nvim instead of lspconfig - { - "neovim/nvim-lspconfig", - dependencies = { - "jose-elias-alvarez/typescript.nvim", - init = function() - require("lazyvim.util").on_attach(function(_, buffer) - -- stylua: ignore - vim.keymap.set( "n", "co", "TypescriptOrganizeImports", { buffer = buffer, desc = "Organize Imports" }) - vim.keymap.set("n", "cR", "TypescriptRenameFile", { desc = "Rename File", buffer = buffer }) - end) - end, - }, - ---@class PluginLspOpts - opts = { - ---@type lspconfig.options - servers = { - -- tsserver will be automatically installed with mason and loaded with lspconfig - tsserver = {}, - }, - -- you can do any additional lsp server setup here - -- return true if you don't want this server to be setup with lspconfig - ---@type table - setup = { - -- example to setup with typescript.nvim - tsserver = function(_, opts) - require("typescript").setup({ server = opts }) - return true - end, - -- Specify * to use this function as a fallback for any server - -- ["*"] = function(server, opts) end, - }, - }, - }, - - -- for typescript, LazyVim also includes extra specs to properly setup lspconfig, - -- treesitter, mason and typescript.nvim. So instead of the above, you can use: - { import = "lazyvim.plugins.extras.lang.typescript" }, - - -- add more treesitter parsers - { - "nvim-treesitter/nvim-treesitter", - opts = { - ensure_installed = { - "bash", - "html", - "javascript", - "json", - "lua", - "markdown", - "markdown_inline", - "python", - "query", - "regex", - "tsx", - "typescript", - "vim", - "yaml", - }, - }, - }, - - -- since `vim.tbl_deep_extend`, can only merge tables and not lists, the code above - -- would overwrite `ensure_installed` with the new value. - -- If you'd rather extend the default config, use the code below instead: - { - "nvim-treesitter/nvim-treesitter", - opts = function(_, opts) - -- add tsx and treesitter - vim.list_extend(opts.ensure_installed, { - "tsx", - "typescript", - }) - end, - }, - - -- the opts function can also be used to change the default opts: - { - "nvim-lualine/lualine.nvim", - event = "VeryLazy", - opts = function(_, opts) - table.insert(opts.sections.lualine_x, "😄") - end, - }, - - -- or you can return new options to override all the defaults - { - "nvim-lualine/lualine.nvim", - event = "VeryLazy", - opts = function() - return { - --[[add your custom lualine config here]] - } - end, - }, - - -- use mini.starter instead of alpha - { import = "lazyvim.plugins.extras.ui.mini-starter" }, - - -- add jsonls and schemastore packages, and setup treesitter for json, json5 and jsonc - { import = "lazyvim.plugins.extras.lang.json" }, - - -- add any tools you want to have installed below - { - "williamboman/mason.nvim", - opts = { - ensure_installed = { - "stylua", - "shellcheck", - "shfmt", - "flake8", - }, - }, - }, - - -- Use for completion and snippets (supertab) - -- first: disable default and behavior in LuaSnip - { - "L3MON4D3/LuaSnip", - keys = function() - return {} - end, - }, - -- then: setup supertab in cmp - { - "hrsh7th/nvim-cmp", - dependencies = { - "hrsh7th/cmp-emoji", - }, - ---@param opts cmp.ConfigSchema - opts = function(_, opts) - local has_words_before = function() - unpack = unpack or table.unpack - local line, col = unpack(vim.api.nvim_win_get_cursor(0)) - return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil - end - - local luasnip = require("luasnip") - local cmp = require("cmp") - - opts.mapping = vim.tbl_extend("force", opts.mapping, { - [""] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_next_item() - -- You could replace the expand_or_jumpable() calls with expand_or_locally_jumpable() - -- this way you will only jump inside the snippet region - elseif luasnip.expand_or_jumpable() then - luasnip.expand_or_jump() - elseif has_words_before() then - cmp.complete() - else - fallback() - end - end, { "i", "s" }), - [""] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_prev_item() - elseif luasnip.jumpable(-1) then - luasnip.jump(-1) - else - fallback() - end - end, { "i", "s" }), - }) - end, - }, -} diff --git a/users/gandalf/modules/neovim/config/lua/plugins/mason.lua b/users/gandalf/modules/neovim/config/lua/plugins/mason.lua deleted file mode 100644 index 28491da..0000000 --- a/users/gandalf/modules/neovim/config/lua/plugins/mason.lua +++ /dev/null @@ -1,8 +0,0 @@ -return { - "williamboman/mason.nvim", - opts = function(_, opts) - opts.ensure_installed = opts.ensure_installed or {} - vim.list_extend(opts.ensure_installed, { "nil" }) - vim.list_extend(opts.ensure_installed, { "prisma-language-server" }) - end, -} diff --git a/users/gandalf/modules/neovim/config/lua/plugins/prisma.lua b/users/gandalf/modules/neovim/config/lua/plugins/prisma.lua deleted file mode 100644 index 1c2a803..0000000 --- a/users/gandalf/modules/neovim/config/lua/plugins/prisma.lua +++ /dev/null @@ -1,3 +0,0 @@ -return { - "prisma/vim-prisma" -} diff --git a/users/gandalf/modules/neovim/config/stylua.toml b/users/gandalf/modules/neovim/config/stylua.toml deleted file mode 100644 index 5d6c50d..0000000 --- a/users/gandalf/modules/neovim/config/stylua.toml +++ /dev/null @@ -1,3 +0,0 @@ -indent_type = "Spaces" -indent_width = 2 -column_width = 120 \ No newline at end of file diff --git a/users/gandalf/modules/packages.nix b/users/gandalf/modules/packages.nix deleted file mode 100644 index 651c394..0000000 --- a/users/gandalf/modules/packages.nix +++ /dev/null @@ -1,25 +0,0 @@ -{ pkgs, ... }: { - - home.packages = with pkgs; [ - gopass # slightly more awesome standard unix password manager for teams. written in go - gopass-jsonapi # enables communication with gopass via json messages - yt-dlp # command-line tool to download videos from youtube.com and other sites (youtube-dl fork) - ranger # a vim-inspired filemanager for the console - gdu # fast disk usage analyzer with console interface written in go - duf # disk usage/free utility - a better 'df' alternative - stress # simple workload generator for posix systems. it imposes a configurable amount of cpu, memory, i/o, and disk stress on the system - s-tui # stress-terminal ui monitoring tool - fio # flexible io tester - an io benchmark tool - ffmpeg # complete, cross-platform solution to record, convert and stream audio and video - texliveFull # tex live environment - imagemagick # software suite to create, edit, compose, or convert bitmap images - ghostscript # postscript interpreter (mainline version) - pdftk # command-line tool for working with pdfs - ventoy-full # bootable usb solution - unstable.isisdl # downloader for isis of tu-berlin - sage # open source mathematics software, free alternative to magma, maple, mathematica, and matlab - filebrowser # filebrowser is a web application for managing files and directories - anki # spaced repetition flashcard program - ]; - -} diff --git a/users/gandalf/modules/scripts/pomodoro.nix b/users/gandalf/modules/scripts/pomodoro.nix deleted file mode 100644 index e0a1282..0000000 --- a/users/gandalf/modules/scripts/pomodoro.nix +++ /dev/null @@ -1,23 +0,0 @@ -{ pkgs, ... }: -let - pootis = ./pootis.m4a; -in -{ - home.packages = [ - pkgs.openpomodoro-cli - (pkgs.writeShellScriptBin - "pomostart" - '' - clear - ${pkgs.openpomodoro-cli}/bin/openpomodoro-cli start --wait $@ - while ${pkgs.mpv}/bin/mpv ${pootis} > /dev/null 2>&1; do :; done - '') - (pkgs.writeShellScriptBin - "pomobreak" - '' - clear - ${pkgs.openpomodoro-cli}/bin/openpomodoro-cli break --wait $@ - while ${pkgs.mpv}/bin/mpv ${pootis} > /dev/null 2>&1; do :; done - '') - ]; -} diff --git a/users/gandalf/modules/ssh.nix b/users/gandalf/modules/ssh.nix deleted file mode 100644 index 555cba6..0000000 --- a/users/gandalf/modules/ssh.nix +++ /dev/null @@ -1,15 +0,0 @@ -{ ... }: { - programs.ssh = { - enable = true; - addKeysToAgent = "yes"; - includes = [ - "config.d/*" - ]; - }; - - home.file.".ssh/config.d/.keep".source = builtins.toFile "keep" ""; - - services.ssh-agent = { - enable = true; - }; -} diff --git a/users/gandalf/modules/tmux.nix b/users/gandalf/modules/tmux.nix deleted file mode 100644 index dafbcff..0000000 --- a/users/gandalf/modules/tmux.nix +++ /dev/null @@ -1,14 +0,0 @@ -{ - programs.tmux = { - enable = true; - newSession = true; - terminal = "screen-256color"; - - clock24 = true; - escapeTime = 0; - historyLimit = 10000; - - mouse = true; - keyMode = "vi"; - }; -} diff --git a/users/gandalf/modules/xdg.nix b/users/gandalf/modules/xdg.nix deleted file mode 100644 index c985019..0000000 --- a/users/gandalf/modules/xdg.nix +++ /dev/null @@ -1,16 +0,0 @@ -{ config, ... }: { - - xdg.userDirs = { - enable = true; - createDirectories = true; - desktop = "${config.home.homeDirectory}/tmp"; - documents = "${config.home.homeDirectory}/docs"; - download = "${config.home.homeDirectory}/dl"; - music = "${config.home.homeDirectory}/music"; - pictures = "${config.home.homeDirectory}/pics"; - publicShare = "${config.home.homeDirectory}/public"; - templates = "${config.home.homeDirectory}/templates"; - videos = "${config.home.homeDirectory}/vids"; - }; - -} diff --git a/users/gandalf/modules/yazi.nix b/users/gandalf/modules/yazi.nix deleted file mode 100644 index 3afcc8b..0000000 --- a/users/gandalf/modules/yazi.nix +++ /dev/null @@ -1,13 +0,0 @@ -{ pkgs, ... }: { - - home.packages = with pkgs; [ - exiftool - mediainfo - ueberzugpp - ]; - - programs.yazi = { - enable = true; - }; - -}