this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

refactor: move some flakes to npins

kinda nice

+301 -80
+1 -65
flake.lock
··· 1 1 { 2 2 "nodes": { 3 - "helix": { 4 - "inputs": { 5 - "nixpkgs": [ 6 - "nixpkgs" 7 - ], 8 - "rust-overlay": "rust-overlay" 9 - }, 10 - "locked": { 11 - "lastModified": 1770128729, 12 - "narHash": "sha256-SgCwJaFXgToqa4r5AQ549kKJt+iUxYood082tedZ4iw=", 13 - "owner": "helix-editor", 14 - "repo": "helix", 15 - "rev": "628725e47ed9b677b0607067b3f958d3a4ffdca9", 16 - "type": "github" 17 - }, 18 - "original": { 19 - "owner": "helix-editor", 20 - "repo": "helix", 21 - "type": "github" 22 - } 23 - }, 24 3 "hjem": { 25 4 "inputs": { 26 5 "nix-darwin": [], ··· 117 96 }, 118 97 "root": { 119 98 "inputs": { 120 - "helix": "helix", 121 99 "hjem": "hjem", 122 100 "nix-flatpak": "nix-flatpak", 123 101 "nix-index-db": "nix-index-db", 124 102 "nixos-wsl": "nixos-wsl", 125 - "nixpkgs": "nixpkgs", 126 - "tuigreet": "tuigreet" 127 - } 128 - }, 129 - "rust-overlay": { 130 - "inputs": { 131 - "nixpkgs": [ 132 - "helix", 133 - "nixpkgs" 134 - ] 135 - }, 136 - "locked": { 137 - "lastModified": 1759631821, 138 - "narHash": "sha256-V8A1L0FaU/aSXZ1QNJScxC12uP4hANeRBgI4YdhHeRM=", 139 - "owner": "oxalica", 140 - "repo": "rust-overlay", 141 - "rev": "1d7cbdaad90f8a5255a89a6eddd8af24dc89cafe", 142 - "type": "github" 143 - }, 144 - "original": { 145 - "owner": "oxalica", 146 - "repo": "rust-overlay", 147 - "type": "github" 148 - } 149 - }, 150 - "tuigreet": { 151 - "inputs": { 152 - "nixpkgs": [ 153 - "nixpkgs" 154 - ] 155 - }, 156 - "locked": { 157 - "lastModified": 1769070572, 158 - "narHash": "sha256-gVrr8DEPml/VV5aLfLZ170VS2NNnla0BqG7sJjwNWXg=", 159 - "owner": "notashelf", 160 - "repo": "tuigreet", 161 - "rev": "46556a7af6e9e639fd5e30d80265cf723fbb2478", 162 - "type": "github" 163 - }, 164 - "original": { 165 - "owner": "notashelf", 166 - "repo": "tuigreet", 167 - "type": "github" 103 + "nixpkgs": "nixpkgs" 168 104 } 169 105 } 170 106 },
+4 -10
flake.nix
··· 21 21 flake-compat.follows = ""; 22 22 }; 23 23 }; 24 - helix = { 25 - url = "github:helix-editor/helix"; 26 - inputs.nixpkgs.follows = "nixpkgs"; 27 - }; 28 - tuigreet = { 29 - url = "github:notashelf/tuigreet"; 30 - inputs.nixpkgs.follows = "nixpkgs"; 31 - }; 32 24 }; 33 25 34 26 outputs = inputs @ { ··· 36 28 nix-flatpak, 37 29 ... 38 30 }: let 31 + pins = import ./pins; 32 + 39 33 inherit (nixpkgs) lib; 40 34 41 35 forAllSystems = fn: lib.genAttrs lib.systems.flakeExposed (system: fn system nixpkgs.legacyPackages.${system}); ··· 57 51 lib' = import ./lib {inherit lib;}; 58 52 in 59 53 lib.nixosSystem { 60 - specialArgs = {inherit inputs lib' hostname;}; 61 - modules = [./hosts/${hostname} ./modules nix-flatpak.nixosModules.nix-flatpak]; 54 + specialArgs = {inherit inputs pins lib' hostname;}; 55 + modules = [./hosts/${hostname} ./modules ./pkgs nix-flatpak.nixosModules.nix-flatpak]; 62 56 }); 63 57 }; 64 58 }
+1 -2
modules/programs/helix.nix
··· 1 1 { 2 - inputs, 3 2 lib, 4 3 lib', 5 4 pkgs, ··· 8 7 }: let 9 8 cfg = config.cfg.programs.helix; 10 9 11 - inherit (inputs.helix.packages.${pkgs.stdenv.hostPlatform.system}) helix; 10 + helix = pkgs.localPackages.helix-git; 12 11 helixWrapped = pkgs.symlinkJoin { 13 12 name = "${lib.getName helix}-wrapped"; 14 13 paths = [helix];
+1 -2
modules/services/greetd.nix
··· 1 1 { 2 - inputs, 3 2 lib, 4 3 pkgs, 5 4 hostname, ··· 17 16 useTextGreeter = true; 18 17 settings.default_session = { 19 18 user = "greeter"; 20 - command = lib.getExe inputs.tuigreet.packages.${pkgs.stdenv.hostPlatform.system}.tuigreet; 19 + command = lib.getExe pkgs.localPackages.rafgreet; 21 20 }; 22 21 }; 23 22 environment.etc."tuigreet/config.toml".source = toml.generate "tuigreet-config" {
+234
pins/default.nix
··· 1 + /* 2 + This file is provided under the MIT licence: 3 + 4 + Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 5 + 6 + The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 7 + 8 + THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 9 + */ 10 + # Generated by npins. Do not modify; will be overwritten regularly 11 + let 12 + # Backwards-compatibly make something that previously didn't take any arguments take some 13 + # The function must return an attrset, and will unfortunately be eagerly evaluated 14 + # Same thing, but it catches eval errors on the default argument so that one may still call it with other arguments 15 + mkFunctor = fn: let 16 + e = builtins.tryEval (fn {}); 17 + in 18 + ( 19 + if e.success 20 + then e.value 21 + else {error = fn {};} 22 + ) 23 + // {__functor = _self: fn;}; 24 + 25 + # https://github.com/NixOS/nixpkgs/blob/0258808f5744ca980b9a1f24fe0b1e6f0fecee9c/lib/lists.nix#L295 26 + range = first: last: 27 + if first > last 28 + then [] 29 + else builtins.genList (n: first + n) (last - first + 1); 30 + 31 + # https://github.com/NixOS/nixpkgs/blob/0258808f5744ca980b9a1f24fe0b1e6f0fecee9c/lib/strings.nix#L257 32 + stringToCharacters = s: map (p: builtins.substring p 1 s) (range 0 (builtins.stringLength s - 1)); 33 + 34 + # https://github.com/NixOS/nixpkgs/blob/0258808f5744ca980b9a1f24fe0b1e6f0fecee9c/lib/strings.nix#L269 35 + stringAsChars = f: s: concatStrings (map f (stringToCharacters s)); 36 + concatStrings = builtins.concatStringsSep ""; 37 + 38 + # If the environment variable NPINS_OVERRIDE_${name} is set, then use 39 + # the path directly as opposed to the fetched source. 40 + # (Taken from Niv for compatibility) 41 + mayOverride = name: path: let 42 + envVarName = "NPINS_OVERRIDE_${saneName}"; 43 + saneName = stringAsChars (c: 44 + if (builtins.match "[a-zA-Z0-9]" c) == null 45 + then "_" 46 + else c) 47 + name; 48 + ersatz = builtins.getEnv envVarName; 49 + in 50 + if ersatz == "" 51 + then path 52 + else 53 + # this turns the string into an actual Nix path (for both absolute and 54 + # relative paths) 55 + builtins.trace "Overriding path of \"${name}\" with \"${ersatz}\" due to set \"${envVarName}\"" ( 56 + if builtins.substring 0 1 ersatz == "/" 57 + then /. + ersatz 58 + else /. + builtins.getEnv "PWD" + "/${ersatz}" 59 + ); 60 + 61 + mkSource = name: spec: {pkgs ? null}: 62 + assert spec ? type; let 63 + # Unify across builtin and pkgs fetchers. 64 + # `fetchGit` requires a wrapper because of slight API differences. 65 + fetchers = 66 + if pkgs == null 67 + then { 68 + inherit (builtins) fetchTarball fetchurl; 69 + # For some fucking reason, fetchGit has a different signature than the other builtin fetchers … 70 + fetchGit = args: (builtins.fetchGit args).outPath; 71 + } 72 + else { 73 + fetchTarball = { 74 + url, 75 + sha256, 76 + }: 77 + pkgs.fetchzip { 78 + inherit url sha256; 79 + extension = "tar"; 80 + }; 81 + inherit (pkgs) fetchurl; 82 + fetchGit = { 83 + url, 84 + submodules, 85 + rev, 86 + name, 87 + narHash, 88 + }: 89 + pkgs.fetchgit { 90 + inherit url rev name; 91 + fetchSubmodules = submodules; 92 + hash = narHash; 93 + }; 94 + }; 95 + 96 + # Dispatch to the correct code path based on the type 97 + path = 98 + if spec.type == "Git" 99 + then mkGitSource fetchers spec 100 + else if spec.type == "GitRelease" 101 + then mkGitSource fetchers spec 102 + else if spec.type == "PyPi" 103 + then mkPyPiSource fetchers spec 104 + else if spec.type == "Channel" 105 + then mkChannelSource fetchers spec 106 + else if spec.type == "Tarball" 107 + then mkTarballSource fetchers spec 108 + else if spec.type == "Container" 109 + then mkContainerSource pkgs spec 110 + else builtins.throw "Unknown source type ${spec.type}"; 111 + in 112 + spec // {outPath = mayOverride name path;}; 113 + 114 + mkGitSource = { 115 + fetchTarball, 116 + fetchGit, 117 + ... 118 + }: { 119 + repository, 120 + revision, 121 + url ? null, 122 + submodules, 123 + hash, 124 + ... 125 + }: 126 + assert repository ? type; 127 + # At the moment, either it is a plain git repository (which has an url), or it is a GitHub/GitLab repository 128 + # In the latter case, there we will always be an url to the tarball 129 + if url != null && !submodules 130 + then 131 + fetchTarball { 132 + inherit url; 133 + sha256 = hash; 134 + } 135 + else let 136 + url = 137 + if repository.type == "Git" 138 + then repository.url 139 + else if repository.type == "GitHub" 140 + then "https://github.com/${repository.owner}/${repository.repo}.git" 141 + else if repository.type == "GitLab" 142 + then "${repository.server}/${repository.repo_path}.git" 143 + else if repository.type == "Forgejo" 144 + then "${repository.server}/${repository.owner}/${repository.repo}.git" 145 + else throw "Unrecognized repository type ${repository.type}"; 146 + urlToName = url: rev: let 147 + matched = builtins.match "^.*/([^/]*)(\\.git)?$" url; 148 + 149 + short = builtins.substring 0 7 rev; 150 + 151 + appendShort = 152 + if (builtins.match "[a-f0-9]*" rev) != null 153 + then "-${short}" 154 + else ""; 155 + in "${ 156 + if matched == null 157 + then "source" 158 + else builtins.head matched 159 + }${appendShort}"; 160 + name = urlToName url revision; 161 + in 162 + fetchGit { 163 + rev = revision; 164 + narHash = hash; 165 + 166 + inherit name submodules url; 167 + }; 168 + 169 + mkPyPiSource = {fetchurl, ...}: { 170 + url, 171 + hash, 172 + ... 173 + }: 174 + fetchurl { 175 + inherit url; 176 + sha256 = hash; 177 + }; 178 + 179 + mkChannelSource = {fetchTarball, ...}: { 180 + url, 181 + hash, 182 + ... 183 + }: 184 + fetchTarball { 185 + inherit url; 186 + sha256 = hash; 187 + }; 188 + 189 + mkTarballSource = {fetchTarball, ...}: { 190 + url, 191 + locked_url ? url, 192 + hash, 193 + ... 194 + }: 195 + fetchTarball { 196 + url = locked_url; 197 + sha256 = hash; 198 + }; 199 + 200 + mkContainerSource = pkgs: { 201 + image_name, 202 + image_tag, 203 + image_digest, 204 + ... 205 + }: 206 + if pkgs == null 207 + then builtins.throw "container sources require passing in a Nixpkgs value: https://github.com/andir/npins/blob/master/README.md#using-the-nixpkgs-fetchers" 208 + else 209 + pkgs.dockerTools.pullImage { 210 + imageName = image_name; 211 + imageDigest = image_digest; 212 + finalImageTag = image_tag; 213 + }; 214 + in 215 + mkFunctor ( 216 + {input ? ./sources.json}: let 217 + data = 218 + if builtins.isPath input 219 + then 220 + # while `readFile` will throw an error anyways if the path doesn't exist, 221 + # we still need to check beforehand because *our* error can be caught but not the one from the builtin 222 + # *piegames sighs* 223 + if builtins.pathExists input 224 + then builtins.fromJSON (builtins.readFile input) 225 + else throw "Input path ${toString input} does not exist" 226 + else if builtins.isAttrs input 227 + then input 228 + else throw "Unsupported input type ${builtins.typeOf input}, must be a path or an attrset"; 229 + version = data.version; 230 + in 231 + if version == 7 232 + then builtins.mapAttrs (name: spec: mkFunctor (mkSource name spec)) data.pins 233 + else throw "Unsupported format version ${toString version} in sources.json. Try running `npins upgrade`" 234 + )
+31
pins/sources.json
··· 1 + { 2 + "pins": { 3 + "helix": { 4 + "type": "Git", 5 + "repository": { 6 + "type": "GitHub", 7 + "owner": "helix-editor", 8 + "repo": "helix" 9 + }, 10 + "branch": "master", 11 + "submodules": false, 12 + "revision": "c01d024f293240ae9ed4b3fb826f8292105fe3b2", 13 + "url": "https://github.com/helix-editor/helix/archive/c01d024f293240ae9ed4b3fb826f8292105fe3b2.tar.gz", 14 + "hash": "sha256-lu3yU2yw8nb/1F2AUCF3QqBgiBRicxBgpKNM1xa2huU=" 15 + }, 16 + "tuigreet": { 17 + "type": "Git", 18 + "repository": { 19 + "type": "GitHub", 20 + "owner": "notashelf", 21 + "repo": "tuigreet" 22 + }, 23 + "branch": "master", 24 + "submodules": false, 25 + "revision": "b05e1c335cc79881b3c4822f8c8192c38efb2d80", 26 + "url": "https://github.com/notashelf/tuigreet/archive/b05e1c335cc79881b3c4822f8c8192c38efb2d80.tar.gz", 27 + "hash": "sha256-vaiq9NaaXM4oNIXxcff3EXp3T2Mu3OLxFyFK+el4BZs=" 28 + } 29 + }, 30 + "version": 7 31 + }
+15
pkgs/default.nix
··· 1 + { 2 + pins, 3 + lib, 4 + ... 5 + }: { 6 + nixpkgs.overlays = [ 7 + (self: _: { 8 + localPackages = lib.pipe ./. [ 9 + builtins.readDir 10 + (lib.filterAttrs (_: v: v == "directory")) 11 + (builtins.mapAttrs (k: _: self.callPackage "${./.}/${k}" {inherit pins;})) 12 + ]; 13 + }) 14 + ]; 15 + }
+5
pkgs/helix-git/default.nix
··· 1 + { 2 + pins, 3 + callPackage, 4 + }: 5 + callPackage "${pins.helix}/default.nix" {}
+5
pkgs/rafgreet/default.nix
··· 1 + { 2 + pins, 3 + callPackage, 4 + }: 5 + callPackage "${pins.tuigreet}/nix/package.nix" {}
+4 -1
shell.nix
··· 2 2 mkShell, 3 3 npins, 4 4 }: 5 - mkShell {packages = [npins];} 5 + mkShell { 6 + packages = [npins]; 7 + env.NPINS_DIRECTORY = "pins"; 8 + }