diff --git a/README.md b/README.md index 2d255db..a8c2f87 100644 --- a/README.md +++ b/README.md @@ -44,8 +44,9 @@ - [hosts](hosts): per-host configurations that contain machine specific configurations - [desktop](hosts/yoshino/): Desktop (yoshino) specific configuration - [sakura](hosts/sakura/): Laptop (sakura) specific configuration - - [sakura](hosts/ichiyo/): Laptop (ichiyo) specific configuration + - [ichiyo](hosts/ichiyo/): Laptop (ichiyo) specific configuration - [violet](hosts/violet/): Server (violet) specific configuration + - [dandelion](hosts/dandelion/): Server (dandelion) specific configuration - [modules](modules): modularized NixOS configurations - [core](modules/core/): core NixOS configuration - [homes](modules/home/): my [Home-Manager](https://github.com/nix-community/home-manager) config @@ -56,25 +57,22 @@ ### Components | | NixOS + Hyprland | | --------------------------- | :---------------------------------------------------------------------------------------------: -| **Window Manager** | [Hyprland][Hyprland] | -| **Bar** | [Waybar][waybar] | -| **Application Launcher** | [bemenu][bemenu] | -| **Notification Daemon** | [Mako][mako] | -| **Terminal Emulator** | [Kitty][kitty] | +| **Compositor** | [hyprland][hyprland] | +| **Bar** | [waybar][waybar] | +| **Application launcher** | [bemenu][bemenu] | +| **Notification daemon** | [swaync][swaync] | +| **Terminal emulator** | [kitty][kitty] | | **Shell** | [zsh][zsh] | -| **Text Editor** | [Neovim][Neovim] + [VSCodium][VSCodium] | -| **network management tool** | [NetworkManager][NetworkManager] + [network-manager-applet][network-manager-applet] | -| **System resource monitor** | [htop][htop] | -| **File Manager** | [thunar][thunar] -| **Fonts** | [nerd fonts][Nerd fonts] | -| **Color Scheme** | [catppuccin][Catppuccin] | -| **Icons** | [catppuccin-papirus-folders][catppuccin-papirus-folders] | +| **Text editor** | [neovim][neovim] | +| **Network management tool** | [networkmanager][networkmanager] | +| **File manager** | [thunar][thunar] +| **Fonts** | [nerd fonts][nerd fonts] | | **Lockscreen** | [swaylock][swaylock] | -| **Image Viewer** | [nsxiv][nsxiv] | -| **Media Player** | [mpv][mpv] | -| **Screenshot Software** | [grimblast][grimblast] | +| **Image viewer** | [nsxiv][nsxiv] + [imv] | +| **Media player** | [mpv][mpv] | +| **Screenshot software** | [grimblast][grimblast] | | **Clipboard** | [wl-clip-persist][wl-clip-persist] | -| **Color Picker** | [hyprpicker][hyprpicker] | +| **Color picker** | [hyprpicker][hyprpicker] | ### Shell aliases @@ -221,24 +219,22 @@ Other dotfiles that I learned / copy from: - [mrusme/dotfiles](https://github.com/mrusme/dotfiles) -[Hyprland]: https://github.com/hyprwm/Hyprland -[Kitty]: https://github.com/kovidgoyal/kitty -[Waybar]: https://github.com/Alexays/Waybar +[hyprland]: https://github.com/hyprwm/Hyprland +[kitty]: https://github.com/kovidgoyal/kitty +[waybar]: https://github.com/Alexays/Waybar [bemenu]: https://github.com/Cloudef/bemenu [zsh]: https://ohmyz.sh/ [swaylock]: https://github.com/swaywm/swaylock [mpv]: https://github.com/mpv-player/mpv [VSCodium]:https://vscodium.com/ -[Neovim]: https://github.com/neovim/neovim +[neovim]: https://github.com/neovim/neovim [grimblast]: https://github.com/hyprwm/contrib [htop]: https://github.com/htop-dev/htop [thunar]: https://docs.xfce.org/xfce/thunar/start [nsxiv]: https://nsxiv.codeberg.page -[mako]: https://github.com/emersion/mako +[swaync]: https://github.com/ErikReider/SwayNotificationCenter [nerd fonts]: https://github.com/ryanoasis/nerd-fonts -[NetworkManager]: https://wiki.gnome.org/Projects/NetworkManager +[networkmanager]: https://wiki.gnome.org/Projects/NetworkManager [network-manager-applet]: https://gitlab.gnome.org/GNOME/network-manager-applet/ [wl-clip-persist]: https://github.com/Linus789/wl-clip-persist [hyprpicker]: https://github.com/hyprwm/hyprpicker -[catppuccin]: https://github.com/catppuccin/catppuccin -[catppuccin-papirus-folders]: https://github.com/catppuccin/papirus-folders diff --git a/flake.nix b/flake.nix index 9d79e92..8db7ef7 100644 --- a/flake.nix +++ b/flake.nix @@ -84,6 +84,14 @@ ]; specialArgs = { host="violet"; inherit self inputs username; }; }; + dandelion = nixpkgs.lib.nixosSystem { + inherit system; + modules = [ + (import ./hosts/dandelion) + agenix.nixosModules.default + ]; + specialArgs = { host="dandelion"; inherit self inputs username; }; + }; vm = nixpkgs.lib.nixosSystem { inherit system; diff --git a/hosts/dandelion/default.nix b/hosts/dandelion/default.nix new file mode 100644 index 0000000..156210c --- /dev/null +++ b/hosts/dandelion/default.nix @@ -0,0 +1,45 @@ +{ pkgs, config, ... }: +{ + imports = [ + ./hardware-configuration.nix + ./variables.nix + ./../../modules/core/default.server.nix + ./../../modules/services/dandelion.nix + ]; + + networking.hostName = "dandelion"; + + nixpkgs.config.permittedInsecurePackages = [ + "jitsi-meet-1.0.8043" + "olm-3.2.16" + ]; + + time.timeZone = "Europe/Amsterdam"; + + environment.systemPackages = with pkgs; [ + kitty.terminfo + zfs + ]; + + boot = { + loader = { + systemd-boot.enable = true; + efi.canTouchEfiVariables = true; + }; + supportedFilesystems = [ "zfs" ]; + }; + + networking.hostId = "8a6b2565"; + + services.zfs = { + autoScrub.enable = true; + trim.enable = true; + }; + + boot.zfs.extraPools = [ "terrabite" ]; + + # fileSystems."/terrabite/main" = { + # device = "terrabite/main"; + # fsType = "zfs"; + # }; +} diff --git a/hosts/dandelion/hardware-configuration.nix b/hosts/dandelion/hardware-configuration.nix new file mode 100644 index 0000000..a42c81a --- /dev/null +++ b/hosts/dandelion/hardware-configuration.nix @@ -0,0 +1,39 @@ +# Do not modify this file! It was generated by ‘nixos-generate-config’ +# and may be overwritten by future invocations. Please make changes +# to /etc/nixos/configuration.nix instead. +{ config, lib, pkgs, modulesPath, ... }: + +{ + imports = + [ (modulesPath + "/installer/scan/not-detected.nix") + ]; + + boot = { + initrd = { + availableKernelModules = [ "ahci" "xhci_pci" "usbhid" "usb_storage" "sd_mod" ]; # "uhci_pci" + kernelModules = [ ]; + }; + kernelModules = [ "kvm-intel" ]; + extraModulePackages = [ ]; + }; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/adb2894c-18f5-466a-b340-70b71b479f51"; + fsType = "ext4"; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/D8DA-9F5E"; + fsType = "vfat"; + options = [ "fmask=0077" "dmask=0077" ]; + }; + + swapDevices = [ ]; + + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.eno1.useDHCP = lib.mkDefault true; + # networking.interfaces.eno2.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/hosts/dandelion/variables.nix b/hosts/dandelion/variables.nix new file mode 100644 index 0000000..241d088 --- /dev/null +++ b/hosts/dandelion/variables.nix @@ -0,0 +1,17 @@ +{ + lib, + config, + ... +}: let + inherit (lib) mkOption types; + inherit (config.liv) variables; +in { + options.liv.variables.dandelion = { + thisMachine = mkOption { + default = "dandelion.srv.${variables.primaryDomain}"; + type = types.str; + readOnly = true; + description = "Domain of this specific machine"; + }; + }; +} diff --git a/hosts/sakura/default.nix b/hosts/sakura/default.nix index b349bb1..8b47543 100644 --- a/hosts/sakura/default.nix +++ b/hosts/sakura/default.nix @@ -24,6 +24,7 @@ laptop.enable = true; desktop.enable = true; creative.enable = true; + amdgpu.enable = true; }; services.hardware.bolt.enable = true; diff --git a/hosts/violet/default.nix b/hosts/violet/default.nix index df62967..44c7b20 100644 --- a/hosts/violet/default.nix +++ b/hosts/violet/default.nix @@ -2,7 +2,7 @@ { imports = [ ./hardware-configuration.nix - ./../../modules/core/default.violet.nix + ./../../modules/core/default.server.nix ./../../modules/services/violet.nix ]; @@ -25,6 +25,8 @@ nvidia.open = false; # Set to false/true for proprietary/open drivers }; + liv.nvidia.enable = true; + services.xserver.videoDrivers = [ "nvidia" ]; boot = { diff --git a/hosts/yoshino/default.nix b/hosts/yoshino/default.nix index 08dfdb7..1098a2d 100644 --- a/hosts/yoshino/default.nix +++ b/hosts/yoshino/default.nix @@ -16,6 +16,7 @@ liv = { desktop.enable = true; creative.enable = true; + amdgpu.enable = true; }; networking = { diff --git a/modules/core/default.violet.nix b/modules/core/default.server.nix similarity index 100% rename from modules/core/default.violet.nix rename to modules/core/default.server.nix diff --git a/modules/core/hardware.nix b/modules/core/hardware.nix index c727176..ca598dc 100644 --- a/modules/core/hardware.nix +++ b/modules/core/hardware.nix @@ -1,18 +1,7 @@ { pkgs, ... }: { - hardware = { - graphics = { - enable = true; - }; - enableRedistributableFirmware = true; - opengl = { - extraPackages = with pkgs; [ - amdvlk - ]; - # For 32 bit applications as well - extraPackages32 = with pkgs; [ - driversi686Linux.amdvlk - ]; - }; + services.smartd = { + enable = true; + autodetect = true; }; } diff --git a/modules/core/user.nix b/modules/core/user.nix index 931b456..fa4a29b 100644 --- a/modules/core/user.nix +++ b/modules/core/user.nix @@ -1,6 +1,6 @@ { pkgs, inputs, config, username, host, ...}: { - imports = [ inputs.home-manager.nixosModules.home-manager ] ++ [ ./../../roles ]; + imports = [ inputs.home-manager.nixosModules.home-manager ] ++ [ ./../../roles ] ++ [./../../variables.nix]; home-manager = { useUserPackages = true; useGlobalPkgs = true; @@ -10,7 +10,9 @@ if (host == "desktop") then [ ./../home/default.desktop.nix ] else if (host == "violet") then - [ ./../home/default.violet.nix ] + [ ./../home/default.server.nix ] + else if (host == "dandelion") then + [ ./../home/default.server.nix ] else if (host == "yoshino") then [ ./../home/default.yoshino.nix ] else [ ./../home ]; diff --git a/modules/home/default.violet.nix b/modules/home/default.server.nix similarity index 84% rename from modules/home/default.violet.nix rename to modules/home/default.server.nix index 357a630..54cdaab 100644 --- a/modules/home/default.violet.nix +++ b/modules/home/default.server.nix @@ -2,7 +2,7 @@ imports = [(import ./git.nix)] # version control ++ [(import ./nvim.nix)] # neovim editor - ++ [(import ./packages.violet.nix)] # other packages + ++ [(import ./packages.server.nix)] # other packages ++ [(import ./scripts/scripts.nix)] # personal scripts ++ [(import ./zsh.nix)] # shell ++ [(import ./tmux.nix)]; # terminal multiplexer diff --git a/modules/home/hyprland/config.nix b/modules/home/hyprland/config.nix index 1e559df..344db6c 100644 --- a/modules/home/hyprland/config.nix +++ b/modules/home/hyprland/config.nix @@ -28,18 +28,18 @@ color = "black"; }; }; - # cursorTheme = { - # name = "Bibata-Modern-Ice"; - # package = pkgs.bibata-cursors; - # size = 24; - # }; + cursorTheme = { + name = "Bibata-Modern-Ice"; + package = pkgs.bibata-cursors; + size = 24; + }; }; - # home.pointerCursor = { - # name = "Bibata-Modern-Ice"; - # package = pkgs.bibata-cursors; - # size = 24; - # }; + home.pointerCursor = { + name = "Bibata-Modern-Ice"; + package = pkgs.bibata-cursors; + size = 24; + }; # gtk = { # enable = true; @@ -84,7 +84,7 @@ source = "~/nixos-config/modules/home/hyprland/displays.conf"; "debug:disable_scale_checks" = true; - monitor = "eDP-1, 2256x1504@60, 0x0, 1.5"; + monitor = "eDP-1, 2256x1504@60, 0x0, 1.5"; # this works as I only have one computer using eDP-1 as a display, I could also add LVDS or DP-1 since that'd also be machine-specific. # autostart exec-once = [ @@ -124,7 +124,6 @@ border_size = 2; "col.active_border" = "rgb(cda5ef) rgb(cda5ef) 45deg"; "col.inactive_border" = "0x00000000"; - border_part_of_window = false; no_border_on_floating = false; }; @@ -227,6 +226,8 @@ "$mainMod SHIFT, V, exec, cliphist list | bemenu -l 5 --ignorecase | cliphist decode | wl-copy" "$mainMod SHIFT, F, exec, librewolf" + "$mainMod SHIFT, C, exec, chromium" + "$mainMod SHIFT, Q, exec, qutebrowser" "$mainMod SHIFT, W, exec, wdisplays" "$mainMod SHIFT, T, exec, thunderbird" "$mainMod SHIFT, E, exec, element-desktop" diff --git a/modules/home/packages.nix b/modules/home/packages.nix index 783fb4d..edbfbcf 100644 --- a/modules/home/packages.nix +++ b/modules/home/packages.nix @@ -24,6 +24,7 @@ python3 # CLI shit + termpdfpy vimv iamb pass @@ -51,9 +52,8 @@ spotify-player nodejs_22 yarn - # wikit # Wikipedia summaries from the terminal, not added to Nix yet - # reader # Firefox reader mode but in the terminal, not added to Nix yet - # pastel # generate, analyze, convert and manipulate colors + # wikit + # reader # GUI shit element-desktop @@ -61,8 +61,9 @@ anki-bin obs-studio wdisplays - librewolf - ungoogled-chromium + librewolf # main + ungoogled-chromium # for things that don't work with librewolf + qutebrowser # focus nsxiv libreoffice xfce.thunar diff --git a/modules/home/packages.violet.nix b/modules/home/packages.server.nix similarity index 92% rename from modules/home/packages.violet.nix rename to modules/home/packages.server.nix index 6516855..c743637 100644 --- a/modules/home/packages.violet.nix +++ b/modules/home/packages.server.nix @@ -14,11 +14,6 @@ ripgrep yt-dlp neofetch - yarn - - # C / C++ - gcc - gnumake # Python python3 diff --git a/modules/services/dandelion.nix b/modules/services/dandelion.nix new file mode 100644 index 0000000..2383c3d --- /dev/null +++ b/modules/services/dandelion.nix @@ -0,0 +1,7 @@ +{ ... }: { + imports = + [(import ./docker.nix)] + ++ [(import ./immich.nix)] + ++ [(import ./nextcloud.nix)] + ++ [(import ./scrutiny.nix)]; +} diff --git a/modules/services/immich.nix b/modules/services/immich.nix new file mode 100644 index 0000000..301f192 --- /dev/null +++ b/modules/services/immich.nix @@ -0,0 +1,22 @@ +{ config, ... }: { + services.immich = { + enable = true; + port = 2283; + }; + + # services.nginx.virtualHosts."" = { + # enableACME = true; + # forceSSL = true; + # locations."/" = { + # proxyPass = "http://localhost:${toString config.services.immich.port}"; + # proxyWebsockets = true; + # recommendedProxySettings = true; + # extraConfig = '' + # client_max_body_size 50000M; + # proxy_read_timeout 600s; + # proxy_send_timeout 600s; + # send_timeout 600s; + # ''; + # }; + # }; +} diff --git a/modules/services/nextcloud.nix b/modules/services/nextcloud.nix new file mode 100644 index 0000000..9c3edc2 --- /dev/null +++ b/modules/services/nextcloud.nix @@ -0,0 +1,31 @@ +{ ... }: { + services.nextcloud = { + enable = true; + config.dbtype = "sqlite"; + configureRedis = true; + home = "/home/liv/nextcloud"; + config.adminpassFile = "/run/nextcloud/adminpassFile"; + maxUploadSize = "25G"; + https = true; + hostName = "dandelion.srv.liv.town"; + settings = { + trusted_domains = [ + "dandelion.srv.liv.town" + "files.dandelion.srv.liv.town" + ]; + enabledPreviewProviders = [ + "OC\\Preview\\BMP" + "OC\\Preview\\GIF" + "OC\\Preview\\JPEG" + "OC\\Preview\\Krita" + "OC\\Preview\\MarkDown" + "OC\\Preview\\MP3" + "OC\\Preview\\OpenDocument" + "OC\\Preview\\PNG" + "OC\\Preview\\TXT" + "OC\\Preview\\XBitmap" + "OC\\Preview\\HEIC" + ]; + }; + }; +} diff --git a/modules/services/scrutiny.nix b/modules/services/scrutiny.nix index ebe64d8..d249682 100644 --- a/modules/services/scrutiny.nix +++ b/modules/services/scrutiny.nix @@ -1,18 +1,16 @@ -{ ... }: - -{ +{ config, ... }: { services.scrutiny = { enable = true; collector.enable = true; settings.web.listen.port = 8181; settings.notify.urls = [ - "ntfy://notify.liv.town/violet" + "ntfy://${config.liv.variables.ntfyURL}/${config.networking.hostName}" ]; }; - services.nginx.virtualHosts."scrutiny.liv.town" = { - locations."/" = { - proxyPass = "http://localhost:8181/"; - }; - }; + # services.nginx.virtualHosts."" = { + # locations."/" = { + # proxyPass = "http://localhost:8181/"; + # }; + # }; } diff --git a/roles/amdgpu.nix b/roles/amdgpu.nix new file mode 100644 index 0000000..8d017f1 --- /dev/null +++ b/roles/amdgpu.nix @@ -0,0 +1,31 @@ +{ lib, pkgs, config, ... }: +with lib; +let + cfg = config.liv.amdgpu; +in { + options.liv.amdgpu = { + enable = mkEnableOption "Enable amdgpu drivers"; + }; + + config = mkIf cfg.enable { + hardware = { + graphics = { + enable = true; + }; + enableRedistributableFirmware = true; + opengl = { + extraPackages = with pkgs; [ + amdvlk + ]; + # For 32 bit applications as well + extraPackages32 = with pkgs; [ + driversi686Linux.amdvlk + ]; + }; + }; + + environment.systemPackages = with pkgs; [ + amdvlk + ]; + }; +} diff --git a/roles/default.nix b/roles/default.nix index 48842f5..b89d962 100644 --- a/roles/default.nix +++ b/roles/default.nix @@ -2,6 +2,8 @@ { imports = [(import ./laptop.nix)] + ++ [(import ./amdgpu.nix)] + ++ [(import ./nvidia.nix)] ++ [(import ./desktop.nix)] ++ [(import ./creative.nix)]; } diff --git a/roles/nvidia.nix b/roles/nvidia.nix new file mode 100644 index 0000000..e6c2aba --- /dev/null +++ b/roles/nvidia.nix @@ -0,0 +1,31 @@ +{ lib, pkgs, config, ... }: +with lib; +let + cfg = config.liv.nvidia; +in { + options.liv.nvidia = { + enable = mkEnableOption "Enable NVIDIA drivers"; + }; + + config = mkIf cfg.enable { + hardware = { + graphics = { + enable = true; + }; + enableRedistributableFirmware = true; + opengl = { + extraPackages = with pkgs; [ + # amdvlk + ]; + # For 32 bit applications as well + extraPackages32 = with pkgs; [ + # driversi686Linux.amdvlk + ]; + }; + }; + + environment.systemPackages = with pkgs; [ + # amdvlk + ]; + }; +} diff --git a/variables.nix b/variables.nix new file mode 100644 index 0000000..19dce5c --- /dev/null +++ b/variables.nix @@ -0,0 +1,24 @@ +{ + lib, + config, + ... +}: let + inherit (lib) mkOption types; + inherit (config.liv) variables; +in { + options.liv.variables = { + primaryDomain = mkOption { + default = "liv.town"; + type = types.str; + readOnly = true; + description = "My primary domain"; + }; + + ntfyURL = mkOption { + default = "notify.${variables.liv.primaryDomain}"; + type = types.str; + readOnly = true; + description = "Notification service"; + }; + }; +}