add version to roc

This commit is contained in:
Daylin Morgan 2024-07-18 10:18:32 -05:00
parent 435d63b188
commit d49e0b044d
Signed by: daylin
GPG key ID: 950D13E9719334AD
2 changed files with 19 additions and 4 deletions

View file

@ -63,6 +63,11 @@ let
(substring 6 2 longDate) (substring 6 2 longDate)
]); ]);
flakeVer =
flake:
"${flake.shortRev or flake.dirtyShortRev}-${mkDate (toString flake.lastModifiedDate)}";
isNixFile = p: hasSuffix ".nix" p; isNixFile = p: hasSuffix ".nix" p;
isDefaultNixFile = p: hasSuffix "default.nix" p; isDefaultNixFile = p: hasSuffix "default.nix" p;
filterNotDefaultNixFile = paths: filter (p: !(isDefaultNixFile p) && (isNixFile p)) paths; filterNotDefaultNixFile = paths: filter (p: !(isDefaultNixFile p) && (isNixFile p)) paths;
@ -81,5 +86,6 @@ in
mkIfIn mkIfIn
isNixFile isNixFile
listNixFilesRecursive listNixFilesRecursive
flakeVer
; ;
} }

View file

@ -6,14 +6,23 @@
... ...
}: }:
let let
inherit (lib) mkIfIn; inherit (lib) mkIfIn flakeVer;
version = flakeVer inputs.roc;
cfg = config.oizys.languages; cfg = config.oizys.languages;
rocPkgs = inputs.roc.packages.${pkgs.system}; rocPkgs = inputs.roc.packages.${pkgs.system};
# I'm setting the versions so the changes are more apparent as flake is updated
roc = rocPkgs.cli.overrideAttrs {
inherit version;
};
lang-server = rocPkgs.lang-server.overrideAttrs {
inherit version;
};
in in
{ {
config = mkIfIn "roc" cfg { config = mkIfIn "roc" cfg {
environment.systemPackages = with rocPkgs; [ environment.systemPackages = [roc lang-server];
full # cli + lang_server
];
}; };
} }