Compare commits
2 commits
84268f3c47
...
2951e81a77
Author | SHA1 | Date | |
---|---|---|---|
Geoffrey Frogeye | 2951e81a77 | ||
Geoffrey Frogeye | b16db77f04 |
|
@ -5,6 +5,7 @@ in
|
||||||
{
|
{
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
home.packages = [
|
home.packages = [
|
||||||
|
(pkgs.callPackage ./jjui.nix {})
|
||||||
(pkgs.writeShellApplication {
|
(pkgs.writeShellApplication {
|
||||||
name = "git-sync";
|
name = "git-sync";
|
||||||
text = (lib.strings.concatLines
|
text = (lib.strings.concatLines
|
||||||
|
|
21
hm/git/jjui.nix
Normal file
21
hm/git/jjui.nix
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
{ buildGoModule, fetchFromGitHub }:
|
||||||
|
buildGoModule {
|
||||||
|
pname = "jjui";
|
||||||
|
version = "2024-11-28";
|
||||||
|
|
||||||
|
src = fetchFromGitHub {
|
||||||
|
owner = "GeoffreyFrogeye";
|
||||||
|
repo = "jjui";
|
||||||
|
rev = "push-sszqvsmvqxmy"; # base16 colors
|
||||||
|
sha256 = "sha256-jNi5Ek3Qy/MojlQXBNlqREy7UxnyMaJuUtKPysWBoNU=";
|
||||||
|
};
|
||||||
|
|
||||||
|
vendorHash = "sha256-kg5b3tzwyAhn00GwdUDf4OdYZvCJZHgkgpzHFWy5SxI=";
|
||||||
|
|
||||||
|
postInstall = ''
|
||||||
|
mv $out/bin/cmd $out/bin/jjui
|
||||||
|
'';
|
||||||
|
|
||||||
|
doCheck = false; # Some tests are not working
|
||||||
|
|
||||||
|
}
|
|
@ -209,17 +209,15 @@ elif sys.argv[1] in ("merge", "mr"):
|
||||||
to_glab()
|
to_glab()
|
||||||
elif sys.argv[2] == "checkout":
|
elif sys.argv[2] == "checkout":
|
||||||
# Bypass the original checkout command so it doesn't run git commands.
|
# Bypass the original checkout command so it doesn't run git commands.
|
||||||
# If there's no commit on the branch, add one with the MR title
|
|
||||||
# so jj has a current bookmark.
|
|
||||||
mr = glab_get_mr(sys.argv[3])
|
mr = glab_get_mr(sys.argv[3])
|
||||||
jj.run("git", "fetch")
|
jj.run("git", "fetch")
|
||||||
|
jj.run("new", mr.source_branch)
|
||||||
|
# If there's no commit on the branch, add one with the MR title
|
||||||
|
# so jj has a current bookmark.
|
||||||
if len(jj.log(f"{mr.source_branch} | {mr.target_branch}")) == 1:
|
if len(jj.log(f"{mr.source_branch} | {mr.target_branch}")) == 1:
|
||||||
title = re.sub(r"^(WIP|Draft): ", "", mr.title)
|
title = re.sub(r"^(WIP|Draft): ", "", mr.title)
|
||||||
jj.run("new", mr.source_branch)
|
|
||||||
jj.run("describe", "-m", title)
|
jj.run("describe", "-m", title)
|
||||||
jj.run("bookmark", "move", mr.source_branch)
|
jj.run("bookmark", "move", mr.source_branch)
|
||||||
else:
|
|
||||||
jj.run("edit", mr.source_branch)
|
|
||||||
elif sys.argv[2] in (
|
elif sys.argv[2] in (
|
||||||
# If no MR number/branch is given, insert the current bookmark,
|
# If no MR number/branch is given, insert the current bookmark,
|
||||||
# as the current branch concept doesn't exist in jj
|
# as the current branch concept doesn't exist in jj
|
||||||
|
|
|
@ -12,6 +12,7 @@ in
|
||||||
description = "top-level flake";
|
description = "top-level flake";
|
||||||
type = lib.types.attrs;
|
type = lib.types.attrs;
|
||||||
};
|
};
|
||||||
|
cuda = lib.mkEnableOption "Use CUDA for some libraries";
|
||||||
extra = lib.mkEnableOption "Big software";
|
extra = lib.mkEnableOption "Big software";
|
||||||
gaming = lib.mkEnableOption "Games";
|
gaming = lib.mkEnableOption "Games";
|
||||||
polarity = lib.mkOption {
|
polarity = lib.mkOption {
|
||||||
|
|
31
os/cuda/default.nix
Normal file
31
os/cuda/default.nix
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
# Need nvidia proprietary drivers to work
|
||||||
|
{ pkgs, nixpkgs, config, lib, ... }:
|
||||||
|
{
|
||||||
|
config = lib.mkIf config.frogeye.cuda {
|
||||||
|
nix.settings = {
|
||||||
|
substituters = [
|
||||||
|
"https://cuda-maintainers.cachix.org"
|
||||||
|
];
|
||||||
|
trusted-public-keys = [
|
||||||
|
"cuda-maintainers.cachix.org-1:0dq3bujKpuEPMCX6U4WylrUDZ9JyUG0VpVZa7CNfq5E="
|
||||||
|
];
|
||||||
|
};
|
||||||
|
nixpkgs.overlays = [
|
||||||
|
(self: super:
|
||||||
|
let
|
||||||
|
pkgs_uf = import nixpkgs {
|
||||||
|
inherit (super) system;
|
||||||
|
config.allowUnfree = true;
|
||||||
|
};
|
||||||
|
in
|
||||||
|
{
|
||||||
|
ctranslate2 = (pkgs_uf.ctranslate2.override {
|
||||||
|
withCUDA = true;
|
||||||
|
withCuDNN = true;
|
||||||
|
stdenv = pkgs.gcc12Stdenv; # 24.11 Remove, as nvcc and gcc versions align again
|
||||||
|
# Takes more than 16 GiB RAM to compile with the above, but fine if not
|
||||||
|
});
|
||||||
|
})
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
|
@ -6,6 +6,7 @@
|
||||||
./battery.nix
|
./battery.nix
|
||||||
./boot
|
./boot
|
||||||
./ccc
|
./ccc
|
||||||
|
./cuda
|
||||||
./common.nix
|
./common.nix
|
||||||
./desktop
|
./desktop
|
||||||
./dev
|
./dev
|
||||||
|
|
Loading…
Reference in a new issue