forked from AvengeMedia/DankMaterialShell
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
86 lines (79 loc) · 2.92 KB
/
flake.nix
File metadata and controls
86 lines (79 loc) · 2.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
{
description = "Dank Material Shell";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
dgop = {
url = "github:AvengeMedia/dgop";
inputs.nixpkgs.follows = "nixpkgs";
};
dms-cli = {
url = "github:AvengeMedia/danklinux";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = {
self,
nixpkgs,
dgop,
dms-cli,
...
}: let
forEachSystem = fn:
nixpkgs.lib.genAttrs
["aarch64-darwin" "aarch64-linux" "x86_64-darwin" "x86_64-linux"]
(system: fn system nixpkgs.legacyPackages.${system});
buildDmsPkgs = pkgs: {
dmsCli = dms-cli.packages.${pkgs.system}.default;
dgop = dgop.packages.${pkgs.system}.dgop;
dankMaterialShell = self.packages.${pkgs.system}.dankMaterialShell;
};
in {
formatter = forEachSystem (_: pkgs: pkgs.alejandra);
packages = forEachSystem (system: pkgs: {
dankMaterialShell = let
mkDate = longDate: pkgs.lib.concatStringsSep "-" [
(builtins.substring 0 4 longDate)
(builtins.substring 4 2 longDate)
(builtins.substring 6 2 longDate)
];
in pkgs.stdenvNoCC.mkDerivation {
pname = "dankMaterialShell";
version = pkgs.lib.removePrefix "v" (pkgs.lib.trim (builtins.readFile ./VERSION))
+ "+date=" + mkDate (self.lastModifiedDate or "19700101")
+ "_" + (self.shortRev or "dirty");
src = pkgs.lib.cleanSourceWith {
src = ./.;
filter = path: type:
!(builtins.any (prefix: pkgs.lib.path.hasPrefix (./. + prefix) (/. + path)) [
/.github
/.gitignore
/dms.spec
/dms-greeter.spec
/nix
/flake.nix
/flake.lock
/alejandra.toml
]);
};
installPhase = ''
mkdir -p $out/etc/xdg/quickshell/dms
cp -r . $out/etc/xdg/quickshell/dms
'';
};
default = self.packages.${system}.dankMaterialShell;
});
homeModules.dankMaterialShell.default = {pkgs, ...}: let
dmsPkgs = buildDmsPkgs pkgs;
in {
imports = [./nix/default.nix];
_module.args.dmsPkgs = dmsPkgs;
};
homeModules.dankMaterialShell.niri = import ./nix/niri.nix;
nixosModules.greeter = {pkgs, ...}: let
dmsPkgs = buildDmsPkgs pkgs;
in {
imports = [./nix/greeter.nix];
_module.args.dmsPkgs = dmsPkgs;
};
};
}