From 0ff80a75965cbd4f9b3c3f161a001706652dcfe5 Mon Sep 17 00:00:00 2001 From: ulic-youthlic Date: Thu, 13 Mar 2025 20:11:08 +0800 Subject: [PATCH 1/8] add homeManagerFlakeModule for declaring homeManager flake outputs --- README.md | 6 +++--- flake.nix | 9 ++++++--- nixos/modules/home.nix | 4 ++-- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 15074e0..d15cac1 100644 --- a/README.md +++ b/README.md @@ -41,8 +41,8 @@ Hey, you. This is my nixos configurations. | `overlays.additions` | the ovelrays add packages in `` | ./overlays/additions | | `nixosModules.default` | nixos modules shared on different nixos machines | ./nixos/modules | | `nixosConfigurations.${machine}` | machine-local nixos config | ./nixos/configurations/${machine} | -| `homeManagerModules.default` | home-manager modules shared between different user and machine combinations | ./home/modules | -| `homeManagerModules.extra` | home-manager modules only for non-nixos | ./home/extra | -| `homeManagerModules.${user}` | home-manager modules shared between different users | ./home/${user}/modules | +| `homeModules.default` | home-manager modules shared between different user and machine combinations | ./home/modules | +| `homeModules.extra` | home-manager modules only for non-nixos | ./home/extra | +| `homeModules.${user}` | home-manager modules shared between different users | ./home/${user}/modules | | `homeConfigurations."${user}@${machine}"` | home-manager config for different user and machine combinations | ./home/${user}/configurations/${machine} | | `deploy.nodes.${machine}.system` | deploy-rs profile for deploying `nixosConfiguration.${machine}` remotely | - | diff --git a/flake.nix b/flake.nix index 331c4f3..00dfed1 100644 --- a/flake.nix +++ b/flake.nix @@ -181,6 +181,9 @@ in flake-parts.lib.mkFlake { inherit inputs; } { systems = flake-utils.lib.defaultSystems; + imports = [ + inputs.home-manager.flakeModules.home-manager + ]; perSystem = ( { pkgs, system, ... }@args: { @@ -272,12 +275,12 @@ [ "${toString ./home}/${unixName}/configurations/${hostName}" ] - ++ (with outputs.homeManagerModules; [ + ++ (with outputs.homeModules; [ default extra ]) ++ [ - outputs.homeManagerModules."${unixName}" + outputs.homeModules."${unixName}" ]; extraSpecialArgs = { inherit @@ -304,7 +307,7 @@ hostName = "Cape"; unixName = "alice"; }; - homeManagerModules = + homeModules = { default = import ./home/modules; extra = import ./home/extra; diff --git a/nixos/modules/home.nix b/nixos/modules/home.nix index 638c072..d44bfa9 100644 --- a/nixos/modules/home.nix +++ b/nixos/modules/home.nix @@ -47,7 +47,7 @@ { ... }: { imports = [ - outputs.homeManagerModules."${unixName}" + outputs.homeModules."${unixName}" (rootPath + "/home/${unixName}/configurations/${hostName}") ]; } @@ -58,7 +58,7 @@ inherit (pkgs) system; }; backupFileExtension = "backup"; - sharedModules = [ outputs.homeManagerModules.default ]; + sharedModules = [ outputs.homeModules.default ]; }; }; } From 9ea6c7cbf92db1c6fbb6bff8ee0743195105a436 Mon Sep 17 00:00:00 2001 From: ulic-youthlic Date: Fri, 14 Mar 2025 01:05:16 +0800 Subject: [PATCH 2/8] add some tools for Tytonidae --- nixos/configurations/Tytonidae/default.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/nixos/configurations/Tytonidae/default.nix b/nixos/configurations/Tytonidae/default.nix index 6236f4d..df01b37 100644 --- a/nixos/configurations/Tytonidae/default.nix +++ b/nixos/configurations/Tytonidae/default.nix @@ -93,6 +93,10 @@ fractal juicity + waypipe + wineWow64Packages.waylandFull + iperf3 + nvfetcher ]; environment.variables.EDITOR = "hx"; From 4e7a9586213b67eb332d03083179353fc708c1f9 Mon Sep 17 00:00:00 2001 From: ulic-youthlic Date: Fri, 14 Mar 2025 01:33:02 +0800 Subject: [PATCH 3/8] add ipv6 support for eno2 --- nixos/configurations/Tytonidae/networking.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/nixos/configurations/Tytonidae/networking.nix b/nixos/configurations/Tytonidae/networking.nix index 3da415a..a852bee 100644 --- a/nixos/configurations/Tytonidae/networking.nix +++ b/nixos/configurations/Tytonidae/networking.nix @@ -20,10 +20,10 @@ } ]; matchConfig.Name = "eno2"; - # networkConfig = { - # DHCP = "yes"; - # IPv6AcceptRA = true; - # }; + networkConfig = { + DHCP = "yes"; + IPv6AcceptRA = true; + }; }; }; }; From 07546c9567d93fceefec648cdae97ffe398a1ba2 Mon Sep 17 00:00:00 2001 From: ulic-youthlic Date: Fri, 14 Mar 2025 05:22:43 +0800 Subject: [PATCH 4/8] update flake inputs --- .justfile | 1 + flake.lock | 128 ++++++++++++++++++++++++++--------------------------- flake.nix | 2 +- 3 files changed, 66 insertions(+), 65 deletions(-) diff --git a/.justfile b/.justfile index 556f2f6..5f62677 100755 --- a/.justfile +++ b/.justfile @@ -13,6 +13,7 @@ switch specialisation=DEFAULT_SPECIALISATION: nh os switch {{ FLAKE_HOME }} {{ if specialisation == DEFAULT_SPECIALISATION { "-S" } else { "-s " + specialisation } }} update: + cd pkgs && nvfetcher nix flake update --log-format internal-json 2>&1 | nom --json build specialisation=DEFAULT_SPECIALISATION: diff --git a/flake.lock b/flake.lock index 238766b..29a270e 100644 --- a/flake.lock +++ b/flake.lock @@ -70,11 +70,11 @@ "bt-tracker": { "flake": false, "locked": { - "lastModified": 1741680653, - "narHash": "sha256-b5Y241PYSU+H6g1T4gvyT69ELjgCiLIueHIXsmlmDcQ=", + "lastModified": 1741882256, + "narHash": "sha256-81uvZfscNlIySFMsM1wAyLnJy8cqSQKMbi/9jHFX8Es=", "owner": "XIU2", "repo": "TrackersListCollection", - "rev": "1e195e467d0e5bc12e051d76ed87959a4241fa26", + "rev": "537469b1a219b6a1dce34dc75040d538c921aa0d", "type": "github" }, "original": { @@ -137,11 +137,11 @@ ] }, "locked": { - "lastModified": 1741684000, - "narHash": "sha256-NQykaWIrn5zilncefIvW4jPQ76YMXVK/dMTzkSVDmdk=", + "lastModified": 1741786315, + "narHash": "sha256-VT65AE2syHVj6v/DGB496bqBnu1PXrrzwlw07/Zpllc=", "owner": "nix-community", "repo": "disko", - "rev": "2db1d64fc084b1d15e3871dffc02c62a94ed6ed7", + "rev": "0d8c6ad4a43906d14abd5c60e0ffe7b587b213de", "type": "github" }, "original": { @@ -332,11 +332,11 @@ "zig2nix": "zig2nix" }, "locked": { - "lastModified": 1741594465, - "narHash": "sha256-8a/QIgNwV8VGn8JIiACmVVEdue+U3juiMSAO1DEUTC4=", + "lastModified": 1741886369, + "narHash": "sha256-PupKttqs+AQYQnyQuQKBLTiBTs1DtQB5J2LrTi6qBO0=", "owner": "ghostty-org", "repo": "ghostty", - "rev": "95daca616db5c24d7bb37fd5a3ac2f8762bb4ead", + "rev": "73c7943fff38f679a9a434457b5089bc5722411d", "type": "github" }, "original": { @@ -421,11 +421,11 @@ "rust-overlay": "rust-overlay" }, "locked": { - "lastModified": 1741703648, - "narHash": "sha256-JR0uyqJPJEbXLSPhlQJZvia3f6Ir7E9kXxXb/N4I45w=", + "lastModified": 1741884213, + "narHash": "sha256-qcfEVfhCXSzIz57PFR4AtILp+X0BaiF1zx3omKkxOrI=", "owner": "helix-editor", "repo": "helix", - "rev": "f9360fb27e60b21cfd824c4a68d2b5df4edb745b", + "rev": "44bddf51b76eab8b4096448e52a33964a52f7d2e", "type": "github" }, "original": { @@ -442,11 +442,11 @@ ] }, "locked": { - "lastModified": 1741701235, - "narHash": "sha256-gBlb8R9gnjUAT5XabJeel3C2iEUiBHx3+91651y3Sqo=", + "lastModified": 1741894454, + "narHash": "sha256-Mu2YXrGr/8Cid6W44AXci/YYnASoXjGrMV9Sjs66oyc=", "owner": "nix-community", "repo": "home-manager", - "rev": "c630dfa8abcc65984cc1e47fb25d4552c81dd37e", + "rev": "0b0baed7b2bf6a5e365d4cba042b580a2bc32e34", "type": "github" }, "original": { @@ -466,11 +466,11 @@ "rust-overlay": "rust-overlay_2" }, "locked": { - "lastModified": 1741682127, - "narHash": "sha256-KnEVVbmIURr3FFFZm2fAUX8qe4BC67LnIDTpHwyb4YU=", + "lastModified": 1741890984, + "narHash": "sha256-KOA547ghNe57ytljng+Q4m4VlF8Xbd4J6FVHf3Qfelk=", "owner": "jj-vcs", "repo": "jj", - "rev": "d37a5b1b74db3641da755dc8d5be4e95fa461bdb", + "rev": "117c2620864715d614e0c658472e116c8bf7cf1d", "type": "github" }, "original": { @@ -482,11 +482,11 @@ "lix": { "flake": false, "locked": { - "lastModified": 1738174211, - "narHash": "sha256-eYmp1mKM4kULV1W+EBtCPk6LmKWl2REivaYfGRl+AWo=", - "rev": "64e33a7e09a0d1faacf2fd3f6ebd647fe4d8346a", + "lastModified": 1741888409, + "narHash": "sha256-gJ7QmlwsJ/QdwUjwTjifNo3v7OBQm2N6xa19l3mMWM4=", + "rev": "20edd45ae816c73504ddfb9c678756e003ceeafd", "type": "tarball", - "url": "https://git.lix.systems/api/v1/repos/lix-project/lix/archive/64e33a7e09a0d1faacf2fd3f6ebd647fe4d8346a.tar.gz?rev=64e33a7e09a0d1faacf2fd3f6ebd647fe4d8346a" + "url": "https://git.lix.systems/api/v1/repos/lix-project/lix/archive/20edd45ae816c73504ddfb9c678756e003ceeafd.tar.gz?rev=20edd45ae816c73504ddfb9c678756e003ceeafd" }, "original": { "type": "tarball", @@ -505,11 +505,11 @@ ] }, "locked": { - "lastModified": 1738176840, - "narHash": "sha256-NG3IRvRs3u3btVCN861FqHvgOwqcNT/Oy6PBG86F5/E=", + "lastModified": 1741894565, + "narHash": "sha256-2FD0NDJbEjUHloVrtEIms5miJsj1tvQCc/0YK5ambyc=", "ref": "refs/heads/main", - "rev": "621aae0f3cceaffa6d73a4fb0f89c08d338d729e", - "revCount": 133, + "rev": "a6da43f8193d9e329bba1795c42590c27966082e", + "revCount": 136, "type": "git", "url": "https://git.lix.systems/lix-project/nixos-module" }, @@ -530,11 +530,11 @@ "xwayland-satellite-unstable": "xwayland-satellite-unstable" }, "locked": { - "lastModified": 1741686876, - "narHash": "sha256-Kt37Zm9YcQoe/aRVbPFydZcfwIrEAg/U+iz3FcxsOZs=", + "lastModified": 1741895343, + "narHash": "sha256-PNvtVEsGkMr6xMe2MiC41VcKW9uiFVUFQOeBGETJC34=", "owner": "sodiboo", "repo": "niri-flake", - "rev": "fa230971ab63885ba5666588a7b78f75f73d5a85", + "rev": "bc7edeaf3499a8031d60bce91867d9e2d0783502", "type": "github" }, "original": { @@ -563,11 +563,11 @@ "niri-unstable": { "flake": false, "locked": { - "lastModified": 1741684091, - "narHash": "sha256-0tcSDfsGZy01XacnJOsUGZ6X36KYART0xT1u7nbWyso=", + "lastModified": 1741891147, + "narHash": "sha256-hCD/llnO/I0ARk6divzVG3a82nNgrcG58dIe0yhzNo8=", "owner": "YaLTeR", "repo": "niri", - "rev": "b220cdbe7e29d47590147b65a1bfe50f3abeff84", + "rev": "ee0e2c7f1b4edae42d2f1b05466adbdffe156e61", "type": "github" }, "original": { @@ -583,11 +583,11 @@ "nixpkgs-stable": "nixpkgs-stable_3" }, "locked": { - "lastModified": 1741691385, - "narHash": "sha256-Zjs3cBTVm4GLjjLgdi9XS/7nEdjjciKPj2EFOLOrNcE=", + "lastModified": 1741864154, + "narHash": "sha256-A39pa4ZmUqSjuE2L4swvHKGUQ2maKiY0P5UduZ+yE90=", "owner": "lilyinstarlight", "repo": "nixos-cosmic", - "rev": "5af413f4e97073783ed2dc11fd134ffc7771414d", + "rev": "05f8b43a311b3a1f914af89a94480b19d2eceac6", "type": "github" }, "original": { @@ -598,11 +598,11 @@ }, "nixos-hardware": { "locked": { - "lastModified": 1741325094, - "narHash": "sha256-RUAdT8dZ6k/486vnu3tiNRrNW6+Q8uSD2Mq7gTX4jlo=", + "lastModified": 1741792691, + "narHash": "sha256-f0BVt1/cvA0DQ/q3rB+HY4g4tKksd03ZkzI4xehC2Ew=", "owner": "NixOS", "repo": "nixos-hardware", - "rev": "b48cc4dab0f9711af296fc367b6108cf7b8ccb16", + "rev": "e1f12151258b12c567f456d8248e4694e9390613", "type": "github" }, "original": { @@ -661,11 +661,11 @@ }, "nixpkgs-stable_2": { "locked": { - "lastModified": 1741600792, - "narHash": "sha256-yfDy6chHcM7pXpMF4wycuuV+ILSTG486Z/vLx/Bdi6Y=", + "lastModified": 1741862977, + "narHash": "sha256-prZ0M8vE/ghRGGZcflvxCu40ObKaB+ikn74/xQoNrGQ=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "ebe2788eafd539477f83775ef93c3c7e244421d3", + "rev": "cdd2ef009676ac92b715ff26630164bb88fec4e0", "type": "github" }, "original": { @@ -677,11 +677,11 @@ }, "nixpkgs-stable_3": { "locked": { - "lastModified": 1741600792, - "narHash": "sha256-yfDy6chHcM7pXpMF4wycuuV+ILSTG486Z/vLx/Bdi6Y=", + "lastModified": 1741724370, + "narHash": "sha256-WsD+8uodhl58jzKKcPH4jH9dLTLFWZpVmGq4W1XDVF4=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "ebe2788eafd539477f83775ef93c3c7e244421d3", + "rev": "95600680c021743fd87b3e2fe13be7c290e1cac4", "type": "github" }, "original": { @@ -717,11 +717,11 @@ "nur-rycee": { "flake": false, "locked": { - "lastModified": 1741703094, - "narHash": "sha256-rM6zVLFGv2BqPPATh2zyDZaBlzbwe5l0RVw04qL8rtQ=", + "lastModified": 1741895547, + "narHash": "sha256-kSb+kLH23exgw0bBO0lycD7sxIqKoYSwNnFzrfMqRtM=", "owner": "rycee", "repo": "nur-expressions", - "rev": "f086e15336227c65af733b221159739c04132a8a", + "rev": "ec50f84eca2f07eb07e9c8a5e61ee82a83930f53", "type": "gitlab" }, "original": { @@ -841,11 +841,11 @@ ] }, "locked": { - "lastModified": 1741644481, - "narHash": "sha256-E0RrMykMtEv15V3QhpsFutgoSKhL1JBhidn+iZajOyg=", + "lastModified": 1741861888, + "narHash": "sha256-ynOgXAyToeE1UdLNfrUn/hL7MN0OpIS2BtNdLjpjPf0=", "owner": "Mic92", "repo": "sops-nix", - "rev": "e653d71e82575a43fe9d228def8eddb73887b866", + "rev": "d016ce0365b87d848a57c12ffcfdc71da7a2b55f", "type": "github" }, "original": { @@ -882,11 +882,11 @@ "tinted-zed": "tinted-zed" }, "locked": { - "lastModified": 1741703342, - "narHash": "sha256-eU5RTDACahqJSLrR79FdS+dImmrK3YpFByjRWmmqeaU=", + "lastModified": 1741880767, + "narHash": "sha256-tXtop1zIJMyRt1LDERIWwMAMVKdfDtFp/g37YKy2Ke4=", "owner": "danth", "repo": "stylix", - "rev": "9dc48274889d1f5349b8ebc7c83f0907f3c86588", + "rev": "5053a63c87fea3508439b7e9c1a66fa6979a4694", "type": "github" }, "original": { @@ -1049,11 +1049,11 @@ "xwayland-satellite-unstable": { "flake": false, "locked": { - "lastModified": 1741140299, - "narHash": "sha256-Y2bPO92Yg5HcH5ORvrVOQb4wRGEapGEteHXGtNvboxk=", + "lastModified": 1741757154, + "narHash": "sha256-Gr0m144I3kTZ4HZxOpAnQYyyhvyAAN0lEMrSQ3HyxMI=", "owner": "Supreeeme", "repo": "xwayland-satellite", - "rev": "10cb041a80bb815cc1789cfa305923f1f9e3713d", + "rev": "3c50b7da7963e299e47295352c9a1da1c37b4254", "type": "github" }, "original": { @@ -1077,11 +1077,11 @@ ] }, "locked": { - "lastModified": 1738239110, - "narHash": "sha256-Y5i9mQ++dyIQr+zEPNy+KIbc5wjPmfllBrag3cHZgcE=", + "lastModified": 1741702955, + "narHash": "sha256-Emk3VnNByigCBlBN34IH2cMrsUqIhdex02uw9TSDsN0=", "owner": "mitchellh", "repo": "zig-overlay", - "rev": "1a8fb6f3a04724519436355564b95fce5e272504", + "rev": "1152ce759114a94134081270affd970ae1b957ed", "type": "github" }, "original": { @@ -1098,21 +1098,21 @@ ], "nixpkgs": [ "ghostty", - "nixpkgs-stable" + "nixpkgs-unstable" ] }, "locked": { - "lastModified": 1741368279, - "narHash": "sha256-WTaC8HmnIq6O71iK0g9as404BbmS+YyEP5qS85m2JBY=", + "lastModified": 1741816255, + "narHash": "sha256-SJQMnm1vwXy8Td2qp/omjybn+4xZ/MDdZHeK6aa2nb0=", "owner": "jcollie", "repo": "zig2nix", - "rev": "672971b5b6911de21446ad4fc76dee677922eda0", + "rev": "c2a24405298373123e12ca81805e436da648aaf5", "type": "github" }, "original": { "owner": "jcollie", "repo": "zig2nix", - "rev": "672971b5b6911de21446ad4fc76dee677922eda0", + "rev": "c2a24405298373123e12ca81805e436da648aaf5", "type": "github" } } diff --git a/flake.nix b/flake.nix index 00dfed1..cf956e0 100644 --- a/flake.nix +++ b/flake.nix @@ -216,7 +216,7 @@ cachix = x: "https://${x}.cachix.org"; in nixpkgs.lib.flatten [ - mirrors + # mirrors (cachix "nix-community") "https://cache.nixos.org" (cachix "cosmic") From 36f623a93a7e0b0a519aa9791cccba95c4379148 Mon Sep 17 00:00:00 2001 From: ulic-youthlic Date: Fri, 14 Mar 2025 06:55:26 +0800 Subject: [PATCH 5/8] refactor some nix code with pipe --- flake.nix | 89 +++++++++++++++--------------- overlays/modifications/default.nix | 20 +++---- pkgs/helix/default.nix | 2 +- pkgs/helix/runtime.nix | 30 ++++++---- 4 files changed, 72 insertions(+), 69 deletions(-) diff --git a/flake.nix b/flake.nix index cf956e0..f563c03 100644 --- a/flake.nix +++ b/flake.nix @@ -184,7 +184,7 @@ imports = [ inputs.home-manager.flakeModules.home-manager ]; - perSystem = ( + perSystem = { pkgs, system, ... }@args: { _module.args.pkgs = import inputs.nixpkgs { @@ -199,8 +199,7 @@ inherit inputs; } ); - } - ); + }; flake = { nix.settings = { @@ -233,16 +232,11 @@ nixosConfigurations = let nixosConfigDir = ./nixos/configurations; - in - nixpkgs.lib.genAttrs - (map (f: nixpkgs.lib.removeSuffix ".nix" f) (builtins.attrNames (builtins.readDir nixosConfigDir))) - ( + makeNixConfiguration = hostName: nixpkgs.lib.nixosSystem { modules = - [ - outputs.nixosModules.default - ] + [ outputs.nixosModules.default ] ++ [ ( let @@ -252,11 +246,18 @@ if builtins.pathExists dirPath then dirPath else filePath ) ]; - specialArgs = { - inherit inputs outputs rootPath; - }; - } - ); + specialArgs = { inherit inputs outputs rootPath; }; + }; + in + nixosConfigDir + |> builtins.readDir + |> builtins.attrNames + |> map (f: nixpkgs.lib.removeSuffix ".nix" f) + |> map (name: { + inherit name; + value = makeNixConfiguration name; + }) + |> builtins.listToAttrs; } // ( let @@ -313,25 +314,22 @@ extra = import ./home/extra; } // ( - let - allEntries = builtins.readDir ./home; - allUsers = nixpkgs.lib.filterAttrs ( - key: value: - value == "directory" - && ( - !builtins.elem key [ - "modules" - "extra" - ] - ) - ) allEntries; - in - builtins.listToAttrs ( - map (name: { - name = name; - value = import "${toString ./home}/${name}/modules"; - }) (builtins.attrNames allUsers) + ./home + |> builtins.readDir + |> nixpkgs.lib.filterAttrs (key: value: value == "directory") + |> nixpkgs.lib.filterAttrs ( + key: value: + !builtins.elem key [ + "modules" + "extra" + ] ) + |> builtins.attrNames + |> map (name: { + name = name; + value = import "${toString ./home}/${name}/modules"; + }) + |> builtins.listToAttrs ); } ) @@ -361,19 +359,18 @@ }; in { - deploy.nodes = nixpkgs.lib.foldr (a: b: a // b) { } ( - map - ( - hostName: - mkDeployNode { - inherit hostName; - } - ) - [ - "Cape" - "Akun" - ] - ); + deploy.nodes = + [ + "Cape" + "Akun" + ] + |> map ( + hostName: + mkDeployNode { + inherit hostName; + } + ) + |> nixpkgs.lib.foldr (a: b: a // b) { }; } ); }; diff --git a/overlays/modifications/default.nix b/overlays/modifications/default.nix index 222b9b6..82bba99 100644 --- a/overlays/modifications/default.nix +++ b/overlays/modifications/default.nix @@ -2,14 +2,14 @@ final: prev: let inherit (prev) lib; - overlay-files = [ - ./spotify.nix - ./niri.nix - ./ghostty.nix - ./juicity.nix - ./dae.nix - ./jujutsu.nix - ]; - overlay-list = map (file: import file args) overlay-files; in -(lib.composeManyExtensions overlay-list) final prev +[ + ./spotify.nix + ./niri.nix + ./ghostty.nix + ./juicity.nix + ./dae.nix + ./jujutsu.nix +] +|> map (file: import file args) +|> (overlays: (lib.composeManyExtensions overlays) final prev) diff --git a/pkgs/helix/default.nix b/pkgs/helix/default.nix index f8addc4..ceb939d 100644 --- a/pkgs/helix/default.nix +++ b/pkgs/helix/default.nix @@ -38,7 +38,7 @@ let delve lldb rust-analyzer - nil + # nil haskell-language-server neocmakelsp ] diff --git a/pkgs/helix/runtime.nix b/pkgs/helix/runtime.nix index fabefe5..93aa5fb 100644 --- a/pkgs/helix/runtime.nix +++ b/pkgs/helix/runtime.nix @@ -61,20 +61,26 @@ let runHook postFixup ''; }; - grammars = lib.filterAttrs (key: _: lib.hasPrefix "tree-sitter-" key) srcs; + grammars = srcs |> lib.filterAttrs (key: _: lib.hasPrefix "tree-sitter-" key); - queries = lib.mapAttrsToList (_: value: '' - mkdir -p $out/${value.name} + queries = + grammars + |> lib.mapAttrsToList ( + _: value: '' + mkdir -p $out/${value.name} - ln -s ${value.src}/queries/* $out/${value.name}/ - '') grammars; - builtGrammars = builtins.mapAttrs (_: v: { - inherit (v) name; - value = buildGrammar v; - }) grammars; - grammarLinks = lib.mapAttrsToList ( - _: value: "ln -s ${value.value}/${value.name}.so $out/${value.name}.so" - ) builtGrammars; + ln -s ${value.src}/queries/* $out/${value.name}/ + '' + ); + grammarLinks = + grammars + |> builtins.mapAttrs ( + _: v: { + inherit (v) name; + value = buildGrammar v; + } + ) + |> lib.mapAttrsToList (_: value: "ln -s ${value.value}/${value.name}.so $out/${value.name}.so"); grammarDir = runCommandNoCCLocal "helix-grammars" { } '' mkdir -p $out From f9f4a075d3712c66c0ebce4142ad6d25c3a83dda Mon Sep 17 00:00:00 2001 From: ulic-youthlic Date: Sat, 15 Mar 2025 08:15:07 +0800 Subject: [PATCH 6/8] disable open-webui for Tytonidae --- nixos/configurations/Tytonidae/default.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/nixos/configurations/Tytonidae/default.nix b/nixos/configurations/Tytonidae/default.nix index df01b37..afc0d1f 100644 --- a/nixos/configurations/Tytonidae/default.nix +++ b/nixos/configurations/Tytonidae/default.nix @@ -36,7 +36,6 @@ enable = true; unixName = "david"; }; - open-webui.enable = true; transmission.enable = true; nix-ld.enable = true; juicity.client.enable = true; From e3333290f04106dfe4f34c607bf0962c6bae5f24 Mon Sep 17 00:00:00 2001 From: ulic-youthlic Date: Sat, 15 Mar 2025 09:02:31 +0800 Subject: [PATCH 7/8] remove discord-ptb for Akun and Tytonidae --- nixos/configurations/Akun/default.nix | 1 - nixos/configurations/Tytonidae/default.nix | 1 - 2 files changed, 2 deletions(-) diff --git a/nixos/configurations/Akun/default.nix b/nixos/configurations/Akun/default.nix index 9241ca0..d847e1a 100644 --- a/nixos/configurations/Akun/default.nix +++ b/nixos/configurations/Akun/default.nix @@ -42,7 +42,6 @@ helix element-desktop - discord-ptb vlc btop spotify diff --git a/nixos/configurations/Tytonidae/default.nix b/nixos/configurations/Tytonidae/default.nix index afc0d1f..e5c5fc4 100644 --- a/nixos/configurations/Tytonidae/default.nix +++ b/nixos/configurations/Tytonidae/default.nix @@ -76,7 +76,6 @@ helix element-desktop - discord-ptb vlc btop handbrake From d08e080d162d0d5fee76635b04d2bcb13d94923e Mon Sep 17 00:00:00 2001 From: ulic-youthlic Date: Sat, 15 Mar 2025 08:15:07 +0800 Subject: [PATCH 8/8] update flake inputs --- flake.lock | 108 ++++++++++++++------- flake.nix | 18 ++++ nixos/configurations/Akun/stylix.nix | 5 + nixos/configurations/Cape/stylix.nix | 25 +---- nixos/configurations/Tytonidae/stylix.nix | 5 + nixos/modules/containers/forgejo.nix | 9 +- nixos/modules/containers/miniflux.nix | 9 +- overlays/modifications/default.nix | 2 + overlays/modifications/fix-forgejo-lts.nix | 10 ++ overlays/modifications/fix-pwvucontrol.nix | 10 ++ 10 files changed, 139 insertions(+), 62 deletions(-) create mode 100644 overlays/modifications/fix-forgejo-lts.nix create mode 100644 overlays/modifications/fix-pwvucontrol.nix diff --git a/flake.lock b/flake.lock index 29a270e..428baf5 100644 --- a/flake.lock +++ b/flake.lock @@ -70,11 +70,11 @@ "bt-tracker": { "flake": false, "locked": { - "lastModified": 1741882256, - "narHash": "sha256-81uvZfscNlIySFMsM1wAyLnJy8cqSQKMbi/9jHFX8Es=", + "lastModified": 1741997456, + "narHash": "sha256-4WhLuADRRr8tRnySlDGMiPKUBwVfxaOUjBkfaE7lbHw=", "owner": "XIU2", "repo": "TrackersListCollection", - "rev": "537469b1a219b6a1dce34dc75040d538c921aa0d", + "rev": "22a50f839018b5c5c0b4ef2675ea3ad89f12e44e", "type": "github" }, "original": { @@ -332,11 +332,11 @@ "zig2nix": "zig2nix" }, "locked": { - "lastModified": 1741886369, - "narHash": "sha256-PupKttqs+AQYQnyQuQKBLTiBTs1DtQB5J2LrTi6qBO0=", + "lastModified": 1742002412, + "narHash": "sha256-dw7CLa5+tZmfNCPjH2vSAk7SBfsB2Zp7uOcZ1XAADjE=", "owner": "ghostty-org", "repo": "ghostty", - "rev": "73c7943fff38f679a9a434457b5089bc5722411d", + "rev": "550edd426257fa1976a5f1b8b9539543578f5a35", "type": "github" }, "original": { @@ -421,11 +421,11 @@ "rust-overlay": "rust-overlay" }, "locked": { - "lastModified": 1741884213, - "narHash": "sha256-qcfEVfhCXSzIz57PFR4AtILp+X0BaiF1zx3omKkxOrI=", + "lastModified": 1741962962, + "narHash": "sha256-68SVpGxlAFWGmolts5yhWw2v9bx+jmA/0rX3wxIRZkU=", "owner": "helix-editor", "repo": "helix", - "rev": "44bddf51b76eab8b4096448e52a33964a52f7d2e", + "rev": "9574e551cf8ea4d868a8c102647fcfe0d41496df", "type": "github" }, "original": { @@ -442,11 +442,11 @@ ] }, "locked": { - "lastModified": 1741894454, - "narHash": "sha256-Mu2YXrGr/8Cid6W44AXci/YYnASoXjGrMV9Sjs66oyc=", + "lastModified": 1741955947, + "narHash": "sha256-2lbURKclgKqBNm7hVRtWh0A7NrdsibD0EaWhahUVhhY=", "owner": "nix-community", "repo": "home-manager", - "rev": "0b0baed7b2bf6a5e365d4cba042b580a2bc32e34", + "rev": "4e12151c9e014e2449e0beca2c0e9534b96a26b4", "type": "github" }, "original": { @@ -466,11 +466,11 @@ "rust-overlay": "rust-overlay_2" }, "locked": { - "lastModified": 1741890984, - "narHash": "sha256-KOA547ghNe57ytljng+Q4m4VlF8Xbd4J6FVHf3Qfelk=", + "lastModified": 1742003507, + "narHash": "sha256-YqOuNSRC0oduAOWh/EqEaTVHawUyXmNHntqmOVDFaLc=", "owner": "jj-vcs", "repo": "jj", - "rev": "117c2620864715d614e0c658472e116c8bf7cf1d", + "rev": "f8082a052d05fe4424e59bbdf7885452726400f9", "type": "github" }, "original": { @@ -530,11 +530,11 @@ "xwayland-satellite-unstable": "xwayland-satellite-unstable" }, "locked": { - "lastModified": 1741895343, - "narHash": "sha256-PNvtVEsGkMr6xMe2MiC41VcKW9uiFVUFQOeBGETJC34=", + "lastModified": 1741985426, + "narHash": "sha256-qtvcOFwWVQqKyjtVYXpC8Mp/cP/xc/Na6L4UXyHyJHA=", "owner": "sodiboo", "repo": "niri-flake", - "rev": "bc7edeaf3499a8031d60bce91867d9e2d0783502", + "rev": "93a1359e5625bb7724298e92c4cddf0e8022dc00", "type": "github" }, "original": { @@ -563,11 +563,11 @@ "niri-unstable": { "flake": false, "locked": { - "lastModified": 1741891147, - "narHash": "sha256-hCD/llnO/I0ARk6divzVG3a82nNgrcG58dIe0yhzNo8=", + "lastModified": 1741982253, + "narHash": "sha256-pQYos0sgmAlf7VFZHB4FZMu0CACTLLARS++H64NRB1I=", "owner": "YaLTeR", "repo": "niri", - "rev": "ee0e2c7f1b4edae42d2f1b05466adbdffe156e61", + "rev": "f6aa8c17937fadd1da3c8f2f080ea402ae17da87", "type": "github" }, "original": { @@ -583,11 +583,11 @@ "nixpkgs-stable": "nixpkgs-stable_3" }, "locked": { - "lastModified": 1741864154, - "narHash": "sha256-A39pa4ZmUqSjuE2L4swvHKGUQ2maKiY0P5UduZ+yE90=", + "lastModified": 1742006448, + "narHash": "sha256-8OmMOm7MeuhBYYIu9an/OaeH9+mJLXKVj2g/TY8qAg0=", "owner": "lilyinstarlight", "repo": "nixos-cosmic", - "rev": "05f8b43a311b3a1f914af89a94480b19d2eceac6", + "rev": "d63e6b46e0d080fa7cab2cb3ee37b46873615fa3", "type": "github" }, "original": { @@ -613,6 +613,38 @@ } }, "nixpkgs": { + "locked": { + "lastModified": 1741851582, + "narHash": "sha256-cPfs8qMccim2RBgtKGF+x9IBCduRvd/N5F4nYpU0TVE=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "6607cf789e541e7873d40d3a8f7815ea92204f32", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-845dc1e9cbc2e48640b8968af58b4a19db67aa8f": { + "locked": { + "lastModified": 1741960758, + "narHash": "sha256-pSGMbfkxF7TSeco54W+B1q+g22YCVp1qXHgtrdgtyR4=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "845dc1e9cbc2e48640b8968af58b4a19db67aa8f", + "type": "github" + }, + "original": { + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "845dc1e9cbc2e48640b8968af58b4a19db67aa8f", + "type": "github" + } + }, + "nixpkgs-e3e32b642a31e6714ec1b712de8c91a3352ce7e1": { "locked": { "lastModified": 1741513245, "narHash": "sha256-7rTAMNTY1xoBwz0h7ZMtEcd8LELk9R5TzBPoHuhNSCk=", @@ -623,8 +655,8 @@ }, "original": { "owner": "NixOS", - "ref": "nixos-unstable", "repo": "nixpkgs", + "rev": "e3e32b642a31e6714ec1b712de8c91a3352ce7e1", "type": "github" } }, @@ -677,11 +709,11 @@ }, "nixpkgs-stable_3": { "locked": { - "lastModified": 1741724370, - "narHash": "sha256-WsD+8uodhl58jzKKcPH4jH9dLTLFWZpVmGq4W1XDVF4=", + "lastModified": 1741862977, + "narHash": "sha256-prZ0M8vE/ghRGGZcflvxCu40ObKaB+ikn74/xQoNrGQ=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "95600680c021743fd87b3e2fe13be7c290e1cac4", + "rev": "cdd2ef009676ac92b715ff26630164bb88fec4e0", "type": "github" }, "original": { @@ -717,11 +749,11 @@ "nur-rycee": { "flake": false, "locked": { - "lastModified": 1741895547, - "narHash": "sha256-kSb+kLH23exgw0bBO0lycD7sxIqKoYSwNnFzrfMqRtM=", + "lastModified": 1741957870, + "narHash": "sha256-5ahYCLPnBcZX7vlmXzn+m0LDRgYiMDglU6UnH/HngPo=", "owner": "rycee", "repo": "nur-expressions", - "rev": "ec50f84eca2f07eb07e9c8a5e61ee82a83930f53", + "rev": "4021f5dad2a46ff78c1bf82ee45c1656e12164f2", "type": "gitlab" }, "original": { @@ -785,6 +817,8 @@ "nixos-cosmic", "nixpkgs" ], + "nixpkgs-845dc1e9cbc2e48640b8968af58b4a19db67aa8f": "nixpkgs-845dc1e9cbc2e48640b8968af58b4a19db67aa8f", + "nixpkgs-e3e32b642a31e6714ec1b712de8c91a3352ce7e1": "nixpkgs-e3e32b642a31e6714ec1b712de8c91a3352ce7e1", "nur-rycee": "nur-rycee", "nur-xddxdd": "nur-xddxdd", "oskars-dotfiles": "oskars-dotfiles", @@ -882,11 +916,11 @@ "tinted-zed": "tinted-zed" }, "locked": { - "lastModified": 1741880767, - "narHash": "sha256-tXtop1zIJMyRt1LDERIWwMAMVKdfDtFp/g37YKy2Ke4=", + "lastModified": 1741976991, + "narHash": "sha256-74Q3Kpzde+S3pWaZihNFMjCn8lo4wmDVmg+Uvw8YLLQ=", "owner": "danth", "repo": "stylix", - "rev": "5053a63c87fea3508439b7e9c1a66fa6979a4694", + "rev": "e43eb4e2a7dfbd96454df2b1c9418299b4373773", "type": "github" }, "original": { @@ -1049,11 +1083,11 @@ "xwayland-satellite-unstable": { "flake": false, "locked": { - "lastModified": 1741757154, - "narHash": "sha256-Gr0m144I3kTZ4HZxOpAnQYyyhvyAAN0lEMrSQ3HyxMI=", + "lastModified": 1741910413, + "narHash": "sha256-z9bvteu0rf+xmUDj4VifN06XAFJZQGRSOvdN7rn/oDs=", "owner": "Supreeeme", "repo": "xwayland-satellite", - "rev": "3c50b7da7963e299e47295352c9a1da1c37b4254", + "rev": "0325cb1f48a292d873a6844772cca00251cbf945", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index f563c03..f3489de 100644 --- a/flake.nix +++ b/flake.nix @@ -3,8 +3,26 @@ inputs = { # nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + # nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable-small"; + # nixpkgs.url = "github:NixOS/nixpkgs/master"; nixpkgs.follows = "nixos-cosmic/nixpkgs"; + # pr: https://github.com/NixOS/nixpkgs/pull/389740 + nixpkgs-845dc1e9cbc2e48640b8968af58b4a19db67aa8f = { + type = "github"; + owner = "NixOS"; + repo = "nixpkgs"; + rev = "845dc1e9cbc2e48640b8968af58b4a19db67aa8f"; + }; + + # issue: https://github.com/NixOS/nixpkgs/issues/389977 + nixpkgs-e3e32b642a31e6714ec1b712de8c91a3352ce7e1 = { + type = "github"; + owner = "NixOS"; + repo = "nixpkgs"; + rev = "e3e32b642a31e6714ec1b712de8c91a3352ce7e1"; + }; + lix-module = { url = "git+https://git.lix.systems/lix-project/nixos-module"; inputs = { diff --git a/nixos/configurations/Akun/stylix.nix b/nixos/configurations/Akun/stylix.nix index c43cc23..9dee95a 100644 --- a/nixos/configurations/Akun/stylix.nix +++ b/nixos/configurations/Akun/stylix.nix @@ -5,6 +5,11 @@ image = rootPath + "/assets/wallpaper/01.png"; polarity = "dark"; base16Scheme = "${pkgs.base16-schemes}/share/themes/ayu-dark.yaml"; + cursor = { + package = pkgs.rose-pine-cursor; + name = "BreezeX-RosePineDawn-Linux"; + size = 24; + }; fonts = { serif = { package = pkgs.lxgw-wenkai; diff --git a/nixos/configurations/Cape/stylix.nix b/nixos/configurations/Cape/stylix.nix index 9bff339..d2b5e6f 100644 --- a/nixos/configurations/Cape/stylix.nix +++ b/nixos/configurations/Cape/stylix.nix @@ -1,27 +1,6 @@ -{ pkgs, rootPath, ... }: +{ ... }: { stylix = { - enable = true; - image = rootPath + "/assets/wallpaper/01.png"; - polarity = "dark"; - base16Scheme = "${pkgs.base16-schemes}/share/themes/ayu-dark.yaml"; - fonts = { - serif = { - package = pkgs.lxgw-wenkai; - name = "LXGW WenKai"; - }; - sansSerif = { - package = pkgs.noto-fonts-cjk-serif; - name = "Noto Serif CJK SC"; - }; - monospace = { - package = pkgs.nerd-fonts.fira-code; - name = "FiraCode Nerd Font"; - }; - emoji = { - package = pkgs.noto-fonts-emoji; - name = "Noto Color Emoji"; - }; - }; + enable = false; }; } diff --git a/nixos/configurations/Tytonidae/stylix.nix b/nixos/configurations/Tytonidae/stylix.nix index c43cc23..297ea6f 100644 --- a/nixos/configurations/Tytonidae/stylix.nix +++ b/nixos/configurations/Tytonidae/stylix.nix @@ -5,6 +5,11 @@ image = rootPath + "/assets/wallpaper/01.png"; polarity = "dark"; base16Scheme = "${pkgs.base16-schemes}/share/themes/ayu-dark.yaml"; + cursor = { + package = pkgs.rose-pine-cursor; + name = "BreezeX-RosePineDawn-Linux"; + size = 32; + }; fonts = { serif = { package = pkgs.lxgw-wenkai; diff --git a/nixos/modules/containers/forgejo.nix b/nixos/modules/containers/forgejo.nix index 773e71c..913213d 100644 --- a/nixos/modules/containers/forgejo.nix +++ b/nixos/modules/containers/forgejo.nix @@ -1,4 +1,9 @@ -{ config, lib, ... }: +{ + pkgs, + config, + lib, + ... +}: let cfg = config.youthlic.containers.forgejo; in @@ -59,6 +64,8 @@ in ./../programs/postgresql.nix ]; + nixpkgs.pkgs = pkgs; + systemd.tmpfiles.rules = [ "d /var/lib/forgejo 770 forgejo forgejo -" "d /var/lib/postgresql 770 postgres postgres -" diff --git a/nixos/modules/containers/miniflux.nix b/nixos/modules/containers/miniflux.nix index 2408067..43516b3 100644 --- a/nixos/modules/containers/miniflux.nix +++ b/nixos/modules/containers/miniflux.nix @@ -1,4 +1,9 @@ -{ config, lib, ... }: +{ + pkgs, + config, + lib, + ... +}: let cfg = config.youthlic.containers.miniflux; in @@ -41,6 +46,8 @@ in ./../programs/postgresql.nix ]; + nixpkgs.pkgs = pkgs; + systemd.tmpfiles.rules = [ "d /var/lib/miniflux 770 miniflux miniflux -" "d /var/lib/postgresql 770 postgres postgres -" diff --git a/overlays/modifications/default.nix b/overlays/modifications/default.nix index 82bba99..de14be9 100644 --- a/overlays/modifications/default.nix +++ b/overlays/modifications/default.nix @@ -10,6 +10,8 @@ in ./juicity.nix ./dae.nix ./jujutsu.nix + ./fix-pwvucontrol.nix + ./fix-forgejo-lts.nix ] |> map (file: import file args) |> (overlays: (lib.composeManyExtensions overlays) final prev) diff --git a/overlays/modifications/fix-forgejo-lts.nix b/overlays/modifications/fix-forgejo-lts.nix new file mode 100644 index 0000000..4bb8619 --- /dev/null +++ b/overlays/modifications/fix-forgejo-lts.nix @@ -0,0 +1,10 @@ +{ inputs, ... }: +final: prev: +let + inherit (final) stdenv; + inherit (stdenv.hostPlatform) system; +in +{ + forgejo-lts = + inputs.nixpkgs-e3e32b642a31e6714ec1b712de8c91a3352ce7e1.legacyPackages."${system}".forgejo-lts; +} diff --git a/overlays/modifications/fix-pwvucontrol.nix b/overlays/modifications/fix-pwvucontrol.nix new file mode 100644 index 0000000..3a2ee87 --- /dev/null +++ b/overlays/modifications/fix-pwvucontrol.nix @@ -0,0 +1,10 @@ +{ inputs, ... }: +final: prev: +let + inherit (final) stdenv; + inherit (stdenv.hostPlatform) system; +in +{ + pwvucontrol = + inputs.nixpkgs-845dc1e9cbc2e48640b8968af58b4a19db67aa8f.legacyPackages."${system}".pwvucontrol; +}