Your one-stop-cake-shop for everything Freshly Baked has to offer

refactor(*): add nilla/etc. in top level directory

Our josh files and combined project pieces have been a mess for a while.
As I'm creating a new project, I thought it was high time to tidy them
up so they pull out the right files and we can share things like our
inputs.

authored by a.starrysky.fyi and committed by tangled.org e873b3e3 9c03b7f0

+2 -2
.tangled/workflows/packetmix-build.yml
··· 45 45 mkdir -p /tmp/systems-drv-paths 46 46 47 47 systems=$(nix eval \ 48 - --expr 'builtins.concatStringsSep "\n" (builtins.attrNames (import ./packetmix/ci.nix).systems.nixos)' \ 48 + --expr 'builtins.concatStringsSep "\n" (builtins.attrNames (import ./ci.nix).systems.nixos)' \ 49 49 --impure \ 50 50 --show-trace --raw) 51 51 ··· 53 53 echo "Evaluating system $system" 54 54 55 55 eval_out=$(nix eval \ 56 - -f ./packetmix/ci.nix "systems.nixos.$system.result.config.system.build.toplevel.drvPath" \ 56 + -f ./ci.nix "systems.nixos.$system.result.config.system.build.toplevel.drvPath" \ 57 57 --show-trace --raw \ 58 58 2>&1 >"/tmp/systems-drv-paths/$system" | tee /dev/stderr) 59 59 eval_status=$?
+2 -2
.tangled/workflows/packetmix-release.yml
··· 52 52 mkdir -p /tmp/systems-drv-paths 53 53 54 54 systems=$(nix eval \ 55 - --expr 'builtins.concatStringsSep "\n" (builtins.attrNames (import ./packetmix/ci.nix).systems.nixos)' \ 55 + --expr 'builtins.concatStringsSep "\n" (builtins.attrNames (import ./ci.nix).systems.nixos)' \ 56 56 --impure \ 57 57 --show-trace --raw) 58 58 ··· 60 60 echo "Evaluating system $system" 61 61 62 62 eval_out=$(nix eval \ 63 - -f ./packetmix/ci.nix "systems.nixos.$system.result.config.system.build.toplevel.drvPath" \ 63 + -f ./ci.nix "systems.nixos.$system.result.config.system.build.toplevel.drvPath" \ 64 64 --show-trace --raw \ 65 65 2>&1 >"/tmp/systems-drv-paths/$system" | tee /dev/stderr) 66 66 eval_status=$?
+1 -1
.tangled/workflows/packetmix-treefmt.yaml
··· 42 42 set -e 43 43 44 44 treefmt=$(nix build \ 45 - -f ./packetmix/ci.nix packages.treefmt.result.x86_64-linux \ 45 + -f ./ci.nix packages.treefmt.result.x86_64-linux \ 46 46 --store 'ssh-ng://remoteBuilds@midnight?ssh-key=/tmp/key-ssh-remote-build' \ 47 47 --eval-store auto \ 48 48 --show-trace --print-out-paths)
+44
nilla.nix
··· 1 + # SPDX-FileCopyrightText: 2025 FreshlyBakedCake 2 + # 3 + # SPDX-License-Identifier: MIT 4 + 5 + let 6 + pins = import ./npins; 7 + 8 + nilla = import pins.nilla; 9 + 10 + settings = config: { 11 + nixpkgs = { 12 + configuration.allowUnfree = true; 13 + overlays = [ 14 + config.inputs.fenix.result.overlays.default 15 + ]; 16 + }; 17 + "nixos-24.11" = (settings config).nixpkgs; 18 + nixos-unstable = (settings config).nixpkgs; 19 + }; 20 + 21 + result = (nilla.create [ ]).extend { 22 + modules = [ 23 + ./packetmix/project.nix 24 + ./sprinkles/project.nix 25 + ( 26 + { config, ... }: 27 + { 28 + config.inputs = builtins.mapAttrs (name: value: { 29 + src = value; 30 + settings = (settings config).${name} or config.lib.constants.undefined; 31 + }) pins; 32 + } 33 + ) 34 + ]; 35 + 36 + args = { 37 + inherit nilla pins; # pins needs to be a static arg for us to import from it... 38 + }; 39 + }; 40 + in 41 + result.config 42 + // { 43 + extend = result.extend; 44 + }
packetmix/ci.nix ci.nix
-20
packetmix/inputs.nix
··· 1 - # SPDX-FileCopyrightText: 2025 FreshlyBakedCake 2 - # 3 - # SPDX-License-Identifier: MIT 4 - 5 - let 6 - pins = import ./npins; 7 - 8 - settings = { 9 - nixpkgs.configuration.allowUnfree = true; 10 - "nixos-24.11" = settings.nixpkgs; 11 - nixos-unstable = settings.nixpkgs; 12 - }; 13 - in 14 - { config, ... }: 15 - { 16 - config.inputs = builtins.mapAttrs (name: value: { 17 - src = value; 18 - settings = settings.${name} or config.lib.constants.undefined; 19 - }) pins; 20 - }
-130
packetmix/nilla.nix
··· 1 - # SPDX-FileCopyrightText: 2025 FreshlyBakedCake 2 - # 3 - # SPDX-License-Identifier: MIT 4 - 5 - let 6 - pins = import ./npins; 7 - 8 - nilla = import pins.nilla; 9 - in 10 - nilla.create ( 11 - { config, lib }: 12 - { 13 - includes = [ 14 - ./homes 15 - ./inputs.nix 16 - ./lib 17 - ./modules 18 - ./packages 19 - ./systems 20 - "${pins.nilla-nixos}/modules/nixos.nix" # We can't use config.inputs here without infinitely-recursing 21 - ]; 22 - 23 - config = { 24 - packages.allNixOSSystems = { 25 - systems = [ "x86_64-linux" ]; 26 - 27 - package = 28 - { stdenv }: 29 - stdenv.mkDerivation { 30 - name = "all-nixos-systems"; 31 - 32 - dontUnpack = true; 33 - 34 - buildPhase = '' 35 - mkdir -p $out 36 - '' 37 - + (builtins.concatStringsSep "\n" ( 38 - config.lib.attrs.mapToList ( 39 - name: value: ''ln -s "${value.result.config.system.build.toplevel}" "$out/${name}"'' 40 - ) config.systems.nixos 41 - )); 42 - }; 43 - }; 44 - 45 - packages.allHomes = { 46 - systems = [ "x86_64-linux" ]; 47 - 48 - package = 49 - { stdenv }: 50 - stdenv.mkDerivation { 51 - name = "all-homes"; 52 - 53 - dontUnpack = true; 54 - 55 - buildPhase = '' 56 - mkdir -p $out 57 - '' 58 - + (builtins.concatStringsSep "\n" ( 59 - config.lib.attrs.mapToList ( 60 - name: value: 61 - ''ln -s "${value.result.${stdenv.hostPlatform.system}.activationPackage}" "$out/${name}"'' 62 - ) (config.lib.attrs.filter (_: value: value.result ? ${stdenv.hostPlatform.system}) config.homes) 63 - )); 64 - }; 65 - }; 66 - 67 - packages.helix = { 68 - systems = [ "x86_64-linux" ]; 69 - 70 - package = 71 - { helix }: 72 - helix.overrideAttrs ( 73 - { 74 - patches ? [ ], 75 - ... 76 - }: 77 - { 78 - doCheck = false; 79 - patches = patches ++ [ ./patches/helix/3958-labels-for-config-menus.patch ]; 80 - } 81 - ); 82 - }; 83 - 84 - # With a package set defined, we can create a shell. 85 - shells.default = { 86 - # Declare what systems the shell can be used on. 87 - systems = [ "x86_64-linux" ]; 88 - 89 - # Define our shell environment. 90 - shell = 91 - { 92 - pkgs, 93 - stdenv, 94 - mkShell, 95 - kdePackages, 96 - reuse, 97 - ... 98 - }: 99 - mkShell { 100 - QML_IMPORT_PATH = 101 - lib.fp.pipe 102 - [ 103 - (map (pkg: "${pkg}/lib/qt-6/qml")) 104 - (builtins.concatStringsSep ":") 105 - ] 106 - [ 107 - config.inputs.nixos-unstable.result.${stdenv.hostPlatform.system}.quickshell 108 - kdePackages.qtdeclarative 109 - ]; 110 - 111 - packages = [ 112 - config.inputs.nilla-cli.result.packages.nilla-cli.result.${stdenv.hostPlatform.system} 113 - config.inputs.nilla-home.result.packages.nilla-home.result.${stdenv.hostPlatform.system} 114 - config.inputs.nilla-nixos.result.packages.nilla-nixos.result.${stdenv.hostPlatform.system} 115 - config.inputs.nixos-unstable.result.${stdenv.hostPlatform.system}.quickshell 116 - config.inputs.nixpkgs.result.${stdenv.hostPlatform.system}.deadnix 117 - config.packages.nilla-fmt.result.${stdenv.hostPlatform.system} 118 - config.packages.treefmt.result.${stdenv.hostPlatform.system} 119 - (config.inputs.npins.result { 120 - inherit pkgs; 121 - inherit (stdenv.hostPlatform) system; 122 - }) 123 - kdePackages.qtdeclarative 124 - reuse 125 - ]; 126 - }; 127 - }; 128 - }; 129 - } 130 - )
packetmix/npins/default.nix npins/default.nix
packetmix/npins/default.nix.license npins/default.nix.license
+30
packetmix/npins/sources.json npins/sources.json
··· 280 280 "url": "https://api.github.com/repos/9001/copyparty/tarball/refs/tags/v1.19.20", 281 281 "hash": "sha256-/Wm8hZvdGfYWdTOF+dgTPX8DGuSKLhGw4qC4crf1dAo=" 282 282 }, 283 + "fenix": { 284 + "type": "Git", 285 + "repository": { 286 + "type": "GitHub", 287 + "owner": "nix-community", 288 + "repo": "fenix" 289 + }, 290 + "branch": "monthly", 291 + "submodules": false, 292 + "revision": "f44d7c3596ff028ad9f7fcc31d1941ed585f11b3", 293 + "url": "https://github.com/nix-community/fenix/archive/f44d7c3596ff028ad9f7fcc31d1941ed585f11b3.tar.gz", 294 + "hash": "sha256-6RzWfxENGlO73jQb3uQNgOvubUFwvveeIg+PZxhAu6s=" 295 + }, 283 296 "headscale": { 284 297 "type": "Git", 285 298 "repository": { ··· 520 533 "revision": "0d6aaa4b3dcd1d8badbed2b66e0c50867330a86e", 521 534 "url": "https://github.com/andir/npins/archive/0d6aaa4b3dcd1d8badbed2b66e0c50867330a86e.tar.gz", 522 535 "hash": "sha256-9N14/tliOiA49Us2uFUWHcrhYN8AmJjR+bnwzcxejgs=" 536 + }, 537 + "quickshell": { 538 + "type": "GitRelease", 539 + "repository": { 540 + "type": "Forgejo", 541 + "server": "https://git.outfoxxed.me/", 542 + "owner": "quickshell", 543 + "repo": "quickshell" 544 + }, 545 + "pre_releases": false, 546 + "version_upper_bound": null, 547 + "release_prefix": null, 548 + "submodules": false, 549 + "version": "v0.2.0", 550 + "revision": "a5431dd02dc23d9ef1680e67777fed00fe5f7cda", 551 + "url": "https://git.outfoxxed.me/api/v1/repos/quickshell/quickshell/archive/v0.2.0.tar.gz", 552 + "hash": "sha256-vqkSDvh7hWhPvNjMjEDV4KbSCv2jyl2Arh73ZXe274k=" 523 553 }, 524 554 "scriptfs": { 525 555 "type": "Git",
packetmix/npins/sources.json.license npins/sources.json.license
+1 -4
packetmix/packages/vs-launcher/default.nix
··· 1 1 # SPDX-FileCopyrightText: 2025 FreshlyBakedCake 2 2 # 3 3 # SPDX-License-Identifier: MIT 4 - let 5 - pins = import ../../npins; 6 - in 7 4 { config, ... }: 8 5 { 9 6 config.packages.vs-launcher = { ··· 15 12 in 16 13 { appimageTools, fetchurl }: 17 14 let 18 - version = pins.vs-launcher.version; 15 + version = config.inputs.vs-launcher.src.version; 19 16 pname = "vs-launcher"; 20 17 src = fetchurl { 21 18 url = "https://github.com/XurxoMF/vs-launcher/releases/download/${version}/vs-launcher-${version}.AppImage";
+128
packetmix/project.nix
··· 1 + # SPDX-FileCopyrightText: 2025 FreshlyBakedCake 2 + # 3 + # SPDX-License-Identifier: MIT 4 + 5 + { 6 + config, 7 + lib, 8 + pins, 9 + ... 10 + }: 11 + { 12 + includes = [ 13 + ./homes 14 + ./lib 15 + ./modules 16 + ./packages 17 + ./systems 18 + "${pins.nilla-nixos}/modules/nixos.nix" # We can't use config.inputs here without infinitely-recursing 19 + ]; 20 + 21 + config = { 22 + packages.allNixOSSystems = { 23 + systems = [ "x86_64-linux" ]; 24 + 25 + package = 26 + { stdenv }: 27 + stdenv.mkDerivation { 28 + name = "all-nixos-systems"; 29 + 30 + dontUnpack = true; 31 + 32 + buildPhase = '' 33 + mkdir -p $out 34 + '' 35 + + (builtins.concatStringsSep "\n" ( 36 + config.lib.attrs.mapToList ( 37 + name: value: ''ln -s "${value.result.config.system.build.toplevel}" "$out/${name}"'' 38 + ) config.systems.nixos 39 + )); 40 + }; 41 + }; 42 + 43 + packages.allHomes = { 44 + systems = [ "x86_64-linux" ]; 45 + 46 + package = 47 + { stdenv }: 48 + stdenv.mkDerivation { 49 + name = "all-homes"; 50 + 51 + dontUnpack = true; 52 + 53 + buildPhase = '' 54 + mkdir -p $out 55 + '' 56 + + (builtins.concatStringsSep "\n" ( 57 + config.lib.attrs.mapToList ( 58 + name: value: 59 + ''ln -s "${value.result.${stdenv.hostPlatform.system}.activationPackage}" "$out/${name}"'' 60 + ) (config.lib.attrs.filter (_: value: value.result ? ${stdenv.hostPlatform.system}) config.homes) 61 + )); 62 + }; 63 + }; 64 + 65 + packages.helix = { 66 + systems = [ "x86_64-linux" ]; 67 + 68 + package = 69 + { helix }: 70 + helix.overrideAttrs ( 71 + { 72 + patches ? [ ], 73 + ... 74 + }: 75 + { 76 + doCheck = false; 77 + patches = patches ++ [ ./patches/helix/3958-labels-for-config-menus.patch ]; 78 + } 79 + ); 80 + }; 81 + 82 + # With a package set defined, we can create a shell. 83 + shells.default = config.shells.packetmix; 84 + shells.packetmix = { 85 + # Declare what systems the shell can be used on. 86 + systems = [ "x86_64-linux" ]; 87 + 88 + # Define our shell environment. 89 + shell = 90 + { 91 + pkgs, 92 + stdenv, 93 + mkShell, 94 + kdePackages, 95 + reuse, 96 + ... 97 + }: 98 + mkShell { 99 + QML_IMPORT_PATH = 100 + lib.fp.pipe 101 + [ 102 + (map (pkg: "${pkg}/lib/qt-6/qml")) 103 + (builtins.concatStringsSep ":") 104 + ] 105 + [ 106 + config.inputs.nixos-unstable.result.${stdenv.hostPlatform.system}.quickshell 107 + kdePackages.qtdeclarative 108 + ]; 109 + 110 + packages = [ 111 + config.inputs.nilla-cli.result.packages.nilla-cli.result.${stdenv.hostPlatform.system} 112 + config.inputs.nilla-home.result.packages.nilla-home.result.${stdenv.hostPlatform.system} 113 + config.inputs.nilla-nixos.result.packages.nilla-nixos.result.${stdenv.hostPlatform.system} 114 + config.inputs.nixos-unstable.result.${stdenv.hostPlatform.system}.quickshell 115 + config.inputs.nixpkgs.result.${stdenv.hostPlatform.system}.deadnix 116 + config.packages.nilla-fmt.result.${stdenv.hostPlatform.system} 117 + config.packages.treefmt.result.${stdenv.hostPlatform.system} 118 + (config.inputs.npins.result { 119 + inherit pkgs; 120 + inherit (stdenv.hostPlatform) system; 121 + }) 122 + kdePackages.qtdeclarative 123 + reuse 124 + ]; 125 + }; 126 + }; 127 + }; 128 + }
+43
projects/nilla.nix
··· 1 + # SPDX-FileCopyrightText: 2025 FreshlyBakedCake 2 + # 3 + # SPDX-License-Identifier: MIT 4 + 5 + let 6 + pins = import ./npins; 7 + 8 + nilla = import pins.nilla; 9 + 10 + settings = config: { 11 + nixpkgs = { 12 + configuration.allowUnfree = true; 13 + overlays = [ 14 + config.inputs.fenix.result.overlays.default 15 + ]; 16 + }; 17 + "nixos-24.11" = (settings config).nixpkgs; 18 + nixos-unstable = (settings config).nixpkgs; 19 + }; 20 + 21 + result = (nilla.create [ ]).extend { 22 + modules = [ 23 + ./project.nix 24 + ( 25 + { config, ... }: 26 + { 27 + config.inputs = builtins.mapAttrs (name: value: { 28 + src = value; 29 + settings = (settings config).${name} or config.lib.constants.undefined; 30 + }) pins; 31 + } 32 + ) 33 + ]; 34 + 35 + args = { 36 + inherit nilla pins; # pins needs to be a static arg for us to import from it... 37 + }; 38 + }; 39 + in 40 + result.config 41 + // { 42 + extend = result.extend; 43 + }
+3 -1
projects/packetmix/workspace.josh
··· 1 1 ::.tangled/ 2 2 ::LICENSES/ 3 - ::projects/packetmix/workspace.josh.license 3 + ::npins/ 4 + ::nilla.nix=projects/nilla.nix 5 + ::workspace.josh.license=projects/packetmix/workspace.josh.license 4 6 :/packetmix
+3 -1
projects/sprinkles/workspace.josh
··· 1 1 ::LICENSES/ 2 - ::projects/sprinkles/workspace.josh.license 2 + ::npins/ 3 + ::nilla.nix=projects/nilla.nix 4 + ::workspace.josh.license=projects/packetmix/workspace.josh.license 3 5 :/sprinkles
+55 -30
sprinkles/nilla.nix sprinkles/project.nix
··· 2 2 # 3 3 # SPDX-License-Identifier: MIT 4 4 5 - let 6 - pins = import ./npins; 7 - 8 - nilla = import pins.nilla; 9 - in 10 - nilla.create ({ config, lib }: { 5 + { 6 + pins, 7 + config, 8 + lib, 9 + }: 10 + { 11 11 config = { 12 - inputs = { 13 - fenix.src = pins.fenix; 14 - quickshell.src = pins.quickshell; 15 - 16 - nixpkgs = { 17 - src = pins.nixpkgs; 18 - 19 - settings = { 20 - overlays = [ 21 - config.inputs.fenix.result.overlays.default 22 - ]; 23 - }; 24 - }; 25 - }; 26 - 27 12 packages.default = config.packages.sprinkles; 28 13 packages.sprinkles = { 29 - systems = [ "x86_64-linux" "aarch64-linux" ]; 14 + systems = [ 15 + "x86_64-linux" 16 + "aarch64-linux" 17 + ]; 30 18 31 - package = { fenix, makeRustPlatform, lib, installShellFiles, dbus, ... }: 19 + package = 20 + { 21 + fenix, 22 + makeRustPlatform, 23 + lib, 24 + installShellFiles, 25 + dbus, 26 + ... 27 + }: 32 28 let 33 29 toolchain = fenix.complete.toolchain; 34 30 ··· 55 51 56 52 shells.default = config.shells.sprinkles; 57 53 shells.sprinkles = { 58 - systems = [ "x86_64-linux" "aarch64-linux" ]; 54 + systems = [ 55 + "x86_64-linux" 56 + "aarch64-linux" 57 + ]; 59 58 60 - shell = { mkShell, kdePackages, fenix, bacon, pkg-config, reuse, dbus, sqlx-cli, system, ... }: 59 + shell = 60 + { 61 + mkShell, 62 + kdePackages, 63 + fenix, 64 + bacon, 65 + pkg-config, 66 + reuse, 67 + dbus, 68 + sqlx-cli, 69 + system, 70 + ... 71 + }: 61 72 mkShell { 62 73 QML_IMPORT_PATH = 63 74 lib.fp.pipe ··· 66 77 (builtins.concatStringsSep ":") 67 78 ] 68 79 [ 69 - (config.inputs.quickshell.result.packages.${system}.default.override { gitRev=pins.quickshell.revision; }) 80 + (config.inputs.quickshell.result.packages.${system}.default.override { 81 + gitRev = pins.quickshell.revision; 82 + }) 70 83 kdePackages.qtdeclarative 71 84 ]; 72 85 ··· 90 103 }; 91 104 }; 92 105 shells.testing = { 93 - systems = [ "x86_64-linux" "aarch64-linux" ]; 106 + systems = [ 107 + "x86_64-linux" 108 + "aarch64-linux" 109 + ]; 94 110 95 - shell = { mkShell, libnotify, sqlitebrowser, system, ... }: 111 + shell = 112 + { 113 + mkShell, 114 + libnotify, 115 + sqlitebrowser, 116 + system, 117 + ... 118 + }: 96 119 mkShell { 97 120 buildInputs = [ libnotify ]; 98 121 packages = [ 99 122 libnotify 100 123 sqlitebrowser 101 124 config.packages.default.result.${system} 102 - (config.inputs.quickshell.result.packages.${system}.default.override { gitRev=pins.quickshell.revision; }) 125 + (config.inputs.quickshell.result.packages.${system}.default.override { 126 + gitRev = pins.quickshell.revision; 127 + }) 103 128 ]; 104 129 }; 105 130 }; 106 131 }; 107 - }) 132 + }
-146
sprinkles/npins/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 - data = builtins.fromJSON (builtins.readFile ./sources.json); 13 - version = data.version; 14 - 15 - # https://github.com/NixOS/nixpkgs/blob/0258808f5744ca980b9a1f24fe0b1e6f0fecee9c/lib/lists.nix#L295 16 - range = 17 - first: last: if first > last then [ ] else builtins.genList (n: first + n) (last - first + 1); 18 - 19 - # https://github.com/NixOS/nixpkgs/blob/0258808f5744ca980b9a1f24fe0b1e6f0fecee9c/lib/strings.nix#L257 20 - stringToCharacters = s: map (p: builtins.substring p 1 s) (range 0 (builtins.stringLength s - 1)); 21 - 22 - # https://github.com/NixOS/nixpkgs/blob/0258808f5744ca980b9a1f24fe0b1e6f0fecee9c/lib/strings.nix#L269 23 - stringAsChars = f: s: concatStrings (map f (stringToCharacters s)); 24 - concatMapStrings = f: list: concatStrings (map f list); 25 - concatStrings = builtins.concatStringsSep ""; 26 - 27 - # If the environment variable NPINS_OVERRIDE_${name} is set, then use 28 - # the path directly as opposed to the fetched source. 29 - # (Taken from Niv for compatibility) 30 - mayOverride = 31 - name: path: 32 - let 33 - envVarName = "NPINS_OVERRIDE_${saneName}"; 34 - saneName = stringAsChars (c: if (builtins.match "[a-zA-Z0-9]" c) == null then "_" else c) name; 35 - ersatz = builtins.getEnv envVarName; 36 - in 37 - if ersatz == "" then 38 - path 39 - else 40 - # this turns the string into an actual Nix path (for both absolute and 41 - # relative paths) 42 - builtins.trace "Overriding path of \"${name}\" with \"${ersatz}\" due to set \"${envVarName}\"" ( 43 - if builtins.substring 0 1 ersatz == "/" then 44 - /. + ersatz 45 - else 46 - /. + builtins.getEnv "PWD" + "/${ersatz}" 47 - ); 48 - 49 - mkSource = 50 - name: spec: 51 - assert spec ? type; 52 - let 53 - path = 54 - if spec.type == "Git" then 55 - mkGitSource spec 56 - else if spec.type == "GitRelease" then 57 - mkGitSource spec 58 - else if spec.type == "PyPi" then 59 - mkPyPiSource spec 60 - else if spec.type == "Channel" then 61 - mkChannelSource spec 62 - else if spec.type == "Tarball" then 63 - mkTarballSource spec 64 - else 65 - builtins.throw "Unknown source type ${spec.type}"; 66 - in 67 - spec // { outPath = mayOverride name path; }; 68 - 69 - mkGitSource = 70 - { 71 - repository, 72 - revision, 73 - url ? null, 74 - submodules, 75 - hash, 76 - branch ? null, 77 - ... 78 - }: 79 - assert repository ? type; 80 - # At the moment, either it is a plain git repository (which has an url), or it is a GitHub/GitLab repository 81 - # In the latter case, there we will always be an url to the tarball 82 - if url != null && !submodules then 83 - builtins.fetchTarball { 84 - inherit url; 85 - sha256 = hash; 86 - } 87 - else 88 - let 89 - url = 90 - if repository.type == "Git" then 91 - repository.url 92 - else if repository.type == "GitHub" then 93 - "https://github.com/${repository.owner}/${repository.repo}.git" 94 - else if repository.type == "GitLab" then 95 - "${repository.server}/${repository.repo_path}.git" 96 - else 97 - throw "Unrecognized repository type ${repository.type}"; 98 - urlToName = 99 - url: rev: 100 - let 101 - matched = builtins.match "^.*/([^/]*)(\\.git)?$" url; 102 - 103 - short = builtins.substring 0 7 rev; 104 - 105 - appendShort = if (builtins.match "[a-f0-9]*" rev) != null then "-${short}" else ""; 106 - in 107 - "${if matched == null then "source" else builtins.head matched}${appendShort}"; 108 - name = urlToName url revision; 109 - in 110 - builtins.fetchGit { 111 - rev = revision; 112 - narHash = hash; 113 - 114 - inherit name submodules url; 115 - }; 116 - 117 - mkPyPiSource = 118 - { url, hash, ... }: 119 - builtins.fetchurl { 120 - inherit url; 121 - sha256 = hash; 122 - }; 123 - 124 - mkChannelSource = 125 - { url, hash, ... }: 126 - builtins.fetchTarball { 127 - inherit url; 128 - sha256 = hash; 129 - }; 130 - 131 - mkTarballSource = 132 - { 133 - url, 134 - locked_url ? url, 135 - hash, 136 - ... 137 - }: 138 - builtins.fetchTarball { 139 - url = locked_url; 140 - sha256 = hash; 141 - }; 142 - in 143 - if version == 6 then 144 - builtins.mapAttrs mkSource data.pins 145 - else 146 - throw "Unsupported format version ${toString version} in sources.json. Try running `npins upgrade`"
-3
sprinkles/npins/default.nix.license
··· 1 - SPDX-FileCopyrightText: 2025 Npins Contributors 2 - 3 - SPDX-License-Identifier: MIT
-59
sprinkles/npins/sources.json
··· 1 - { 2 - "pins": { 3 - "fenix": { 4 - "type": "Git", 5 - "repository": { 6 - "type": "GitHub", 7 - "owner": "nix-community", 8 - "repo": "fenix" 9 - }, 10 - "branch": "monthly", 11 - "submodules": false, 12 - "revision": "f44d7c3596ff028ad9f7fcc31d1941ed585f11b3", 13 - "url": "https://github.com/nix-community/fenix/archive/f44d7c3596ff028ad9f7fcc31d1941ed585f11b3.tar.gz", 14 - "hash": "sha256-6RzWfxENGlO73jQb3uQNgOvubUFwvveeIg+PZxhAu6s=" 15 - }, 16 - "nilla": { 17 - "type": "Git", 18 - "repository": { 19 - "type": "GitHub", 20 - "owner": "nilla-nix", 21 - "repo": "nilla" 22 - }, 23 - "branch": "main", 24 - "submodules": false, 25 - "revision": "4e6038f4ebc89487194013af6a1e077dfeb00359", 26 - "url": "https://github.com/nilla-nix/nilla/archive/4e6038f4ebc89487194013af6a1e077dfeb00359.tar.gz", 27 - "hash": "sha256-7iLzbTLtgdFtm9em3xxHO9BunN2YpgYquMLKXh5hEpQ=" 28 - }, 29 - "nixpkgs": { 30 - "type": "Git", 31 - "repository": { 32 - "type": "GitHub", 33 - "owner": "nixos", 34 - "repo": "nixpkgs" 35 - }, 36 - "branch": "nixos-unstable", 37 - "submodules": false, 38 - "revision": "a84ebe20c6bc2ecbcfb000a50776219f48d134cc", 39 - "url": "https://github.com/nixos/nixpkgs/archive/a84ebe20c6bc2ecbcfb000a50776219f48d134cc.tar.gz", 40 - "hash": "sha256-mNqIplmEohk5jRkqYqG19GA8MbQ/D4gQSK0Mu4LvfRQ=" 41 - }, 42 - "quickshell": { 43 - "type": "GitRelease", 44 - "repository": { 45 - "type": "Git", 46 - "url": "https://git.outfoxxed.me/quickshell/quickshell.git" 47 - }, 48 - "pre_releases": false, 49 - "version_upper_bound": null, 50 - "release_prefix": null, 51 - "submodules": false, 52 - "version": "v0.2.0", 53 - "revision": "a5431dd02dc23d9ef1680e67777fed00fe5f7cda", 54 - "url": null, 55 - "hash": "sha256-vqkSDvh7hWhPvNjMjEDV4KbSCv2jyl2Arh73ZXe274k=" 56 - } 57 - }, 58 - "version": 6 59 - }
-3
sprinkles/npins/sources.json.license
··· 1 - SPDX-FileCopyrightText: 2025 FreshlyBakedCake 2 - 3 - SPDX-License-Identifier: CC0-1.0