mirror of
https://github.com/hyprwm/hyprlock.git
synced 2024-11-16 23:05:58 +01:00
Nix: refactor flake
This commit is contained in:
parent
a279ee7613
commit
4aeea1d580
3 changed files with 39 additions and 19 deletions
18
flake.lock
18
flake.lock
|
@ -39,7 +39,23 @@
|
||||||
"root": {
|
"root": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"hyprlang": "hyprlang",
|
"hyprlang": "hyprlang",
|
||||||
"nixpkgs": "nixpkgs"
|
"nixpkgs": "nixpkgs",
|
||||||
|
"systems": "systems"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"systems": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1689347949,
|
||||||
|
"narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=",
|
||||||
|
"owner": "nix-systems",
|
||||||
|
"repo": "default-linux",
|
||||||
|
"rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nix-systems",
|
||||||
|
"repo": "default-linux",
|
||||||
|
"type": "github"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
36
flake.nix
36
flake.nix
|
@ -3,6 +3,7 @@
|
||||||
|
|
||||||
inputs = {
|
inputs = {
|
||||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||||
|
systems.url = "github:nix-systems/default-linux";
|
||||||
|
|
||||||
hyprlang = {
|
hyprlang = {
|
||||||
url = "github:hyprwm/hyprlang";
|
url = "github:hyprwm/hyprlang";
|
||||||
|
@ -10,33 +11,34 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = inputs: let
|
outputs = {
|
||||||
inherit (inputs.nixpkgs) lib;
|
self,
|
||||||
genSystems = lib.genAttrs [
|
nixpkgs,
|
||||||
# Add more systems if they are supported
|
systems,
|
||||||
"x86_64-linux"
|
...
|
||||||
"aarch64-linux"
|
} @ inputs: let
|
||||||
];
|
inherit (nixpkgs) lib;
|
||||||
pkgsFor = genSystems (system:
|
eachSystem = lib.genAttrs (import systems);
|
||||||
import inputs.nixpkgs {
|
pkgsFor = eachSystem (system:
|
||||||
overlays = [inputs.self.overlays.default];
|
import nixpkgs {
|
||||||
inherit system;
|
localSystem.system = system;
|
||||||
|
overlays = with self.overlays; [default];
|
||||||
});
|
});
|
||||||
in {
|
in {
|
||||||
overlays = import ./nix/overlays.nix {inherit inputs lib;};
|
overlays = import ./nix/overlays.nix {inherit inputs lib;};
|
||||||
|
|
||||||
packages = genSystems (system: {
|
packages = eachSystem (system: {
|
||||||
|
default = self.packages.${system}.hyprlock;
|
||||||
inherit (pkgsFor.${system}) hyprlock;
|
inherit (pkgsFor.${system}) hyprlock;
|
||||||
default = inputs.self.packages.${system}.hyprlock;
|
|
||||||
});
|
});
|
||||||
|
|
||||||
homeManagerModules = {
|
homeManagerModules = {
|
||||||
hyprlock = import ./nix/hm-module.nix inputs.self;
|
default = self.homeManagerModules.hyprlock;
|
||||||
default = inputs.self.homeManagerModules.hyprlock;
|
hyprlock = import ./nix/hm-module.nix self;
|
||||||
};
|
};
|
||||||
|
|
||||||
checks = genSystems (system: inputs.self.packages.${system});
|
checks = eachSystem (system: self.packages.${system});
|
||||||
|
|
||||||
formatter = genSystems (system: pkgsFor.${system}.alejandra);
|
formatter = eachSystem (system: pkgsFor.${system}.alejandra);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,7 +8,9 @@
|
||||||
(builtins.substring 6 2 longDate)
|
(builtins.substring 6 2 longDate)
|
||||||
]);
|
]);
|
||||||
in {
|
in {
|
||||||
default = lib.composeManyExtensions [
|
default = inputs.self.overlays.hyprlock;
|
||||||
|
|
||||||
|
hyprlock = lib.composeManyExtensions [
|
||||||
inputs.hyprlang.overlays.default
|
inputs.hyprlang.overlays.default
|
||||||
(final: prev: {
|
(final: prev: {
|
||||||
hyprlock = prev.callPackage ./default.nix {
|
hyprlock = prev.callPackage ./default.nix {
|
||||||
|
|
Loading…
Reference in a new issue