Nix flake configuration manager
1{
2 description = "Lumar - Nix configuration selector TUI";
3
4 inputs = {
5 nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
6 };
7
8 outputs = { self, nixpkgs }:
9 let
10 systems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];
11 forAllSystems = nixpkgs.lib.genAttrs systems;
12 in
13 {
14 packages = forAllSystems (system:
15 let
16 pkgs = nixpkgs.legacyPackages.${system};
17 in
18 {
19 default = pkgs.rustPlatform.buildRustPackage {
20 pname = "lumar";
21 version = "0.1.0";
22
23 src = pkgs.lib.cleanSourceWith {
24 src = ./.;
25 filter = path: type:
26 let baseName = baseNameOf (toString path);
27 in pkgs.lib.cleanSourceFilter path type &&
28 !(builtins.elem baseName [ "target" ".devenv" ".jj" ]);
29 };
30
31 cargoLock = {
32 lockFile = ./Cargo.lock;
33 outputHashes = {
34 # Run `nix build` once to get the correct hash from the error message,
35 # then replace the placeholder below.
36 "sly-0.0.2" = "sha256-GdkppkfYWSaBl9jgae90ST/sSHs2zxdm3DHmye4bCA8=";
37 };
38 };
39
40 meta = with pkgs.lib; {
41 description = "TUI for selecting and applying Nix configurations";
42 mainProgram = "lumar";
43 };
44 };
45 }
46 );
47 };
48}