/
flake.nix
87 lines (66 loc) · 2.16 KB
/
flake.nix
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
87
{
description = "My awesomeWM configuration";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
flake-compat = {
url = "github:edolstra/flake-compat";
flake = false;
};
wallpaper-generator = {
url = "github:pinpox/wallpaper-generator";
flake = false;
};
};
outputs = { ... }@inputs:
with inputs;
let test = "rstin";
in {
nixosModules = {
dotfiles = {
home.file = {
".config/awesome".source = ./dotfiles;
".local/share/wallpaper-generator".source = wallpaper-generator;
};
};
};
} //
flake-utils.lib.eachSystem [ "aarch64-linux" "i686-linux" "x86_64-linux" ] (system:
let pkgs = nixpkgs.legacyPackages.${system};
in rec {
packages = flake-utils.lib.flattenTree rec {
awesome-configuration = pkgs.stdenv.mkDerivation rec {
pname = "awesome-configration";
version = "1.0";
src = ./dotfiles;
dontBuild = true;
nativeBuildInputs =
[ pkgs.luaPackages.lgi pkgs.luaPackages.luafilesystem ];
installPhase = ''
cp -r . $out
cat >$out/run-test <<EOL
#!/usr/bin/env bash
set -eu -o pipefail
export AWESOME_THEME=$out/theme.lua
Xephyr :5 -screen 1024x768 & sleep 1 ; DISPLAY=:5 ${pkgs.awesome}/bin/awesome -c $out/rc.lua --search $out
EOL
chmod +x $out/run-test
'';
meta = with pkgs.lib; {
homepage = "https://github.com/pinpox/dotfiles-awesome";
description = "Pinpox's awesomeWM configuration";
license = licenses.mit;
maintainers = [ maintainers.pinpox ];
};
};
};
apps = {
test-config = flake-utils.lib.mkApp {
drv = packages.awesome-configuration;
exePath = "/run-test";
};
};
defaultPackage = packages.awesome-configuration;
defaultApp = apps.test-config;
});
}