diff --git a/default.nix b/default.nix index f01ab85..2a8d007 100644 --- a/default.nix +++ b/default.nix @@ -4,14 +4,14 @@ let # https://github.com/andir/npins?tab=readme-ov-file#using-the-nixpkgs-fetchers src = import ./npins; pkgs = import src.nixpkgs { }; - sources = mapAttrs (_: v: v { inherit pkgs; }) src; + sources = mapAttrs (k: v: v { inherit pkgs; }) src; inherit (pkgs) lib; inherit (lib.filesystem) listFilesRecursive; inherit (lib.strings) hasSuffix; mkSystem = - hostname: + system: hostname: import (src.nixpkgs + "/nixos/lib/eval-config.nix") { specialArgs = { inherit sources; @@ -28,7 +28,7 @@ let }; in { - temperance = mkSystem "temperance"; - hermit = mkSystem "hermit"; - tower = mkSystem "tower"; + temperance = mkSystem "x86_64-linux" "temperance"; + hermit = mkSystem "x86_64-linux" "hermit"; + tower = mkSystem "aarch64-linux" "tower"; } diff --git a/docs/resizing.md b/docs/resizing.md new file mode 100644 index 0000000..36438fa --- /dev/null +++ b/docs/resizing.md @@ -0,0 +1,8 @@ +## Resizing images using imagemagick + +I wanted to resize an image using imagemagick. + +To do this I had to run: +`magick lain.png -crop 1072x1448^ -gravity center -quality 90 sca.png` + +What does this do? diff --git a/hosts/hermit/programs.nix b/hosts/hermit/programs.nix index afad470..b0d0029 100644 --- a/hosts/hermit/programs.nix +++ b/hosts/hermit/programs.nix @@ -16,6 +16,7 @@ cbonsai cinny-desktop cmus + comma difftastic dua evince diff --git a/hosts/temperance/programs.nix b/hosts/temperance/programs.nix index f24c3ba..98474f2 100644 --- a/hosts/temperance/programs.nix +++ b/hosts/temperance/programs.nix @@ -11,6 +11,7 @@ calc calibre carapace + comma digikam difftastic dnsutils diff --git a/modules/home/dev/helix.hjem.nix b/modules/home/dev/helix.hjem.nix index 65e144b..e6e26e0 100644 --- a/modules/home/dev/helix.hjem.nix +++ b/modules/home/dev/helix.hjem.nix @@ -6,10 +6,9 @@ }: let inherit (lib.attrsets) mapAttrs' nameValuePair; - inherit (lib.meta) getExe; helix = pkgs.helix.overrideAttrs ( - finalAttrs: _: { + finalAttrs: previousAttrs: { version = "25.07.2"; src = pkgs.fetchzip { url = "https://github.com/bloxx12/helix/releases/download/${finalAttrs.version}/helix-${finalAttrs.version}-source.tar.xz"; @@ -26,6 +25,28 @@ let } ); + helix-with-plugins = pkgs.helix.overrideAttrs ( + finalAttrs: previousAttrs: { + name = "helix-with-plugins"; + version = "25.07.2"; + src = pkgs.fetchzip { + url = "https://github.com/bloxx12/helix/releases/download/${finalAttrs.version}/helix-${finalAttrs.version}-source.tar.xz"; + hash = "sha256-ZNsQwFfPXe6oewajx1tl68W60kVo7q2SuvTgy/o1HKk="; + stripRoot = false; + }; + + doInstallCheck = false; + + cargoDeps = pkgs.rustPlatform.fetchCargoVendor { + inherit (helix) src; + hash = "sha256-3poZSvIrkx8lguxxDeNfngW6+4hH8TV/LHcZx5W5aXg="; + }; + postInstall = '' + mv $out/bin/hx $out/bin/hxp + ''; + } + ); + toml = pkgs.formats.toml { }; languages = @@ -49,7 +70,7 @@ let }; new-deadnix = pkgs.deadnix.overrideAttrs ( - _: _: { + finalAttrs: previousAttrs: { version = "unstable-15-07-2025"; src = pkgs.fetchFromGitHub { owner = "astro"; @@ -137,10 +158,7 @@ let } { name = "nix"; - language-servers = [ - "nil" - "deadnix" - ]; + language-servers = [ "nil" ]; } { name = "qml"; @@ -262,11 +280,11 @@ let config.nil = { formatting.command = [ "${getExe nixfmt}" ]; diagnostics = { - bindingEndHintMinLines = 10; + bindingEndHintMinLines = 3; }; nix.flake = { autoArchive = true; - autoEvalInputs = true; + # autoEvalInputs = true; nixpkgsInputName = "nixpkgs"; }; }; @@ -293,8 +311,10 @@ let args = [ "server" ]; }; - qmlls.command = getExe' pkgs.kdePackages.qtdeclarative "qmlls"; - + qmlls = { + command = getExe' pkgs.kdePackages.qtdeclarative "qmlls"; + args = [ "-E" ]; + }; basedpyright.command = "${pkgs.basedpyright}/bin/basedpyright-langserver"; vscode-css-language-server = { @@ -343,7 +363,7 @@ let }; settings = { - theme = "gruvbox_dark_hard"; + theme = "nord"; editor = { cursorline = true; color-modes = true; @@ -352,28 +372,18 @@ let lsp = { enable = true; auto-signature-help = true; - display-inlay-hints = true; + display-inlay-hints = false; display-messages = true; - display-progress-messages = true; snippets = true; }; file-picker = { - hidden = false; + hidden = true; }; line-number = "relative"; + auto-format = true; completion-timeout = 5; - clipboard-provider = "wayland"; - - # Shell to use when running external commands. - shell = [ - (getExe pkgs.nushell) - "-c" - ]; - completion-trigger-len = 1; - completion-replace = true; mouse = true; bufferline = "multiple"; - popup-border = "none"; soft-wrap.enable = true; word-completion = { enable = true; @@ -387,26 +397,22 @@ let statusline = { left = [ "spinner" + "version-control" "diagnostics" "file-name" ]; right = [ "file-base-name" + "file-type" "position" - ]; - diagnostics = [ - "warning" - "error" - ]; - workspace-diagnostics = [ - "warning" - "error" + "file-encoding" ]; }; gutters.layout = [ "diff" "diagnostics" "line-numbers" + "spacer" ]; inline-diagnostics = { cursor-line = "hint"; diff --git a/modules/home/hjem.mod.nix b/modules/home/hjem.mod.nix index 43838e6..a6c5e04 100644 --- a/modules/home/hjem.mod.nix +++ b/modules/home/hjem.mod.nix @@ -27,7 +27,7 @@ in directory = config.users.users.${username}.home; clobberFiles = mkForce true; }; - extraModules = (listFilesRecursive ./.) |> filter (hasSuffix ".hjem.nix"); + extraModules = ((listFilesRecursive ./.) |> filter (hasSuffix ".hjem.nix")); specialArgs = { inherit sources; }; diff --git a/modules/home/programs/ghostty.hjem.nix b/modules/home/programs/ghostty.hjem.nix index c76b7c5..c9f1531 100644 --- a/modules/home/programs/ghostty.hjem.nix +++ b/modules/home/programs/ghostty.hjem.nix @@ -42,7 +42,7 @@ let resize-overlay-duration = "0s"; shell-integration-features = "cursor,sudo,no-title"; term = "xterm-256color"; - theme = "GruvboxDarkHard"; + theme = "nightfox"; window-decoration = "none"; window-padding-balance = true; window-padding-x = 8; diff --git a/modules/packages/packages.mod.nix b/modules/packages/packages.mod.nix index 57494bd..c54378d 100644 --- a/modules/packages/packages.mod.nix +++ b/modules/packages/packages.mod.nix @@ -1,36 +1,10 @@ { - lib, pkgs, sources, ... }: let nixfmt = pkgs.callPackage "${sources.nixfmt}/default.nix" { }; - comma = pkgs.callPackage ( - _: - pkgs.rustPlatform.buildRustPackage { - pname = "comma"; - version = "unstable"; - src = sources.comma; - cargoLock = { - allowBuiltinFetchGit = true; - lockFile = "${sources.comma}/Cargo.lock"; - }; - nativeBuildInputs = [ pkgs.makeBinaryWrapper ]; - doInstallCheck = false; - - postInstall = '' - wrapProgram $out/bin/comma \ - --prefix PATH : ${ - lib.makeBinPath [ - pkgs.fzy - pkgs.nix-index-unwrapped - ] - } - ln -s $out/bin/comma $out/bin/, - ''; - } - ) { }; in { environment.systemPackages = @@ -66,7 +40,6 @@ in glow # dua-cli dust - iamb kondo # better grep ripgrep @@ -102,8 +75,5 @@ in unzip zip ] - ++ [ - nixfmt - comma - ]; + ++ [ nixfmt ]; } diff --git a/modules/programs/other/nix-index.mod.nix b/modules/programs/other/nix-index.mod.nix index 86c94b1..febcd44 100644 --- a/modules/programs/other/nix-index.mod.nix +++ b/modules/programs/other/nix-index.mod.nix @@ -1,3 +1,4 @@ +{ pkgs, ... }: { programs = { # We have to disable this and use nix-index instead. (Rust >>> Pearl) diff --git a/modules/services/forgejo/forgejo.mod.nix b/modules/services/forgejo/forgejo.mod.nix index 21b0592..503f1cc 100644 --- a/modules/services/forgejo/forgejo.mod.nix +++ b/modules/services/forgejo/forgejo.mod.nix @@ -124,7 +124,7 @@ in ''; base-brand = fetchurl { url = "https://codeberg.org/Codeberg-Infrastructure/forgejo/src/branch/codeberg-11/web_src/css/themes/codeberg/base-brand.css"; - hash = "sha256-8gUmye/Z8H1Xe6U1CNAq907n3jt2TnPtzgpz6KhdiDU="; + hash = "sha256-rYZolA7maYEjzfx7mKJtEfyK62kfpGxvQ1eaC9qlZNw="; }; dark-variables = fetchurl { url = "https://codeberg.org/Codeberg-Infrastructure/forgejo/raw/branch/codeberg-11/web_src/css/themes/codeberg/dark-variables.css"; @@ -140,30 +140,30 @@ in "d '${customDir}/public/assets' 0750 ${user} ${group} - -" "d '${customDir}/public/assets/img' 0750 ${user} ${group} - -" # Copeberg logo, thanks Raf <3 - "f '${customDir}/public/assets/img/logo.svg' - - - - ${img}/logo.svg" - "f '${customDir}/public/assets/img/logo.png' - - - - ${img}/logo.png" - "f '${customDir}/public/assets/img/apple-touch-icon' - - - - ${img}/logo.png" - "f '${customDir}/public/assets/img/favicon.svg' - - - - ${img}/logo.svg" - "f '${customDir}/public/assets/img/favicon.png' - - - - ${img}/logo.png" + "L+ '${customDir}/public/assets/img/logo.svg' - - - - ${img}/logo.svg" + "L+ '${customDir}/public/assets/img/logo.png' - - - - ${img}/logo.png" + "L+ '${customDir}/public/assets/img/apple-touch-icon' - - - - ${img}/logo.png" + "L+ '${customDir}/public/assets/img/favicon.svg' - - - - ${img}/logo.svg" + "L+ '${customDir}/public/assets/img/favicon.png' - - - - ${img}/logo.png" # Theming shenanigans "d '${customDir}/public/assets' 0750 ${user} ${group} - -" "d '${customDir}/public/assets/css' 0750 ${user} ${group} - -" "d '${customDir}/public/assets/css/codeberg' 0750 ${user} ${group} - -" - "f '${customDir}/public/assets/css/theme-codeberg-dark.css' - - - - ${theme-codeberg-dark}" - "f '${customDir}/public/assets/css/codeberg/base-brand.css' - - - - ${base-brand}" - "f '${customDir}/public/assets/css/codeberg/dark-variables.css' - - - - ${dark-variables}" + "L+ '${customDir}/public/assets/css/theme-codeberg-dark.css' - - - - ${theme-codeberg-dark}" + "L+ '${customDir}/public/assets/css/codeberg/base-brand.css' - - - - ${base-brand}" + "L+ '${customDir}/public/assets/css/codeberg/dark-variables.css' - - - - ${dark-variables}" # Templates "d '${customDir}/templates' 0750 ${user} ${group} - -" "d '${customDir}/templates/repo' 0750 ${user} ${group} - -" # Home page - "f '${customDir}/templates/home.tmpl' - - - - ${./templates}/home.tmpl" - "f '${customDir}/templates/repo/header.tmpl' - - - - ${./templates/repo}/header.tmpl" + "L+ '${customDir}/templates/home.tmpl' - - - - ${./templates}/home.tmpl" + "L+ '${customDir}/templates/repo/header.tmpl' - - - - ${./templates/repo}/header.tmpl" # Fuck off scrapers - "f ${customDir}/public/robots.txt - - - - ${robots.outPath}" + "L+ ${customDir}/public/robots.txt - - - - ${robots.outPath}" ]; }; } diff --git a/modules/system/hardware/graphics.mod.nix b/modules/system/hardware/graphics.mod.nix index 063e26e..ffd09ea 100644 --- a/modules/system/hardware/graphics.mod.nix +++ b/modules/system/hardware/graphics.mod.nix @@ -1,11 +1,10 @@ { config, lib, - pkgs, ... }: let - inherit (lib.modules) mkDefault mkIf; + inherit (lib.modules) mkIf; inherit (lib.options) mkEnableOption; cfg = config.modules.system.hardware; @@ -19,21 +18,12 @@ in }; config = { hardware = { - graphics = { - enable = true; - extraPackages = [ pkgs.nvidia-vaapi-driver ]; - }; - + graphics.enable = true; nvidia = mkIf cfg.nvidia.enable { - open = mkDefault true; + # we want the open-source drivers + open = true; - # Whether to enable kernel modesetting when using the NVIDIA proprietary driver. - # Enabling this causes the proprietary NVIDIA driver to provide its own - # framebuffer device, which can cause Wayland compositors to work when - # they otherwise wouldn’t. . modesetting.enable = true; - - # nvidia-settings is useless on NixOS. nvidiaSettings = false; # fixes sleep on nvidia devices @@ -44,27 +34,6 @@ in package = config.boot.kernelPackages.nvidiaPackages.beta; }; }; - services.xserver.videoDrivers = [ - "nvidia" - ]; - - environment.systemPackages = builtins.attrValues { - inherit (pkgs) - mesa - vulkan-tools - vulkan-loader - libva - libva-utils - ; - inherit (pkgs.nvtopPackages) nvidia; - }; - # Nouveau is a set of free and open-source drivers for NVIDIA GPUs - # that provide 2D/3D acceleration for all NVIDIA GPUs. - # Its use is in general not recommended due to its considerably worse - # performance compared to NVIDIA's kernel modules, as it does not - # support reclocking (changing the GPU clock frequency on-demand) - # for many NVIDIA GPUs. - # I therefore disable it to save myself from headaches. - boot.blacklistedKernelModules = mkIf cfg.nvidia.enable [ "nouveau" ]; + services.xserver.videoDrivers = mkIf cfg.nvidia.enable [ "nvidia" ]; }; } diff --git a/modules/system/nix/nixpkgs.mod.nix b/modules/system/nix/nixpkgs.mod.nix index 2955c48..8092b9d 100644 --- a/modules/system/nix/nixpkgs.mod.nix +++ b/modules/system/nix/nixpkgs.mod.nix @@ -20,41 +20,43 @@ in readOnly = true; }; - config.nixpkgs.pkgs = import sources.nixpkgs { - inherit (pkgs.stdenv) hostPlatform; - overlays = [ ]; - config = { - # Configuration reference: - # - # Disallow broken packages to be built. - allowBroken = false; + config.nixpkgs.pkgs = ( + import sources.nixpkgs { + hostPlatform = pkgs.stdenv.hostPlatform; + overlays = [ ]; + config = { + # Configuration reference: + # + # Disallow broken packages to be built. + allowBroken = false; - allowUnsupportedSystem = true; + allowUnsupportedSystem = true; - # Warn when config contains an unrecognized attribute. - # This might be useful for getting a better configuration. - warnUndeclaredOptions = true; + # Warn when config contains an unrecognized attribute. + # This might be useful for getting a better configuration. + warnUndeclaredOptions = true; - # Allow unfree packages - allowUnfree = true; + # Allow unfree packages + allowUnfree = true; - # Permitted insecure packages in a system. - # Default to none, add more as necessary. - # Matrix also likes using deprecated libraries, which tend to go into this list. - # permittedInsecurePackages = []; + # Permitted insecure packages in a system. + # Default to none, add more as necessary. + # Matrix also likes using deprecated libraries, which tend to go into this list. + # permittedInsecurePackages = []; - # Whether to set enableParallelBuilding to true by default while - # building nixpkgs packages. Changing the default causes a mass rebuild. - enableParallelBuildingByDefault = false; + # Whether to set enableParallelBuilding to true by default while + # building nixpkgs packages. Changing the default causes a mass rebuild. + enableParallelBuildingByDefault = false; - # Whether to expose old attribute names for compatibility. - # This improves backwards compatibility, - # which I could not care less about in my configuration. - allowAliases = false; + # Whether to expose old attribute names for compatibility. + # This improves backwards compatibility, + # which I could not care less about in my configuration. + allowAliases = false; - # List of derivation warnings to display while rebuilding. - # See: - showDerivationWarnings = [ ]; - }; - }; + # List of derivation warnings to display while rebuilding. + # See: + showDerivationWarnings = [ ]; + }; + } + ); } diff --git a/modules/wms/niri/niri.mod.nix b/modules/wms/niri/niri.mod.nix index 0e45e4e..df64a42 100644 --- a/modules/wms/niri/niri.mod.nix +++ b/modules/wms/niri/niri.mod.nix @@ -30,6 +30,9 @@ let allowBuiltinFetchGit = true; lockFile = "${sources.niri}/Cargo.lock"; }; + + strictDeps = true; + doInstallCheck = false; doCheck = false; nativeBuildInputs = with pkgs; [ diff --git a/npins/sources.json b/npins/sources.json index 78c3e5d..25e0429 100644 --- a/npins/sources.json +++ b/npins/sources.json @@ -1,18 +1,5 @@ { "pins": { - "comma": { - "type": "Git", - "repository": { - "type": "GitHub", - "owner": "nix-community", - "repo": "comma" - }, - "branch": "master", - "submodules": false, - "revision": "393f20bc8805730b8183460235f26ae3fc171509", - "url": "https://github.com/nix-community/comma/archive/393f20bc8805730b8183460235f26ae3fc171509.tar.gz", - "hash": "sha256-OLerZuEhGTeSg7uiiEL+AV9iusBZLhwCx4pdYGTGRNU=" - }, "flake-compat": { "type": "Git", "repository": { @@ -62,9 +49,9 @@ }, "branch": "master", "submodules": false, - "revision": "4775927ef576f6493b79b1d205e42493d6878d47", - "url": "https://github.com/nix-community/lanzaboote/archive/4775927ef576f6493b79b1d205e42493d6878d47.tar.gz", - "hash": "sha256-wGfVht5kOLc9t3GZxEr4IIq5QgHV6nB3w9qqhcVKloo=" + "revision": "5a776450d904b7ccd377c2a759703152b2553e98", + "url": "https://github.com/nix-community/lanzaboote/archive/5a776450d904b7ccd377c2a759703152b2553e98.tar.gz", + "hash": "sha256-9Cc0YqL9ZUpaybJsrRJfXex91QlPmQNqpTLgw/KvJGA=" }, "lix": { "type": "Git", @@ -76,9 +63,9 @@ }, "branch": "main", "submodules": false, - "revision": "ef94901156c0c688ffffaa2c5caf1498119f01d4", - "url": "https://git.lix.systems/lix-project/lix/archive/ef94901156c0c688ffffaa2c5caf1498119f01d4.tar.gz", - "hash": "sha256-fCaJ29ZqevsIT1yqbpgdKeYr5GHF6sDhHlcXo2m+VuI=" + "revision": "43d6a79863d5e28b6a2cd98ecb22fe4ff491057e", + "url": "https://git.lix.systems/lix-project/lix/archive/43d6a79863d5e28b6a2cd98ecb22fe4ff491057e.tar.gz", + "hash": "sha256-/C+d8ET7B935H+xY9NTlw2kFiCeDq380yhv9Ez4379k=" }, "lix-module": { "type": "Git", @@ -103,9 +90,9 @@ }, "branch": "master", "submodules": false, - "revision": "d9a869acec8dd35efa658234c158e6fc82e7064a", - "url": "https://github.com/nix-community/nh/archive/d9a869acec8dd35efa658234c158e6fc82e7064a.tar.gz", - "hash": "sha256-OIYIlXCYOHLvapwxKwX5nixMT1pf9hTx+/oWN9PHWPk=" + "revision": "a90e3124111d9c3eb64e97a5334db09a8e2a4bae", + "url": "https://github.com/nix-community/nh/archive/a90e3124111d9c3eb64e97a5334db09a8e2a4bae.tar.gz", + "hash": "sha256-KKaUEg1/ntHVsG61CkKFr2mfdsoK9Nj5FM/W1PBhe5o=" }, "nil": { "type": "Git", @@ -155,8 +142,8 @@ "nixpkgs": { "type": "Channel", "name": "nixpkgs-unstable", - "url": "https://releases.nixos.org/nixpkgs/nixpkgs-25.11pre834687.6027c30c8e98/nixexprs.tar.xz", - "hash": "sha256-Ba/cFHWBoCISrKBcqU8kH/8LJXYUj2kfFz7l7a7RwMU=" + "url": "https://releases.nixos.org/nixpkgs/nixpkgs-25.11pre833298.83e677f31c84/nixexprs.tar.xz", + "hash": "sha256-GCDhyo1oW8YXwYNKSsJzwy4ilTMnRrPh+6OTWatUYn4=" }, "npins": { "type": "Git", @@ -179,9 +166,9 @@ }, "branch": "master", "submodules": false, - "revision": "a5431dd02dc23d9ef1680e67777fed00fe5f7cda", + "revision": "db77c71c216530159c2dcf5b269ebb4706b2e2dd", "url": null, - "hash": "sha256-vqkSDvh7hWhPvNjMjEDV4KbSCv2jyl2Arh73ZXe274k=" + "hash": "sha256-QG14m53ZGp2Gk7xD2Q+Tf7RYCKfk/BYRaBtX3X4IKbc=" }, "spicetify-nix": { "type": "Git", @@ -192,9 +179,9 @@ }, "branch": "master", "submodules": false, - "revision": "26c488b60360e15db372483d826cec89ac532980", - "url": "https://github.com/Gerg-L/spicetify-nix/archive/26c488b60360e15db372483d826cec89ac532980.tar.gz", - "hash": "sha256-Ow+qyFckroPS4SQFHcFZ8mKh3HIQ2pQdC6DRjiYF9EE=" + "revision": "51ac0aee7e7ee21ca0874b913f07f9004bc9311f", + "url": "https://github.com/Gerg-L/spicetify-nix/archive/51ac0aee7e7ee21ca0874b913f07f9004bc9311f.tar.gz", + "hash": "sha256-1AK8+W7d5eNyGRkcWHa+9oIChLJbY6jt7ujSJo+ft4M=" }, "systems": { "type": "Git", diff --git a/templates/rust/flake.nix b/templates/rust/flake.nix index 2bc9461..c535237 100644 --- a/templates/rust/flake.nix +++ b/templates/rust/flake.nix @@ -20,7 +20,7 @@ ralc = pkgsFor.${system}.callPackage ./nix/package.nix { }; }); - devShells = mapAttrs (_: pkgs: { + devShells = mapAttrs (system: pkgs: { default = pkgs.mkShell { packages = with pkgs; [ cargo