Compare commits

...

9 Commits

Author SHA1 Message Date
Leonora Tindall f61416748a Upgrade npins 2025-07-03 09:38:30 -05:00
Leonora Tindall b3ebdbd25f Upgrade npins to v5 2025-07-03 09:36:45 -05:00
Leonora Tindall 4c6d420648 Update npins
- use initContent instead of initExtra for zsh (deprecation)
2025-07-03 09:34:22 -05:00
Leonora Tindall e1086adf27 Add ollama 2025-07-03 09:33:20 -05:00
Leonora Tindall b0be8db7d5 Add harelang support 2025-07-03 09:33:08 -05:00
Leonora Tindall a5d0620e61 Working sudo lol
(sudo-rs managed by home-manager doesn't work because it's not setuid)
2025-07-03 09:31:52 -05:00
Leonora Tindall 988aaaca9e Enable Git LFS 2025-07-03 09:28:29 -05:00
Leonora Tindall f5b0cab28f Upgrade custom fortune-kind to 0.1.13 2025-07-03 09:28:00 -05:00
Leonora Tindall 656ff86167 Use nixpkgs uv 2025-07-03 09:23:43 -05:00
11 changed files with 118 additions and 6059 deletions

View File

@ -10,16 +10,16 @@
rustPlatform.buildRustPackage rec {
pname = "fortune-kind-custom";
version = "0.1.9";
version = "0.1.13";
src = fetchFromGitHub {
owner = "cafkafk";
repo = "fortune-kind";
rev = "v${version}";
hash = "sha256-93BEy9FX3bZTYNewotBv1ejmMSnSdu9XnC4TgIvcYG0=";
hash = "sha256-Tpg0Jq2EhkwQuz5ZOtv6Rb5YESSlmzLoJPTxYJNNgac=";
};
cargoHash = "sha256-w5nR+pduM64DvVXhJxFKCg8O7lYSa1ur7aBBZQbOdpk=";
cargoHash = "sha256-Kp3pv9amEz9oFMDhz0IZDmhpsok5VgrvJZfwSPyz2X0=";
buildInputs = lib.optionals stdenv.isDarwin [ libiconv darwin.apple_sdk.frameworks.Security ];

5952
custom/uv.Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -1,83 +0,0 @@
{
lib,
cmake,
darwin,
fetchFromGitHub,
installShellFiles,
libiconv,
pkg-config,
python3Packages,
rustPlatform,
stdenv,
testers,
uv,
nix-update-script,
}:
python3Packages.buildPythonApplication rec {
pname = "uv";
version = "0.3.0";
pyproject = true;
src = fetchFromGitHub {
owner = "astral-sh";
repo = "uv";
rev = "refs/tags/${version}";
hash = "sha256-5tX7PvON/n2ntwunoKU/U9zUIVxU+SPVWXelfHapqDA=";
};
cargoDeps = rustPlatform.importCargoLock {
lockFile = ./uv.Cargo.lock;
outputHashes = {
"async_zip-0.0.17" = "sha256-3k9rc4yHWhqsCUJ17K55F8aQoCKdVamrWAn6IDWo3Ss=";
"pubgrub-0.2.1" = "sha256-OVR4ioUSbraMZYglIGzBA0KQ+XZY0P0+fw68v8/e9sQ=";
"reqwest-middleware-0.3.3" = "sha256-csQN7jZTifliSTsOm6YrjPVgsXBOfelY7LkHD1HkNGQ=";
};
};
nativeBuildInputs = [
cmake
installShellFiles
pkg-config
rustPlatform.cargoSetupHook
rustPlatform.maturinBuildHook
];
buildInputs = [
libiconv
] ++ lib.optionals stdenv.isDarwin [ darwin.apple_sdk.frameworks.SystemConfiguration ];
dontUseCmakeConfigure = true;
cargoBuildFlags = [
"--package"
"uv"
];
postInstall = ''
export HOME=$TMPDIR
installShellCompletion --cmd uv \
--bash <($out/bin/uv --generate-shell-completion bash) \
--fish <($out/bin/uv --generate-shell-completion fish) \
--zsh <($out/bin/uv --generate-shell-completion zsh)
'';
pythonImportsCheck = [ "uv" ];
passthru = {
tests.version = testers.testVersion { package = uv; };
updateScript = nix-update-script { };
};
meta = {
description = "Extremely fast Python package installer and resolver, written in Rust";
homepage = "https://github.com/astral-sh/uv";
changelog = "https://github.com/astral-sh/uv/blob/${src.rev}/CHANGELOG.md";
license = with lib.licenses; [
asl20
mit
];
maintainers = with lib.maintainers; [ GaetanLepage ];
mainProgram = "uv";
};
}

View File

@ -4,6 +4,7 @@
enable = true;
userName = "Leonora Tindall";
userEmail = "nora@nora.codes";
lfs.enable = true;
delta.enable = true;
extraConfig = {
init.defaultBranch = "main";

12
hare.nix Normal file
View File

@ -0,0 +1,12 @@
{ config, pkgs, ... }:
{
home.packages = with pkgs; [
hare
haredoc
haredo
];
programs.neovim.plugins = with pkgs.vimPlugins; [
hare-vim
];
}

View File

@ -1,10 +1,53 @@
/*
This file is provided under the MIT licence:
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:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
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.
*/
# Generated by npins. Do not modify; will be overwritten regularly
let
data = builtins.fromJSON (builtins.readFile ./sources.json);
version = data.version;
# https://github.com/NixOS/nixpkgs/blob/0258808f5744ca980b9a1f24fe0b1e6f0fecee9c/lib/lists.nix#L295
range =
first: last: if first > last then [ ] else builtins.genList (n: first + n) (last - first + 1);
# https://github.com/NixOS/nixpkgs/blob/0258808f5744ca980b9a1f24fe0b1e6f0fecee9c/lib/strings.nix#L257
stringToCharacters = s: map (p: builtins.substring p 1 s) (range 0 (builtins.stringLength s - 1));
# https://github.com/NixOS/nixpkgs/blob/0258808f5744ca980b9a1f24fe0b1e6f0fecee9c/lib/strings.nix#L269
stringAsChars = f: s: concatStrings (map f (stringToCharacters s));
concatMapStrings = f: list: concatStrings (map f list);
concatStrings = builtins.concatStringsSep "";
# If the environment variable NPINS_OVERRIDE_${name} is set, then use
# the path directly as opposed to the fetched source.
# (Taken from Niv for compatibility)
mayOverride =
name: path:
let
envVarName = "NPINS_OVERRIDE_${saneName}";
saneName = stringAsChars (c: if (builtins.match "[a-zA-Z0-9]" c) == null then "_" else c) name;
ersatz = builtins.getEnv envVarName;
in
if ersatz == "" then
path
else
# this turns the string into an actual Nix path (for both absolute and
# relative paths)
builtins.trace "Overriding path of \"${name}\" with \"${ersatz}\" due to set \"${envVarName}\"" (
if builtins.substring 0 1 ersatz == "/" then
/. + ersatz
else
/. + builtins.getEnv "PWD" + "/${ersatz}"
);
mkSource =
spec:
name: spec:
assert spec ? type;
let
path =
@ -16,16 +59,19 @@ let
mkPyPiSource spec
else if spec.type == "Channel" then
mkChannelSource spec
else if spec.type == "Tarball" then
mkTarballSource spec
else
builtins.throw "Unknown source type ${spec.type}";
in
spec // { outPath = path; };
spec // { outPath = mayOverride name path; };
mkGitSource =
{
repository,
revision,
url ? null,
submodules,
hash,
branch ? null,
...
@ -33,31 +79,39 @@ let
assert repository ? type;
# At the moment, either it is a plain git repository (which has an url), or it is a GitHub/GitLab repository
# In the latter case, there we will always be an url to the tarball
if url != null then
(builtins.fetchTarball {
if url != null && !submodules then
builtins.fetchTarball {
inherit url;
sha256 = hash; # FIXME: check nix version & use SRI hashes
})
}
else
assert repository.type == "Git";
let
url =
if repository.type == "Git" then
repository.url
else if repository.type == "GitHub" then
"https://github.com/${repository.owner}/${repository.repo}.git"
else if repository.type == "GitLab" then
"${repository.server}/${repository.repo_path}.git"
else
throw "Unrecognized repository type ${repository.type}";
urlToName =
url: rev:
let
matched = builtins.match "^.*/([^/]*)(\\.git)?$" repository.url;
matched = builtins.match "^.*/([^/]*)(\\.git)?$" url;
short = builtins.substring 0 7 rev;
appendShort = if (builtins.match "[a-f0-9]*" rev) != null then "-${short}" else "";
in
"${if matched == null then "source" else builtins.head matched}${appendShort}";
name = urlToName repository.url revision;
name = urlToName url revision;
in
builtins.fetchGit {
url = repository.url;
rev = revision;
inherit name;
# hash = hash;
inherit url submodules;
};
mkPyPiSource =
@ -73,8 +127,20 @@ let
inherit url;
sha256 = hash;
};
mkTarballSource =
{
url,
locked_url ? url,
hash,
...
}:
builtins.fetchTarball {
url = locked_url;
sha256 = hash;
};
in
if version == 3 then
builtins.mapAttrs (_: mkSource) data.pins
if version == 5 then
builtins.mapAttrs mkSource data.pins
else
throw "Unsupported format version ${toString version} in sources.json. Try running `npins upgrade`"

View File

@ -8,9 +8,10 @@
"repo": "home-manager"
},
"branch": "master",
"revision": "d963ed335b890a70ed53eecf14cdb21528eda9b8",
"url": "https://github.com/nix-community/home-manager/archive/d963ed335b890a70ed53eecf14cdb21528eda9b8.tar.gz",
"hash": "1lmgp4snkskqmvgdbc8wgxjm6fv7can3gjdmmdd6q09vfda63vhi"
"submodules": false,
"revision": "1fa73bb2cc39e250eb01e511ae6ac83bfbf9f38c",
"url": "https://github.com/nix-community/home-manager/archive/1fa73bb2cc39e250eb01e511ae6ac83bfbf9f38c.tar.gz",
"hash": "06mz6f8b55x9hiyvbr8s77vmscyskqv00hv5zmcihdw5hhkrl8ls"
},
"nixgl": {
"type": "Git",
@ -20,6 +21,7 @@
"repo": "nixGL"
},
"branch": "main",
"submodules": false,
"revision": "310f8e49a149e4c9ea52f1adf70cdc768ec53f8a",
"url": "https://github.com/guibou/nixGL/archive/310f8e49a149e4c9ea52f1adf70cdc768ec53f8a.tar.gz",
"hash": "1crnbv3mdx83xjwl2j63rwwl9qfgi2f1lr53zzjlby5lh50xjz4n"
@ -27,9 +29,9 @@
"nixpkgs": {
"type": "Channel",
"name": "nixos-unstable",
"url": "https://releases.nixos.org/nixos/unstable/nixos-25.05beta745286.9d3ae807ebd2/nixexprs.tar.xz",
"hash": "01n74f9kan5z6bbkkal0mzfbb259iy3hb7m22v8vld99wbpvbypn"
"url": "https://releases.nixos.org/nixos/unstable/nixos-25.11pre823481.3016b4b15d13/nixexprs.tar.xz",
"hash": "1ml7yaq7r15rfpx9vqh32bisc2w7kdsv6kmclnb2g113fbv6fd85"
}
},
"version": 3
}
"version": 5
}

10
ollama.nix Normal file
View File

@ -0,0 +1,10 @@
{ config, pkgs, ... }:
{
services.ollama = {
enable = true;
acceleration = "rocm";
environmentVariables = {
HSA_OVERRIDE_GFX_VERSION = "10.3.0";
};
};
}

View File

@ -14,7 +14,7 @@
graphviz
nix-output-monitor
npins
(pkgs.callPackage ./custom/uv.nix {})
uv
exercism
pandoc
act
@ -24,6 +24,7 @@
wl-clipboard
neocities
deno
decker
# from "mort.io/blog/nu-posix"
bat # better cat
@ -44,7 +45,6 @@
just # updated gnumake replacement
procs # better ps
ripgrep # rg ~ `grep` replacement
sudo-rs # memory-safe `sudo`
uutils-coreutils-noprefix # replaces GNU `coreutils`
viddy # better watch

View File

@ -16,6 +16,8 @@ in
./fzf.nix
./zellij.nix
./jj.nix
./hare.nix
./ollama.nix
./packages-min.nix
];

View File

@ -2,6 +2,7 @@
{
home.shellAliases = {
idot = "dot -Tpng -Gbgcolor=#232627 -Ncolor=white -Nfontcolor=white -Npencolor=white -Ecolor=white -Efontcolor=white -Epencolor=white -Npenwidth=2 -Epenwidth=2 -Nfontname=\"Courier bold\" -Efontname=\"Courier bold\" | timg -";
sudo = "sudo --preserve-env=PATH env";
};
programs.zsh = {
@ -9,6 +10,6 @@
autosuggestion.enable = false;
enableCompletion = true;
enableVteIntegration = true;
initExtra = (builtins.readFile ./rcfiles/zshrc);
initContent = (builtins.readFile ./rcfiles/zshrc);
};
}