This repository has been archived by the owner on Oct 6, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
61 lines (56 loc) · 1.61 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
# {
# description = "A very basic flake";
#
# inputs = {
# nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
# };
#
# outputs = { self, nixpkgs }: {
#
# packages.x86_64-linux.hello = nixpkgs.legacyPackages.x86_64-linux.hello;
#
# packages.x86_64-linux.default = self.packages.x86_64-linux.hello;
#
# };
# }
{
description = "Enable Plymouth";
# From NixOS Discourse "How do people work on Plymouth themes on NixOS?"
# But it doesn't work on NixOS 24.05. So I'm trying to config another Flakes.
inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
fu.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, fu }: fu.lib.eachDefaultSystem (system: let
projectPath = builtins.toString ./.;
pkgs = nixpkgs.legacyPackages.${system};
plymouthConfPackage = pkgs.runCommand "build-plymouth-conf-package" {} ''
mkdir $out
mkdir -p $out/etc/plymouth/themes/testing
cat <<EOF > "$out/etc/plymouth/plymouthd.conf"
[Daemon]
ShowDelay=0
DeviceTimeout=8
Theme=testing
EOF
ln -s ${pkgs.plymouth}/lib/plymouth $out/etc/plymouth/plugins
ln -s ${pkgs.plymouth}/share/plymouth/plymouthd.defaults $out/etc/plymouth/plymouthd.defaults
'';
env = pkgs.buildFHSEnvBubblewrap {
name = "plymouthFHSEnv";
targetPkgs = p: with p; [
plymouth
];
runScript = ''
bash
'';
extraBwrapArgs = [
"--ro-bind" "${plymouthConfPackage}/etc/plymouth" "/etc/plymouth"
"--ro-bind" "${projectPath}/" "/etc/plymouth/themes/testing"
];
};
in {
devShells.default = env.env;
});
nixosConfigurations."edenlinux".config.system.build.toplevel = 9;
}