From c8f81f419065d863f5effe528b9c76a199c70128 Mon Sep 17 00:00:00 2001 From: Fern Garden Date: Mon, 4 Aug 2025 18:32:17 +0800 Subject: [PATCH] Switch to Niri WM --- flake.lock | 427 +++++++++++++++++++++- flake.nix | 12 + helpers.nix | 29 +- home.nix | 15 - hosts/docker/default.nix | 5 +- hosts/muskduck/default.nix | 25 -- overlay.nix | 117 +++--- packages/yazi-flavour-gruvbox/default.nix | 21 -- suites/default.nix | 263 +++---------- suites/desktop/default.nix | 153 +++----- suites/desktop/home.nix | 368 +++++++++++++++++++ suites/home.nix | 195 ++++++++++ suites/server/home.nix | 3 + suites/server/lxc/home.nix | 3 + suites/server/vm/home.nix | 3 + 15 files changed, 1196 insertions(+), 443 deletions(-) delete mode 100644 home.nix delete mode 100644 packages/yazi-flavour-gruvbox/default.nix create mode 100644 suites/desktop/home.nix create mode 100644 suites/home.nix create mode 100644 suites/server/home.nix create mode 100644 suites/server/lxc/home.nix create mode 100644 suites/server/vm/home.nix diff --git a/flake.lock b/flake.lock index 2aa4541..f92ae84 100755 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,72 @@ { "nodes": { + "base16": { + "inputs": { + "fromYaml": "fromYaml" + }, + "locked": { + "lastModified": 1746562888, + "narHash": "sha256-YgNJQyB5dQiwavdDFBMNKk1wyS77AtdgDk/VtU6wEaI=", + "owner": "SenchoPens", + "repo": "base16.nix", + "rev": "806a1777a5db2a1ef9d5d6f493ef2381047f2b89", + "type": "github" + }, + "original": { + "owner": "SenchoPens", + "repo": "base16.nix", + "type": "github" + } + }, + "base16-fish": { + "flake": false, + "locked": { + "lastModified": 1622559957, + "narHash": "sha256-PebymhVYbL8trDVVXxCvZgc0S5VxI7I1Hv4RMSquTpA=", + "owner": "tomyun", + "repo": "base16-fish", + "rev": "2f6dd973a9075dabccd26f1cded09508180bf5fe", + "type": "github" + }, + "original": { + "owner": "tomyun", + "repo": "base16-fish", + "type": "github" + } + }, + "base16-helix": { + "flake": false, + "locked": { + "lastModified": 1748408240, + "narHash": "sha256-9M2b1rMyMzJK0eusea0x3lyh3mu5nMeEDSc4RZkGm+g=", + "owner": "tinted-theming", + "repo": "base16-helix", + "rev": "6c711ab1a9db6f51e2f6887cc3345530b33e152e", + "type": "github" + }, + "original": { + "owner": "tinted-theming", + "repo": "base16-helix", + "type": "github" + } + }, + "base16-vim": { + "flake": false, + "locked": { + "lastModified": 1732806396, + "narHash": "sha256-e0bpPySdJf0F68Ndanwm+KWHgQiZ0s7liLhvJSWDNsA=", + "owner": "tinted-theming", + "repo": "base16-vim", + "rev": "577fe8125d74ff456cf942c733a85d769afe58b7", + "type": "github" + }, + "original": { + "owner": "tinted-theming", + "repo": "base16-vim", + "rev": "577fe8125d74ff456cf942c733a85d769afe58b7", + "type": "github" + } + }, "crane": { "locked": { "lastModified": 1752946753, @@ -35,6 +102,22 @@ "type": "github" } }, + "firefox-gnome-theme": { + "flake": false, + "locked": { + "lastModified": 1748383148, + "narHash": "sha256-pGvD/RGuuPf/4oogsfeRaeMm6ipUIznI2QSILKjKzeA=", + "owner": "rafaelmardojai", + "repo": "firefox-gnome-theme", + "rev": "4eb2714fbed2b80e234312611a947d6cb7d70caf", + "type": "github" + }, + "original": { + "owner": "rafaelmardojai", + "repo": "firefox-gnome-theme", + "type": "github" + } + }, "flake-compat": { "flake": false, "locked": { @@ -109,6 +192,27 @@ "type": "github" } }, + "flake-parts_3": { + "inputs": { + "nixpkgs-lib": [ + "stylix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1749398372, + "narHash": "sha256-tYBdgS56eXYaWVW3fsnPQ/nFlgWi/Z2Ymhyu21zVM98=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "9305fe4e5c2a6fcf5ba6a3ff155720fbe4076569", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, "flake-utils": { "inputs": { "systems": "systems_2" @@ -127,6 +231,22 @@ "type": "github" } }, + "fromYaml": { + "flake": false, + "locked": { + "lastModified": 1731966426, + "narHash": "sha256-lq95WydhbUTWig/JpqiB7oViTcHFP8Lv41IGtayokA8=", + "owner": "SenchoPens", + "repo": "fromYaml", + "rev": "106af9e2f715e2d828df706c386a685698f3223b", + "type": "github" + }, + "original": { + "owner": "SenchoPens", + "repo": "fromYaml", + "type": "github" + } + }, "gitignore": { "inputs": { "nixpkgs": [ @@ -149,6 +269,23 @@ "type": "github" } }, + "gnome-shell": { + "flake": false, + "locked": { + "lastModified": 1744584021, + "narHash": "sha256-0RJ4mJzf+klKF4Fuoc8VN8dpQQtZnKksFmR2jhWE1Ew=", + "owner": "GNOME", + "repo": "gnome-shell", + "rev": "52c517c8f6c199a1d6f5118fae500ef69ea845ae", + "type": "github" + }, + "original": { + "owner": "GNOME", + "ref": "48.1", + "repo": "gnome-shell", + "type": "github" + } + }, "home-manager": { "inputs": { "nixpkgs": [ @@ -223,6 +360,64 @@ "type": "github" } }, + "niri": { + "inputs": { + "niri-stable": "niri-stable", + "niri-unstable": "niri-unstable", + "nixpkgs": [ + "nixpkgs" + ], + "nixpkgs-stable": "nixpkgs-stable", + "xwayland-satellite-stable": "xwayland-satellite-stable", + "xwayland-satellite-unstable": "xwayland-satellite-unstable" + }, + "locked": { + "lastModified": 1754098183, + "narHash": "sha256-xiDTiBJlApXRiuTmOrdGaiJzs33lIdQepyCI8r9hy5w=", + "owner": "sodiboo", + "repo": "niri-flake", + "rev": "f2a7b326dc420360a66a542f2262081763f0f9ab", + "type": "github" + }, + "original": { + "owner": "sodiboo", + "repo": "niri-flake", + "type": "github" + } + }, + "niri-stable": { + "flake": false, + "locked": { + "lastModified": 1748151941, + "narHash": "sha256-z4viQZLgC2bIJ3VrzQnR+q2F3gAOEQpU1H5xHtX/2fs=", + "owner": "YaLTeR", + "repo": "niri", + "rev": "8ba57fcf25d2fc9565131684a839d58703f1dae7", + "type": "github" + }, + "original": { + "owner": "YaLTeR", + "ref": "v25.05.1", + "repo": "niri", + "type": "github" + } + }, + "niri-unstable": { + "flake": false, + "locked": { + "lastModified": 1753983552, + "narHash": "sha256-xnPPjASWt4/u+GmRdrHADBKKSCtIhTFY53CSKM+Xtfk=", + "owner": "YaLTeR", + "repo": "niri", + "rev": "91b6a111cf228fadaabba706d8f4d155efc63b3a", + "type": "github" + }, + "original": { + "owner": "YaLTeR", + "repo": "niri", + "type": "github" + } + }, "nixos-hardware": { "locked": { "lastModified": 1753122741, @@ -270,6 +465,22 @@ "type": "github" } }, + "nixpkgs-stable": { + "locked": { + "lastModified": 1754028485, + "narHash": "sha256-IiiXB3BDTi6UqzAZcf2S797hWEPCRZOwyNThJIYhUfk=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "59e69648d345d6e8fef86158c555730fa12af9de", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-25.05", + "repo": "nixpkgs", + "type": "github" + } + }, "nixpkgs-unstable": { "locked": { "lastModified": 1753694789, @@ -325,6 +536,32 @@ "type": "github" } }, + "nur": { + "inputs": { + "flake-parts": [ + "stylix", + "flake-parts" + ], + "nixpkgs": [ + "stylix", + "nixpkgs" + ], + "treefmt-nix": "treefmt-nix" + }, + "locked": { + "lastModified": 1751320053, + "narHash": "sha256-3m6RMw0FbbaUUa01PNaMLoO7D99aBClmY5ed9V3vz+0=", + "owner": "nix-community", + "repo": "NUR", + "rev": "cbde1735782f9c2bb2c63d5e05fba171a14a4670", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "NUR", + "type": "github" + } + }, "nuschtosSearch": { "inputs": { "flake-utils": "flake-utils", @@ -379,13 +616,15 @@ "deploy-rs": "deploy-rs", "home-manager": "home-manager", "lanzaboote": "lanzaboote", + "niri": "niri", "nixos-hardware": "nixos-hardware", "nixpkgs": "nixpkgs_2", "nixpkgs-pr-feishin": "nixpkgs-pr-feishin", "nixpkgs-unstable": "nixpkgs-unstable", "nixvim": "nixvim", "secrets": "secrets", - "sops-nix": "sops-nix" + "sops-nix": "sops-nix", + "stylix": "stylix" } }, "rust-overlay": { @@ -446,6 +685,41 @@ "type": "github" } }, + "stylix": { + "inputs": { + "base16": "base16", + "base16-fish": "base16-fish", + "base16-helix": "base16-helix", + "base16-vim": "base16-vim", + "firefox-gnome-theme": "firefox-gnome-theme", + "flake-parts": "flake-parts_3", + "gnome-shell": "gnome-shell", + "nixpkgs": [ + "nixpkgs" + ], + "nur": "nur", + "systems": "systems_4", + "tinted-foot": "tinted-foot", + "tinted-kitty": "tinted-kitty", + "tinted-schemes": "tinted-schemes", + "tinted-tmux": "tinted-tmux", + "tinted-zed": "tinted-zed" + }, + "locked": { + "lastModified": 1753979771, + "narHash": "sha256-MdMdQymbivEWWkC5HqeLYtP8FYu0SqiSpiRlyw9Fm3Y=", + "owner": "danth", + "repo": "stylix", + "rev": "5b81b0c4fbab3517b39d63f493760d33287150ad", + "type": "github" + }, + "original": { + "owner": "danth", + "ref": "release-25.05", + "repo": "stylix", + "type": "github" + } + }, "systems": { "locked": { "lastModified": 1681028828, @@ -491,6 +765,124 @@ "type": "github" } }, + "systems_4": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "tinted-foot": { + "flake": false, + "locked": { + "lastModified": 1726913040, + "narHash": "sha256-+eDZPkw7efMNUf3/Pv0EmsidqdwNJ1TaOum6k7lngDQ=", + "owner": "tinted-theming", + "repo": "tinted-foot", + "rev": "fd1b924b6c45c3e4465e8a849e67ea82933fcbe4", + "type": "github" + }, + "original": { + "owner": "tinted-theming", + "repo": "tinted-foot", + "rev": "fd1b924b6c45c3e4465e8a849e67ea82933fcbe4", + "type": "github" + } + }, + "tinted-kitty": { + "flake": false, + "locked": { + "lastModified": 1735730497, + "narHash": "sha256-4KtB+FiUzIeK/4aHCKce3V9HwRvYaxX+F1edUrfgzb8=", + "owner": "tinted-theming", + "repo": "tinted-kitty", + "rev": "de6f888497f2c6b2279361bfc790f164bfd0f3fa", + "type": "github" + }, + "original": { + "owner": "tinted-theming", + "repo": "tinted-kitty", + "type": "github" + } + }, + "tinted-schemes": { + "flake": false, + "locked": { + "lastModified": 1750770351, + "narHash": "sha256-LI+BnRoFNRa2ffbe3dcuIRYAUcGklBx0+EcFxlHj0SY=", + "owner": "tinted-theming", + "repo": "schemes", + "rev": "5a775c6ffd6e6125947b393872cde95867d85a2a", + "type": "github" + }, + "original": { + "owner": "tinted-theming", + "repo": "schemes", + "type": "github" + } + }, + "tinted-tmux": { + "flake": false, + "locked": { + "lastModified": 1751159871, + "narHash": "sha256-UOHBN1fgHIEzvPmdNMHaDvdRMgLmEJh2hNmDrp3d3LE=", + "owner": "tinted-theming", + "repo": "tinted-tmux", + "rev": "bded5e24407cec9d01bd47a317d15b9223a1546c", + "type": "github" + }, + "original": { + "owner": "tinted-theming", + "repo": "tinted-tmux", + "type": "github" + } + }, + "tinted-zed": { + "flake": false, + "locked": { + "lastModified": 1751158968, + "narHash": "sha256-ksOyv7D3SRRtebpXxgpG4TK8gZSKFc4TIZpR+C98jX8=", + "owner": "tinted-theming", + "repo": "base16-zed", + "rev": "86a470d94204f7652b906ab0d378e4231a5b3384", + "type": "github" + }, + "original": { + "owner": "tinted-theming", + "repo": "base16-zed", + "type": "github" + } + }, + "treefmt-nix": { + "inputs": { + "nixpkgs": [ + "stylix", + "nur", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1733222881, + "narHash": "sha256-JIPcz1PrpXUCbaccEnrcUS8jjEb/1vJbZz5KkobyFdM=", + "owner": "numtide", + "repo": "treefmt-nix", + "rev": "49717b5af6f80172275d47a418c9719a31a78b53", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "treefmt-nix", + "type": "github" + } + }, "utils": { "inputs": { "systems": "systems" @@ -508,6 +900,39 @@ "repo": "flake-utils", "type": "github" } + }, + "xwayland-satellite-stable": { + "flake": false, + "locked": { + "lastModified": 1748488455, + "narHash": "sha256-IiLr1alzKFIy5tGGpDlabQbe6LV1c9ABvkH6T5WmyRI=", + "owner": "Supreeeme", + "repo": "xwayland-satellite", + "rev": "3ba30b149f9eb2bbf42cf4758d2158ca8cceef73", + "type": "github" + }, + "original": { + "owner": "Supreeeme", + "ref": "v0.6", + "repo": "xwayland-satellite", + "type": "github" + } + }, + "xwayland-satellite-unstable": { + "flake": false, + "locked": { + "lastModified": 1752338000, + "narHash": "sha256-Fxlp/yKtynug0jyuauAmvZU2SzHCfwlwWf85j+IvQ0U=", + "owner": "Supreeeme", + "repo": "xwayland-satellite", + "rev": "ba78881a68182ce338041846164cbfed0d70935c", + "type": "github" + }, + "original": { + "owner": "Supreeeme", + "repo": "xwayland-satellite", + "type": "github" + } } }, "root": "root", diff --git a/flake.nix b/flake.nix index dbaf5c4..508d5cc 100755 --- a/flake.nix +++ b/flake.nix @@ -33,6 +33,18 @@ inputs.nixpkgs.follows = "nixpkgs"; }; + # System-wide styling. + stylix = { + url = "github:danth/stylix/release-25.05"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + + # Niri WM. + niri = { + url = "github:sodiboo/niri-flake"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + # Neovim. nixvim = { url = "github:nix-community/nixvim"; diff --git a/helpers.nix b/helpers.nix index e5ba189..ba08ec1 100644 --- a/helpers.nix +++ b/helpers.nix @@ -23,8 +23,12 @@ with inputs.nixpkgs.lib; { extraModules = hostModules # Host-specific modules. ++ optionals (docker == true) [./suites/server/docker] # Enable docker if required. + ++ optionals (suite == "desktop") [niri.nixosModules.niri] ++ (filesystem.listFilesRecursive ./modules); # Custom modules. + # specialArgs & extraSpecialArgs. + args = {inherit inputs hostname secrets;}; + # nixpkgs config. pkgs = import nixpkgs { inherit system; @@ -42,6 +46,7 @@ with inputs.nixpkgs.lib; { # Import my overlay. overlays = [ (import ./overlay.nix {inherit inputs system;}) + niri.overlays.niri ]; }; @@ -62,19 +67,11 @@ with inputs.nixpkgs.lib; { { nixosConfigurations.${hostname} = nixosSystem { inherit system pkgs; - - specialArgs = { - # Make some variables accesible to modules. - inherit - inputs - hostname - secrets - ; - }; + specialArgs = args; modules = [ - nixvim.nixosModules.nixvim # Neovim. + stylix.nixosModules.stylix # Universal styling. lanzaboote.nixosModules.lanzaboote # Secure boot. sops-nix.nixosModules.sops # Secrets management. @@ -88,7 +85,17 @@ with inputs.nixpkgs.lib; { useGlobalPkgs = true; useUserPackages = true; backupFileExtension = "backup"; - users.fern = ./home.nix; + extraSpecialArgs = args; + users.fern = { + home.username = "fern"; # My username. + home.homeDirectory = "/home/fern"; # My home directory. + home.stateVersion = "25.05"; # NixOS/home manager version (must match). + programs.home-manager.enable = true; # Enable home manager: + imports = [ + nixvim.homeModules.nixvim # Neovim. + ./suites/${suite}/home.nix # Suite-specific config. + ]; + }; }; } ] diff --git a/home.nix b/home.nix deleted file mode 100644 index ad824de..0000000 --- a/home.nix +++ /dev/null @@ -1,15 +0,0 @@ -{ - config, - pkgs, - ... -}: { - # Me! - home.username = "fern"; - home.homeDirectory = "/home/fern"; - - # Home manager version. - home.stateVersion = "25.05"; - - # Let Home Manager install and manage itself. - programs.home-manager.enable = true; -} diff --git a/hosts/docker/default.nix b/hosts/docker/default.nix index f9bf070..c696fe9 100644 --- a/hosts/docker/default.nix +++ b/hosts/docker/default.nix @@ -35,8 +35,6 @@ # Install some packages. environment.systemPackages = with pkgs; [ mergerfs - ansible - (python3.withPackages (ps: [ps.ansible ps.pip ps.requests])) ]; # MergerFS. @@ -50,7 +48,6 @@ # Media group. users.groups.media = { gid = 1800; + members = ["fern"]; }; - - users.users.fern.extraGroups = ["media"]; } diff --git a/hosts/muskduck/default.nix b/hosts/muskduck/default.nix index 3b9b514..7712016 100644 --- a/hosts/muskduck/default.nix +++ b/hosts/muskduck/default.nix @@ -38,29 +38,4 @@ with lib; { "dmask=0077" ]; }; - - # Share Music dir. - services.samba = { - enable = true; - openFirewall = true; - settings = { - global = { - "workgroup" = "FLOCK"; - "server string" = "muskduck"; - "netbios name" = "muskduck"; - "security" = "user"; - }; - "Music" = { - "path" = "/home/fern/Music"; - "browseable" = "yes"; - "read only" = "yes"; - "guest ok" = "no"; - }; - }; - }; - - services.samba-wsdd = { - enable = true; - openFirewall = true; - }; } diff --git a/overlay.nix b/overlay.nix index 00aa986..a3ebd6c 100644 --- a/overlay.nix +++ b/overlay.nix @@ -5,67 +5,12 @@ }: with inputs; final: prev: { - # WebOne HTTP proxy. - webone = prev.pkgs.callPackage ./packages/webone {}; - - # Yazi Gruvbox theme. - yazi-flavour-gruvbox-dark = prev.pkgs.callPackage ./packages/yazi-flavour-gruvbox {}; - - # Dymo label printer drivers. - cups-dymo = prev.pkgs.callPackage ./packages/cups-dymo {}; - - # Latest protonmail-desktop - protonmail-desktop = (import nixpkgs-unstable {inherit system;}).protonmail-desktop; - - # Latest FluffyChat. - fluffychat = - (import nixpkgs-unstable - { - inherit system; - overlays = [ - (final: prev: { - fluffychat = prev.fluffychat.overrideAttrs (prevAttrs: { - desktopItems = [ - ((builtins.elemAt prevAttrs.desktopItems 0).override {startupWMClass = "fluffychat";}) - ]; - }); - }) - ]; - }).fluffychat; - - # Latest Feishin. - feishin = - (import nixpkgs-pr-feishin { - inherit system; - overlays = [ - (final: prev: { - feishin = prev.feishin.overrideAttrs (prevAttrs: rec { - pname = "feishin"; - version = "0.18.0"; - - src = prev.fetchFromGitHub { - owner = "jeffvli"; - repo = "feishin"; - rev = "v${version}"; - hash = "sha256-4gcS7Vd7LSpEByO2Hlk6nb8V2adBPh5XwWGCu2lwOA4="; - }; - - pnpmDeps = prev.pnpm_10.fetchDeps { - inherit pname version src; - hash = "sha256-1MGxrUcfvazxAubaYAsQuulUKm05opWOIC7oaLzjr7o="; - }; - }); - }) - ]; - }).feishin; - - # PrismLauncher with Temurin JRE; - prismlauncher = prev.prismlauncher.override { - jdks = [ - prev.pkgs.temurin-jre-bin - ]; - }; + ## My Packages ## + webone = prev.pkgs.callPackage ./packages/webone {}; # WebOne HTTP proxy. + cups-dymo = prev.pkgs.callPackage ./packages/cups-dymo {}; # Dymo label printer drivers. + ## Package Mods ## + # Custom build of iosevka iosevka = prev.iosevka.override { set = "Custom"; @@ -91,4 +36,56 @@ with inputs; }; }; }; + + # Latest Feishin. + feishin = + (import nixpkgs-pr-feishin { + inherit system; + overlays = [ + (final: prev: { + feishin = prev.feishin.overrideAttrs (prevAttrs: rec { + pname = "feishin"; + version = "0.19.0"; + + src = prev.fetchFromGitHub { + owner = "jeffvli"; + repo = "feishin"; + rev = "v${version}"; + hash = "sha256-2Jry/wulzkS1P4tughDlH5klqNngPNmFuC5Nqe9sakM="; + }; + + pnpmDeps = prev.pnpm_10.fetchDeps { + inherit pname version src; + hash = "sha256-4cbrK+3nFD2NgoaGoAQdQ0+/07WiUiFUAyJFOsge8X8="; + }; + }); + }) + ]; + }).feishin; + + ## Unstable Channel ## + protonmail-desktop = (import nixpkgs-unstable {inherit system;}).protonmail-desktop; # Latest protonmail-desktop + + # Latest FluffyChat. + fluffychat = + (import nixpkgs-unstable + { + inherit system; + overlays = [ + (final: prev: { + fluffychat = prev.fluffychat.overrideAttrs (prevAttrs: { + desktopItems = [ + ((builtins.elemAt prevAttrs.desktopItems 0).override {startupWMClass = "fluffychat";}) + ]; + }); + }) + ]; + }).fluffychat; + + # PrismLauncher with Temurin JRE; + prismlauncher = prev.prismlauncher.override { + jdks = [ + prev.pkgs.temurin-jre-bin + ]; + }; } diff --git a/packages/yazi-flavour-gruvbox/default.nix b/packages/yazi-flavour-gruvbox/default.nix deleted file mode 100644 index ba82d3c..0000000 --- a/packages/yazi-flavour-gruvbox/default.nix +++ /dev/null @@ -1,21 +0,0 @@ -{ - pkgs, - fetchFromGitHub, -}: let - flavor = "gruvbox-dark"; -in - pkgs.stdenv.mkDerivation { - pname = "yazi-flavor-${flavor}"; - version = "2025.04.24"; - src = fetchFromGitHub { - owner = "bennyyip"; - repo = "${flavor}.yazi"; - rev = "91fdfa70f6d593934e62aba1e449f4ec3d3ccc90"; - hash = "sha256-RWqyAdETD/EkDVGcnBPiMcw1mSd78Aayky9yoxSsry4="; - }; - - installPhase = '' - mkdir -p $out - cp $src/* $out/ - ''; - } diff --git a/suites/default.nix b/suites/default.nix index 6b7d91d..b38df94 100644 --- a/suites/default.nix +++ b/suites/default.nix @@ -1,11 +1,10 @@ { + config, inputs, pkgs, - lib, hostname, ... -}: -with lib; { +}: { # NixOS version. system.stateVersion = "25.05"; @@ -42,6 +41,13 @@ with lib; { LC_TIME = "en_AU.UTF-8"; }; + # Set console font. + console = { + earlySetup = true; + font = "${pkgs.terminus_font}/share/consolefonts/ter-122n.psf.gz"; + packages = with pkgs; [terminus_font]; + }; + # Configure keymap in X11. services.xserver.xkb = { layout = "us"; @@ -50,6 +56,7 @@ with lib; { # Enable networking. networking.networkmanager.enable = true; + users.groups.networkmanager.members = ["fern"]; # Set hostname networking.hostName = hostname; @@ -59,37 +66,11 @@ with lib; { isNormalUser = true; uid = 1000; description = "Fern Garden"; - extraGroups = [ - "wheel" - "networkmanager" - ]; + extraGroups = ["wheel"]; }; # Use fish shell - programs.fish = { - enable = true; - shellAbbrs = let - flake = "/home/fern/Repositories/flock"; - in { - ns = "nh os switch ${flake}"; - nt = "nh os test ${flake}"; - nb = "nh os boot ${flake}"; - }; - interactiveShellInit = '' - # set gruvbox theme - theme_gruvbox dark hard - - # yazi cd on quit. - function y - set tmp (mktemp -t "yazi-cwd.XXXXXX") - yazi $argv --cwd-file="$tmp" - if read -z cwd < "$tmp"; and [ -n "$cwd" ]; and [ "$cwd" != "$PWD" ] - builtin cd -- "$cwd" - end - rm -f -- "$tmp" - end - ''; - }; + programs.fish.enable = true; # https://nixos.wiki/wiki/Fish#Setting_fish_as_your_shell programs.bash = { @@ -102,179 +83,21 @@ with lib; { ''; }; + # Enable nh. + programs.nh = { + enable = true; + clean = { + enable = true; + extraArgs = "--keep-since 3d"; + }; + }; + # https://discourse.nixos.org/t/slow-build-at-building-man-cache/52365/2 documentation.man.generateCaches = false; - # Enable all terminfo (for ghostty). + # Enable all terminfo. environment.enableAllTerminfo = true; - # Install some packages. - programs = { - git.enable = true; - lazygit.enable = true; - - nixvim = { - enable = true; - - # Set $EDITOR - defaultEditor = true; - - # For telescope grep. - dependencies.ripgrep.enable = true; - - # Space as leader. - globals.mapleader = " "; - - keymaps = [ - { - key = "t"; - action = " ToggleTerm direction=float "; - } - { - key = "x"; - action = " Trouble diagnostics toggle focus=false "; - } - { - key = "y"; - action = " Yazi "; - } - { - key = "fs"; - action = " SessionSearch "; - } - ]; - - colorschemes.gruvbox = { - enable = true; - settings = { - contrast = "hard"; - overrides.SignColumn.bg = "none"; - }; - }; - - opts = rec { - shiftwidth = 2; - tabstop = shiftwidth; - softtabstop = shiftwidth; - expandtab = true; - number = true; - cursorline = true; - undofile = true; - }; - - plugins = { - auto-session.enable = true; - bufferline.enable = true; - colorizer.enable = true; - comment.enable = true; - gitsigns.enable = true; - lsp-format.enable = true; - notify.enable = true; - nvim-autopairs.enable = true; - nvim-surround.enable = true; - toggleterm.enable = true; - trouble.enable = true; - web-devicons.enable = true; - yazi.enable = true; - - lualine = { - enable = true; - settings.extensions = ["trouble" "toggleterm"]; - }; - - telescope = { - enable = true; - keymaps = { - "ff" = "find_files"; - "fg" = "live_grep"; - "fb" = "buffers"; - }; - }; - - blink-cmp = { - enable = true; - settings = { - keymap = { - preset = "enter"; - "" = [ - "select_next" - "fallback" - ]; - "" = [ - "select_prev" - "fallback" - ]; - }; - completion = { - menu.auto_show = true; - documentation.auto_show = true; - list.selection.preselect = false; - }; - cmdline = { - keymap.preset = "inherit"; - completion = { - menu.auto_show = true; - list.selection.preselect = false; - }; - }; - }; - }; - - lsp = { - enable = true; - inlayHints = true; - servers = { - nixd = { - enable = true; - settings = { - nixpkgs.expr = "import (builtins.getFlake (builtins.toString ${inputs.self})).inputs.nixpkgs { }"; - formatting.command = ["${pkgs.alejandra}/bin/alejandra"]; - options = { - nixos.expr = "(builtins.getFlake (builtins.toString ${inputs.self})).nixosConfigurations.${hostname}.options"; - home-manager.expr = "(builtins.getFlake (builtins.toString ${inputs.self})).nixosConfigurations.${hostname}.options.home-manager.users.type.getSubOptions []"; - }; - }; - }; - docker_compose_language_service.enable = true; - }; - }; - - treesitter = { - enable = true; - settings = { - highlight.enable = true; - incremental_selection.enable = true; - indent.enable = true; - }; - }; - }; - }; - }; - - programs.yazi = { - enable = true; - flavors."gruvbox-dark.yazi" = pkgs.yazi-flavour-gruvbox-dark; - settings.theme = { - flavor.dark = "gruvbox-dark"; - }; - }; - - programs.tmux = { - enable = true; - plugins = [pkgs.tmuxPlugins.gruvbox]; - }; - - environment.systemPackages = with pkgs; [ - aria2 - btop - fishPlugins.gruvbox - lynx - ncdu - nh - rsync - trash-cli - ]; - # Enable avahi hostname resolution. services.avahi = { enable = true; @@ -287,12 +110,42 @@ with lib; { }; }; - # Home manager settings. - home-manager.users.fern = { - programs.git = { - enable = true; - userEmail = "mail@fern.garden"; - userName = "Fern Garden"; + # Universal styling. + stylix = { + enable = true; + base16Scheme = "${pkgs.base16-schemes}/share/themes/kanagawa-dragon.yaml"; + polarity = "dark"; + + cursor = { + name = "Adwaita"; + package = pkgs.adwaita-icon-theme; + size = 24; + }; + + fonts = { + sizes = { + applications = 11; + desktop = config.stylix.fonts.sizes.applications; + popups = config.stylix.fonts.sizes.applications; + terminal = 12; + }; + + sansSerif = { + package = pkgs.adwaita-fonts; + name = "Adwaita Sans"; + }; + + serif = config.stylix.fonts.sansSerif; + + monospace = { + package = pkgs.iosevka; + name = "IosevkaCustom"; + }; + + emoji = { + package = pkgs.noto-fonts-emoji; + name = "Noto Color Emoji"; + }; }; }; } diff --git a/suites/desktop/default.nix b/suites/desktop/default.nix index b6eb393..db12acc 100755 --- a/suites/desktop/default.nix +++ b/suites/desktop/default.nix @@ -40,50 +40,38 @@ with lib; { # Encrypt user's home with fscrypt security.pam.enableFscrypt = true; - # Enable the GNOME Desktop Environment. - services.xserver = { + # Enable login manager. + programs.regreet = { enable = true; - - excludePackages = [ - pkgs.xterm # Don't install xterm. - ]; - - displayManager.gdm.enable = true; - - desktopManager.gnome = { - enable = true; - # Enable fractional scaling. - extraGSettingsOverridePackages = [pkgs.mutter]; - extraGSettingsOverrides = '' - [org.gnome.mutter] - experimental-features=['scale-monitor-framebuffer'] - ''; + cageArgs = ["-m" "last"]; + font = { + size = 11; + name = "Adwaita Sans"; }; }; - # Theme QT applications - qt = { + # Enable window manager. + programs.niri = { enable = true; - platformTheme = "gnome"; - style = "adwaita-dark"; + package = pkgs.niri-unstable; }; - # Exclude some default gnome applications. - environment.gnome.excludePackages = ( - with pkgs; [ - epiphany # Browser (replaced by Firefox). - gnome-connections # Remote desktop viewer. - gnome-console # Terminal (replaced by ghostTTY). - gnome-maps # Maps viewer. - gnome-music # Music player. - gnome-tour # First-boot tour. - totem # Movie player (replaced by Celluloid). - yelp # Help viewer. - ] - ); + # Set wallpaper. + stylix.image = ./wallpaper.jpg; - # Run electron apps under wayland. - environment.sessionVariables.NIXOS_OZONE_WL = "1"; + programs.dconf.enable = true; + security.polkit.enable = true; + services.hardware.bolt.enable = true; + services.upower.enable = true; + services.libinput.enable = true; + + xdg.portal = { + enable = true; + extraPortals = [ + pkgs.xdg-desktop-portal-gnome + pkgs.xdg-desktop-portal-gtk + ]; + }; # Virtualisation. programs.virt-manager.enable = true; @@ -103,56 +91,8 @@ with lib; { }; }; - # Install some packages. - programs = { - steam.enable = true; - firefox.enable = true; - }; - - environment.systemPackages = with pkgs; [ - adw-gtk3 - adwsteamgtk - caligula - celluloid - deploy-rs - discord - feishin - fluffychat - fusee-nano - ghostty - gimp3 - glabels-qt - gnome-tweaks - gnomeExtensions.adw-gtk3-colorizer - gnomeExtensions.auto-move-windows - gnomeExtensions.caffeine - gnomeExtensions.color-picker - gnomeExtensions.rounded-window-corners-reborn - gnomeExtensions.smile-complementary-extension - jellyfin-media-player - libreoffice - nextcloud-client - ns-usbloader - obsidian - prismlauncher - protonmail-desktop - rockbox-utility - signal-desktop - smile - via - yubioath-flutter - ]; - - fonts.packages = with pkgs; [ - merriweather - iosevka - ]; - - # Allow opening terminal applications from gnome app launcher. - xdg.terminal-exec = { - enable = true; - settings.default = ["ghostty.desktop"]; - }; + # Install Steam client. + programs.steam.enable = true; # Enable configuration of keyboard. hardware.keyboard.qmk.enable = true; @@ -173,9 +113,15 @@ with lib; { drivers = [pkgs.brlaser pkgs.cups-dymo]; # Brother laser printer & Dymo label printer. }; + services.system-config-printer.enable = true; + # https://github.com/tailscale/tailscale/issues/4432#issuecomment-1112819111 networking.firewall.checkReversePath = false; + # Enable brightness control. + hardware.brillo.enable = true; + users.groups.video.members = ["fern"]; + # Enable sound with pipewire. services.pulseaudio.enable = false; security.rtkit.enable = true; @@ -191,23 +137,28 @@ with lib; { services.tlp.enable = mkForce false; # enabled by nixos-hardware services.auto-cpufreq.enable = true; - # Home manager settings. - home-manager.users.fern = { - # Ghostty settings. - programs.ghostty = { - enable = true; - settings = { - font-family = "IosevkaCustom"; - theme = "GruvboxDarkHard"; + # Samba file sharing. + services.samba = { + enable = true; + openFirewall = true; + settings = { + global = { + "workgroup" = "FLOCK"; + "server string" = "muskduck"; + "netbios name" = "muskduck"; + "security" = "user"; }; - }; - - # virt-manager - autoconnect to qemu. - dconf.settings = { - "org/virt-manager/virt-manager/connections" = { - autoconnect = ["qemu:///system"]; - uris = ["qemu:///system"]; + "Music" = { + "path" = "/home/fern/Music"; + "browseable" = "yes"; + "read only" = "yes"; + "guest ok" = "no"; }; }; }; + + services.samba-wsdd = { + enable = true; + openFirewall = true; + }; } diff --git a/suites/desktop/home.nix b/suites/desktop/home.nix new file mode 100644 index 0000000..abafa30 --- /dev/null +++ b/suites/desktop/home.nix @@ -0,0 +1,368 @@ +{ + lib, + pkgs, + ... +}: +with lib; { + imports = [../home.nix]; + + # Consistent theming. + qt.enable = true; + gtk.enable = true; + + programs.niri = { + settings = { + # Wayland environment variables. + environment = { + CLUTTER_BACKEND = "wayland"; + DISPLAY = null; + GDK_BACKEND = "wayland,x11"; + MOZ_ENABLE_WAYLAND = "1"; + NIXOS_OZONE_WL = "1"; + QT_QPA_PLATFORM = "wayland;xcb"; + QT_WAYLAND_DISABLE_WINDOWDECORATION = "1"; + SDL_VIDEODRIVER = "wayland"; + }; + + # X11 support. + xwayland-satellite = { + enable = true; + path = getExe pkgs.xwayland-satellite-unstable; + }; + + # Don't show client-side window decorations. + prefer-no-csd = true; + + # Don't show hotkeys at startup. + hotkey-overlay.skip-at-startup = true; + + # Disable hot corner. + gestures.hot-corners.enable = false; + + # Keyboard, mouse, trackpad, trackpoint. + input = { + touchpad.natural-scroll = false; + keyboard.repeat-rate = 60; + }; + + binds = { + # Spawn programs. + "Mod+Return".action.spawn = "kitty"; + "Mod+Space".action.spawn = "fuzzel"; + "Mod+Alt+L".action.spawn = "hyprlock"; + + # Media & brightness control. + "XF86AudioRaiseVolume" = { + allow-when-locked = true; + action.spawn = ["wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "5%+"]; + }; + + "XF86AudioLowerVolume" = { + allow-when-locked = true; + action.spawn = ["wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "5%-"]; + }; + + "XF86AudioMute" = { + allow-when-locked = true; + action.spawn = ["wpctl" "set-mute" "@DEFAULT_AUDIO_SINK@" "toggle"]; + }; + + "XF86AudioMicMute" = { + allow-when-locked = true; + action.spawn = ["wpctl" "set-mute" "@DEFAULT_AUDIO_SOURCE@" "toggle"]; + }; + + "XF86MonBrightnessUp" = { + allow-when-locked = true; + action.spawn = ["brillo" "-A" "5"]; + }; + + "XF86MonBrightnessDown" = { + allow-when-locked = true; + action.spawn = ["brillo" "-U" "5"]; + }; + + # Close windows. + "Mod+Q".action.close-window = {}; + + # Quit Niri. + "Mod+Shift+E".action.quit = {}; + + # Turn off monitors. + "Mod+Shift+Escape".action.power-off-monitors = {}; + + # Take a screenshot. + "Mod+P".action.screenshot = {}; + "Mod+Shift+P".action.screenshot-screen = {}; + "Mod+Shift+Ctrl+P".action.screenshot-window = {}; + + # Focus and move columns. + "Mod+H".action.focus-column-left = {}; + "Mod+J".action.focus-window-down = {}; + "Mod+K".action.focus-window-up = {}; + "Mod+L".action.focus-column-right = {}; + + "Mod+Shift+H".action.move-column-left = {}; + "Mod+Shift+J".action.move-window-down = {}; + "Mod+Shift+K".action.move-window-up = {}; + "Mod+Shift+L".action.move-column-right = {}; + + "Mod+Home".action.focus-column-first = {}; + "Mod+End".action.focus-column-last = {}; + + "Mod+Shift+Home".action.move-column-to-first = {}; + "Mod+Shift+End".action.move-column-to-last = {}; + + # Focus monitors. + "Mod+bracketleft".action.focus-monitor-left = {}; + "Mod+bracketright".action.focus-monitor-right = {}; + + # Move columns between monitors. + "Mod+Shift+bracketleft".action.move-column-to-monitor-left = {}; + "Mod+Shift+bracketright".action.move-column-to-monitor-right = {}; + + # Focus workspaces. + "Mod+U".action.focus-workspace-down = {}; + "Mod+I".action.focus-workspace-up = {}; + + "Mod+1".action.focus-workspace = 1; + "Mod+2".action.focus-workspace = 2; + "Mod+3".action.focus-workspace = 3; + "Mod+4".action.focus-workspace = 4; + "Mod+5".action.focus-workspace = 5; + "Mod+6".action.focus-workspace = 6; + "Mod+7".action.focus-workspace = 7; + "Mod+8".action.focus-workspace = 8; + "Mod+9".action.focus-workspace = 9; + + # Move columns to workspaces. + "Mod+Shift+U".action.move-column-to-workspace-down = {}; + "Mod+Shift+I".action.move-column-to-workspace-up = {}; + + "Mod+Shift+1".action.move-column-to-workspace = 1; + "Mod+Shift+2".action.move-column-to-workspace = 2; + "Mod+Shift+3".action.move-column-to-workspace = 3; + "Mod+Shift+4".action.move-column-to-workspace = 4; + "Mod+Shift+5".action.move-column-to-workspace = 5; + "Mod+Shift+6".action.move-column-to-workspace = 6; + "Mod+Shift+7".action.move-column-to-workspace = 7; + "Mod+Shift+8".action.move-column-to-workspace = 8; + "Mod+Shift+9".action.move-column-to-workspace = 9; + + # Expel & consume windows into columns. + "Mod+Comma".action.consume-window-into-column = {}; + "Mod+Period".action.expel-window-from-column = {}; + + # Resize columns. + "Mod+R".action.switch-preset-column-width = {}; + "Mod+Shift+R".action.reset-window-height = {}; + + "Mod+F".action.maximize-column = {}; + "Mod+Shift+F".action.fullscreen-window = {}; + + "Mod+C".action.center-column = {}; + + "Mod+Minus".action.set-column-width = "-10%"; + "Mod+Equal".action.set-column-width = "+10%"; + + "Mod+Shift+Minus".action.set-window-height = "-10%"; + "Mod+Shift+Equal".action.set-window-height = "+10%"; + }; + + layout = { + gaps = 4; + border.width = 1; + preset-column-widths = [ + {proportion = 1.0 / 3.0;} + {proportion = 1.0 / 2.0;} + {proportion = 2.0 / 6.0;} + ]; + default-column-width = { + proportion = 1.0 / 2.0; + }; + }; + }; + }; + + # Lock screen. + programs.hyprlock = { + enable = true; + settings = { + input-field = { + fade_on_empty = false; + rounding = 0; + outline_thickness = 1; + valign = "center"; + halign = "center"; + position = "0%, -10%"; + size = "20%, 5%"; + }; + label = { + valign = "center"; + halign = "center"; + position = "0%, 10%"; + text = "$TIME"; + font_size = 128; + font_family = "Adwaita Sans Bold"; + }; + }; + }; + + stylix.targets.hyprlock.useWallpaper = false; + + # Auto-lock. + services.hypridle = { + enable = true; + settings = { + general.lock_cmd = "hyprlock"; + + listener = [ + { + timeout = 300; + on-timeout = "brillo -O; brillo -u 500000 -S 10"; + on-resume = "brillo -I -u 250000"; + } + { + timeout = 600; + on-timeout = "loginctl lock-session"; + } + ]; + }; + }; + + # Launcher. + programs.fuzzel = { + enable = true; + settings = { + main = { + horizontal-pad = 8; + vertical-pad = 8; + inner-pad = 8; + }; + border.radius = 0; + }; + }; + + # Panel. + programs.waybar = { + enable = true; + systemd.enable = true; + + style = '' + * { + border-radius: 0; + } + ''; + + settings.main = { + modules-left = ["niri/workspaces"]; + modules-center = ["clock"]; + modules-right = ["network" "wireplumber" "battery#0" "battery#1"]; + + "battery#0" = { + bat = "BAT0"; + format-icons = ["󰁺" "󰁻" "󰁼" "󰁽" "󰁾" "󰁿" "󰂁" "󰂂" "󰁹"]; + format = "{icon} {capacity}%"; + tooltip = false; + }; + + "battery#1" = { + bat = "BAT1"; + format-icons = ["󰁺" "󰁻" "󰁼" "󰁽" "󰁾" "󰁿" "󰂁" "󰂂" "󰁹"]; + format = "{icon} {capacity}%"; + tooltip = false; + }; + + "network" = { + format-icons = ["󰤯" "󰤟" "󰤢" "󰤥" "󰤨"]; + format = "{icon}"; + format-disconnected = ""; + tooltip = true; + tooltip-format = "{essid}"; + }; + + "wireplumber" = { + format-icons = ["" "" ""]; + format = "{icon} {volume}%"; + format-muted = " "; + tooltip = false; + }; + + "clock" = { + format = "{:%a %b %d · %H:%M}"; + tooltip = false; + }; + }; + }; + + stylix.targets.waybar.font = "sansSerif"; # use sans-serif font, not monospaced. + + # polkit-gnome. + systemd.user.services.polkit-gnome-authentication-agent-1 = { + Unit.Description = "polkit-gnome-authentication-agent-1"; + + Install = { + WantedBy = ["graphical-session.target"]; + Wants = ["graphical-session.target"]; + After = ["graphical-session.target"]; + }; + + Service = { + Type = "simple"; + ExecStart = "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1"; + Restart = "on-failure"; + RestartSec = 1; + TimeoutStopSec = 10; + }; + }; + + # Wallpaper manager. + services.hyprpaper.enable = true; + + # Notifications + services.mako.enable = true; + + # Install some software. + programs.firefox = { + enable = true; + profiles.default = {}; + }; + + stylix.targets.firefox.profileNames = ["default"]; + + programs.kitty = { + enable = true; + settings.window_padding_width = 4; + }; + + fonts.fontconfig.enable = true; # discover fonts installed by home.packages. + + home.packages = with pkgs; [ + caligula + celluloid + deploy-rs + discord + feishin + fluffychat + fusee-nano + gimp3 + glabels-qt + jellyfin-media-player + libreoffice + nautilus + nerd-fonts.symbols-only + nextcloud-client + noto-fonts + noto-fonts-cjk-sans + noto-fonts-cjk-serif + ns-usbloader + obsidian + prismlauncher + protonmail-desktop + rockbox-utility + signal-desktop + smile + via + yubioath-flutter + ]; +} diff --git a/suites/home.nix b/suites/home.nix new file mode 100644 index 0000000..37a451f --- /dev/null +++ b/suites/home.nix @@ -0,0 +1,195 @@ +{ + inputs, + pkgs, + hostname, + ... +}: { + stylix.targets.nixvim.enable = false; # style is defined below. + + # Install some packages. + programs = { + lazygit.enable = true; + yazi.enable = true; + tmux.enable = true; + btop.enable = true; + + aria2 = { + enable = true; + settings = { + max-concurrent-downloads = 2; + max-connection-per-server = 16; + min-split-size = "8M"; + split = 32; + continue = true; + }; + }; + + git = { + enable = true; + userEmail = "mail@fern.garden"; + userName = "Fern Garden"; + }; + + fish = { + enable = true; + shellAbbrs = let + flake = "/home/fern/Repositories/flock"; + in { + ns = "nh os switch ${flake}"; + nt = "nh os test ${flake}"; + nb = "nh os boot ${flake}"; + }; + functions = { + y = '' + set tmp (mktemp -t "yazi-cwd.XXXXXX") + yazi $argv --cwd-file="$tmp" + if read -z cwd < "$tmp"; and [ -n "$cwd" ]; and [ "$cwd" != "$PWD" ] + builtin cd -- "$cwd" + end + rm -f -- "$tmp" + ''; + }; + }; + + nixvim = { + enable = true; + + # Set $EDITOR + defaultEditor = true; + + # For telescope grep. + dependencies.ripgrep.enable = true; + + # Space as leader. + globals.mapleader = " "; + + keymaps = [ + { + key = "t"; + action = " ToggleTerm direction=float "; + } + { + key = "x"; + action = " Trouble diagnostics toggle focus=false "; + } + { + key = "y"; + action = " Yazi "; + } + { + key = "fs"; + action = " SessionSearch "; + } + ]; + + colorschemes.kanagawa = { + enable = true; + settings.colors.theme.all.ui.bg_gutter = "none"; # Remove gutter background. + settings.background.dark = "dragon"; + }; + + opts = rec { + shiftwidth = 2; + tabstop = shiftwidth; + softtabstop = shiftwidth; + expandtab = true; + number = true; + cursorline = true; + undofile = true; + }; + + plugins = { + auto-session.enable = true; + bufferline.enable = true; + colorizer.enable = true; + comment.enable = true; + gitsigns.enable = true; + lsp-format.enable = true; + notify.enable = true; + nvim-autopairs.enable = true; + nvim-surround.enable = true; + toggleterm.enable = true; + trouble.enable = true; + web-devicons.enable = true; + yazi.enable = true; + + lualine = { + enable = true; + settings.extensions = ["trouble" "toggleterm"]; + }; + + telescope = { + enable = true; + keymaps = { + "ff" = "find_files"; + "fg" = "live_grep"; + "fb" = "buffers"; + }; + }; + + blink-cmp = { + enable = true; + settings = { + keymap = { + preset = "enter"; + "" = [ + "select_next" + "fallback" + ]; + "" = [ + "select_prev" + "fallback" + ]; + }; + completion = { + menu.auto_show = true; + documentation.auto_show = true; + list.selection.preselect = false; + }; + cmdline = { + keymap.preset = "inherit"; + completion = { + menu.auto_show = true; + list.selection.preselect = false; + }; + }; + }; + }; + + lsp = { + enable = true; + inlayHints = true; + servers = { + nixd = { + enable = true; + settings = { + nixpkgs.expr = "import (builtins.getFlake (builtins.toString ${inputs.self})).inputs.nixpkgs { }"; + formatting.command = ["${pkgs.alejandra}/bin/alejandra"]; + options = { + nixos.expr = "(builtins.getFlake (builtins.toString ${inputs.self})).nixosConfigurations.${hostname}.options"; + home-manager.expr = "(builtins.getFlake (builtins.toString ${inputs.self})).nixosConfigurations.${hostname}.options.home-manager.users.type.getSubOptions []"; + }; + }; + }; + docker_compose_language_service.enable = true; + }; + }; + + treesitter = { + enable = true; + settings = { + highlight.enable = true; + incremental_selection.enable = true; + indent.enable = true; + }; + }; + }; + }; + }; + + home.packages = with pkgs; [ + ncdu + rsync + trash-cli + ]; +} diff --git a/suites/server/home.nix b/suites/server/home.nix new file mode 100644 index 0000000..ab84dc1 --- /dev/null +++ b/suites/server/home.nix @@ -0,0 +1,3 @@ +{ + imports = [../home.nix]; +} diff --git a/suites/server/lxc/home.nix b/suites/server/lxc/home.nix new file mode 100644 index 0000000..ab84dc1 --- /dev/null +++ b/suites/server/lxc/home.nix @@ -0,0 +1,3 @@ +{ + imports = [../home.nix]; +} diff --git a/suites/server/vm/home.nix b/suites/server/vm/home.nix new file mode 100644 index 0000000..ab84dc1 --- /dev/null +++ b/suites/server/vm/home.nix @@ -0,0 +1,3 @@ +{ + imports = [../home.nix]; +}