aboutsummaryrefslogtreecommitdiffhomepage
path: root/flake.nix
diff options
context:
space:
mode:
authorFernando Ayats <[email protected]>2022-05-21 12:07:55 +0200
committerFernando Ayats <[email protected]>2022-05-21 12:07:55 +0200
commit9d89e0f08e1782ddeefa030755805387fb14dccf (patch)
tree2017d900f5cddfedd0fb381b2a4cbe8aaa0c6d9c /flake.nix
parentb3276d32077b7883e4cede784b6598fc3ca403c0 (diff)
downloadHyprland-9d89e0f08e1782ddeefa030755805387fb14dccf.tar.gz
Hyprland-9d89e0f08e1782ddeefa030755805387fb14dccf.zip
nix: add nixos module
Diffstat (limited to 'flake.nix')
-rw-r--r--flake.nix26
1 files changed, 18 insertions, 8 deletions
diff --git a/flake.nix b/flake.nix
index 96b2375f..c7e672e5 100644
--- a/flake.nix
+++ b/flake.nix
@@ -14,32 +14,42 @@
nixpkgs,
...
}: let
- supportedSystems = [
- "aarch64-linux"
+ inherit (nixpkgs) lib;
+ genSystems = lib.genAttrs [
"x86_64-linux"
];
- genSystems = nixpkgs.lib.genAttrs supportedSystems;
pkgsFor = nixpkgs.legacyPackages;
+ # https://github.com/NixOS/rfcs/pull/107
+ mkVersion = longDate:
+ lib.concatStrings [
+ "0.pre"
+ "+date="
+ (lib.concatStringsSep "-" [
+ (__substring 0 4 longDate)
+ (__substring 4 2 longDate)
+ (__substring 6 2 longDate)
+ ])
+ ];
in {
packages = genSystems (system: {
wlroots = pkgsFor.${system}.wlroots.overrideAttrs (prev: {
- version = inputs.wlroots.lastModifiedDate;
+ version = mkVersion inputs.wlroots.lastModifiedDate;
src = inputs.wlroots;
});
default = pkgsFor.${system}.callPackage ./default.nix {
- version = self.lastModifiedDate;
+ version = mkVersion self.lastModifiedDate;
inherit (self.packages.${system}) wlroots;
};
});
formatter = genSystems (system: pkgsFor.${system}.alejandra);
- # TODO Provide a nixos module for easy installation and configuration
- # nixosModules.default = import ./module.nix;
+ nixosModules.default = import ./module.nix self;
# Deprecated
- overlay = _: prev: {
+ overlays.default = _: prev: {
hyprland = self.packages.${prev.system}.default;
};
+ overlay = self.overlays.default;
};
}