Skip to content

Commit c25f231

Browse files
authored
Merge pull request yaocccc#1 from Ruixi-rebirth/master
add nix flake support
2 parents eeb324d + e3c33ff commit c25f231

File tree

3 files changed

+112
-0
lines changed

3 files changed

+112
-0
lines changed

README.md

+31
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,38 @@ $ ninja -C build
100100
$ ninja -C build install
101101
```
102102

103+
103104
Default install prefix is `/usr/local`, you can change it with `meson configure -Dprefix=<path> build`
105+
### Nix Flake
106+
Here's an example of using it in a nixos configuration
107+
```Nix
108+
{
109+
description = "My configuration";
110+
111+
inputs = {
112+
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
113+
picom.url = "github:yaocccc/picom";
114+
};
115+
116+
outputs = { nixpkgs, picom, ... }:
117+
{
118+
nixosConfigurations = {
119+
hostname = nixpkgs.lib.nixosSystem
120+
{
121+
system = "x86_64-linux";
122+
modules = [
123+
{
124+
nixpkgs.overlays = [ picom.overlays.default ];
125+
environment.systemPackages = with pkgs;[
126+
picom
127+
];
128+
}
129+
];
130+
};
131+
};
132+
};
133+
}
134+
```
104135

105136
## How to Contribute
106137

flake.lock

+42
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
{
2+
inputs = {
3+
nixpkgs.url = "nixpkgs/nixos-unstable";
4+
flake-utils.url = "github:numtide/flake-utils";
5+
};
6+
7+
outputs =
8+
{ self
9+
, nixpkgs
10+
, flake-utils
11+
,
12+
}:
13+
let
14+
overlay =
15+
final: prev: {
16+
picom = prev.picom.overrideAttrs (oldAttrs: rec {
17+
version = "master";
18+
src = ./.;
19+
});
20+
};
21+
in
22+
flake-utils.lib.eachDefaultSystem
23+
(
24+
system:
25+
let
26+
pkgs = import nixpkgs {
27+
inherit system;
28+
overlays = [
29+
self.overlays.default
30+
];
31+
};
32+
in
33+
rec {
34+
packages.picom = pkgs.picom;
35+
packages.default = pkgs.picom;
36+
}
37+
)
38+
// { overlays.default = overlay; };
39+
}

0 commit comments

Comments
 (0)