-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
142 lines (132 loc) · 4.49 KB
/
flake.nix
File metadata and controls
142 lines (132 loc) · 4.49 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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
{
description = "fuwa dotfiles";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
nixos-hardware.url = "github:NixOS/nixos-hardware/master";
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
neovim-nightly-overlay = {
url = "github:nix-community/neovim-nightly-overlay";
inputs.nixpkgs.follows = "nixpkgs";
};
nil = {
url = "github:oxalica/nil";
inputs.nixpkgs.follows = "nixpkgs";
};
nix-index-database.url = "github:nix-community/nix-index-database";
nix-index-database.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = {
self,
nixpkgs,
home-manager,
...
} @ inputs: let
system = "x86_64-linux";
overlays = [
inputs.neovim-nightly-overlay.overlays.default
inputs.nil.overlays.nil
(self: super: {
cargo-binutils = super.rustPlatform.buildRustPackage (
let old = super.cargo-binutils; in rec {
inherit (old) pname meta;
version = "0.4.0";
src = super.fetchCrate {
inherit pname version;
hash = "sha256-AF1MRBH8ULnHNHT2FS/LxMH+b06QMTIZMIR8mmkn17c=";
};
cargoHash = "sha256-pK6pFgOxQdEc4hYFj6mLEiIuPhoutpM2h3OLZgYrf6Q=";
});
quickshell = super.quickshell.overrideAttrs (oldAttrs: {
src = sources.quickshell.src;
buildInputs = oldAttrs.buildInputs ++ [
super.polkit
(super.cpptrace.overrideAttrs (old: {
cmakeFlags = old.cmakeFlags ++ [
(super.lib.cmakeBool "CPPTRACE_UNWIND_WITH_LIBUNWIND" true)
];
buildInputs = old.buildInputs ++ [ super.libunwind ];
}))
];
});
niri = super.niri.overrideAttrs (finalAttrs: prevAttrs: {
src = sources.niri.src;
cargoDeps = super.rustPlatform.importCargoLock sources.niri.cargoLock."Cargo.lock";
postPatch = ''
patchShebangs resources/niri-session
substituteInPlace resources/niri.service \
--replace-fail 'ExecStart=niri' "ExecStart=$out/bin/niri"
'';
patches = [ (super.writeText "loglevel.patch" ''
diff --git a/src/utils/spawning.rs b/src/utils/spawning.rs
index 2c7ae454..4ee422d5 100644
--- a/src/utils/spawning.rs
+++ b/src/utils/spawning.rs
@@ -445,6 +445,7 @@ mod systemd {
let properties: &[_] = &[
("PIDs", Value::new(pids)),
("CollectMode", Value::new("inactive-or-failed")),
+ ("LogLevelMax", Value::new(5i32)), // notice
];
let aux: &[(&str, &[(&str, Value)])] = &[];
'') ];
});
})
];
pkgs = import nixpkgs {
inherit system overlays;
allowUnfree = true;
};
sources = pkgs.callPackage ./nix/_sources/generated.nix {};
in
{
nixosConfigurations = pkgs.lib.attrsets.mapAttrs (k: v: inputs.nixpkgs.lib.nixosSystem ({
system = "x86_64-linux";
modules = [
(_: { nixpkgs.overlays = overlays; })
] ++ v.modules;
specialArgs = {
inherit inputs sources;
};
})) {
fuwavermeer-nix = { modules = [ ./nix/nixos/hosts/fuwavermeer.nix ]; };
fuwathink10-nix = { modules = [ ./nix/nixos/hosts/fuwathink10.nix ]; };
};
homeConfigurations = {
fuwa = inputs.home-manager.lib.homeManagerConfiguration {
inherit pkgs;
extraSpecialArgs = {
inherit inputs sources;
};
modules = [
inputs.nix-index-database.homeModules.nix-index
./nix/home/desktop.nix
];
};
headless = inputs.home-manager.lib.homeManagerConfiguration {
inherit pkgs;
extraSpecialArgs = {
inherit inputs sources;
};
modules = [
inputs.nix-index-database.homeModules.nix-index
./nix/home/base.nix
];
};
# fuwa@host = headless; # aliases here like this
};
apps.${system} = {
nvfetcher = {
type = "app";
program = toString (pkgs.writeShellScript "nvfetcher" ''
${pkgs.nvfetcher}/bin/nvfetcher \
-c ./nix/nvfetcher.toml \
-o ./nix/_sources \
"$@"
'');
};
};
};
}