tangled
alpha
login
or
join now
bwc9876.dev
/
nixos-config
1
fork
atom
Flake for my NixOS devices
1
fork
atom
overview
issues
pulls
pipelines
Fix battery_notif.nu
bwc9876.dev
1 year ago
f3e28d61
c1c37cfb
verified
This commit was signed with the committer's
known signature
.
bwc9876.dev
SSH Key Fingerprint:
SHA256:DanMEP/RNlSC7pAVbnXO6wzQV00rqyKj053tz4uH5gQ=
+25
-25
4 changed files
expand all
collapse all
unified
split
base
shell.nix
flake.lock
res
battery_notif.nu
roles
imperm.nix
+1
base/shell.nix
···
4
4
programs.fish.enable = true;
5
5
documentation.man.generateCaches = false;
6
6
programs.ssh.startAgent = true;
7
7
+
services.upower.enable = true;
7
8
8
9
security.sudo.extraConfig = ''
9
10
Defaults lecture = never
+21
-21
flake.lock
···
233
233
]
234
234
},
235
235
"locked": {
236
236
-
"lastModified": 1735882644,
237
237
-
"narHash": "sha256-3FZAG+pGt3OElQjesCAWeMkQ7C/nB1oTHLRQ8ceP110=",
236
236
+
"lastModified": 1737043064,
237
237
+
"narHash": "sha256-I/OuxGwXwRi5gnFPsyCvVR+IfFstA+QXEpHu1hvsgD8=",
238
238
"owner": "cachix",
239
239
"repo": "git-hooks.nix",
240
240
-
"rev": "a5a961387e75ae44cc20f0a57ae463da5e959656",
240
240
+
"rev": "94ee657f6032d913fe0ef49adaa743804635b0bb",
241
241
"type": "github"
242
242
},
243
243
"original": {
···
297
297
]
298
298
},
299
299
"locked": {
300
300
-
"lastModified": 1737075266,
301
301
-
"narHash": "sha256-u1gk5I1an975FOAMMdS6oBKnSIsZza5ZKhaeBZAskVo=",
300
300
+
"lastModified": 1737221749,
301
301
+
"narHash": "sha256-igllW0yG+UbetvhT11jnt9RppSHXYgMykYhZJeqfHs0=",
302
302
"owner": "nix-community",
303
303
"repo": "home-manager",
304
304
-
"rev": "12851ae7467bad8ef422b20806ab4d6d81e12d29",
304
304
+
"rev": "97d7946b5e107dd03cc82f21165251d4e0159655",
305
305
"type": "github"
306
306
},
307
307
"original": {
···
436
436
]
437
437
},
438
438
"locked": {
439
439
-
"lastModified": 1736370755,
440
440
-
"narHash": "sha256-iWcjToBpx4PUd74uqvIGAfqqVfyrvRLRauC/SxEKIF0=",
439
439
+
"lastModified": 1736819234,
440
440
+
"narHash": "sha256-deQVtIH4UJueELJqluAICUtX7OosD9paTP+5FgbiSwI=",
441
441
"owner": "lnl7",
442
442
"repo": "nix-darwin",
443
443
-
"rev": "57733bd1dc81900e13438e5b4439239f1b29db0e",
443
443
+
"rev": "bd921223ba7cdac346477d7ea5204d6f4736fcc6",
444
444
"type": "github"
445
445
},
446
446
"original": {
···
487
487
},
488
488
"nixpkgs": {
489
489
"locked": {
490
490
-
"lastModified": 1736883708,
491
491
-
"narHash": "sha256-uQ+NQ0/xYU0N1CnXsa2zghgNaOPxWpMJXSUJJ9W7140=",
490
490
+
"lastModified": 1737062831,
491
491
+
"narHash": "sha256-Tbk1MZbtV2s5aG+iM99U8FqwxU/YNArMcWAv6clcsBc=",
492
492
"owner": "NixOS",
493
493
"repo": "nixpkgs",
494
494
-
"rev": "eb62e6aa39ea67e0b8018ba8ea077efe65807dc8",
494
494
+
"rev": "5df43628fdf08d642be8ba5b3625a6c70731c19c",
495
495
"type": "github"
496
496
},
497
497
"original": {
···
550
550
"treefmt-nix": "treefmt-nix"
551
551
},
552
552
"locked": {
553
553
-
"lastModified": 1737073716,
554
554
-
"narHash": "sha256-VLEgdcXfzUafsAij+7294MIX5sZYizo0ClCXxAOR55s=",
553
553
+
"lastModified": 1737200978,
554
554
+
"narHash": "sha256-QTUx/F8HVjrRIHQxHKrr72aPMj+cDk18WTbvBCCBBdI=",
555
555
"owner": "nix-community",
556
556
"repo": "nixvim",
557
557
-
"rev": "16662760a92d777ef73d3b54e507455bc66dc114",
557
557
+
"rev": "cbf960e5659054b2ccf27b67218782e69016bef5",
558
558
"type": "github"
559
559
},
560
560
"original": {
···
679
679
]
680
680
},
681
681
"locked": {
682
682
-
"lastModified": 1736994333,
683
683
-
"narHash": "sha256-v4Jrok5yXsZ6dwj2+2uo5cSyUi9fBTurHqHvNHLT1XA=",
682
682
+
"lastModified": 1737166965,
683
683
+
"narHash": "sha256-vlDROBAgq+7PEVM0vaS2zboY6DXs3oKK0qW/1dVuFs4=",
684
684
"owner": "oxalica",
685
685
"repo": "rust-overlay",
686
686
-
"rev": "848db855cb9e88785996e961951659570fc58814",
686
686
+
"rev": "fc839c9d5d1ebc789b4657c43c4d54838c7c01de",
687
687
"type": "github"
688
688
},
689
689
"original": {
···
730
730
]
731
731
},
732
732
"locked": {
733
733
-
"lastModified": 1736154270,
734
734
-
"narHash": "sha256-p2r8xhQZ3TYIEKBoiEhllKWQqWNJNoT9v64Vmg4q8Zw=",
733
733
+
"lastModified": 1737054102,
734
734
+
"narHash": "sha256-saLiCRQ5RtdTnznT/fja7GxcYRAzeY3k8S+IF/2s/2A=",
735
735
"owner": "numtide",
736
736
"repo": "treefmt-nix",
737
737
-
"rev": "13c913f5deb3a5c08bb810efd89dc8cb24dd968b",
737
737
+
"rev": "97871d416166803134ba64597a1006f3f670fbde",
738
738
"type": "github"
739
739
},
740
740
"original": {
+3
-3
res/battery_notif.nu
···
11
11
dbus get-all --system --dest=$BUS_NAME $"($PATH_PREFIX)/devices/($name)" $"($BUS_NAME).Device"
12
12
}
13
13
14
14
-
def should_consider [device: record] -> bool {
14
14
+
def should_consider [device: record] : bool -> bool {
15
15
match $device.Type {
16
16
2 => $device.PowerSupply, # Battery, we want to make sure PowerSupply is true to ensure it's a laptop battery
17
17
17 => true # Bluetooth Headset
···
20
20
}
21
21
22
22
23
23
-
def get_name [device: record] -> string {
23
23
+
def get_name [device: record] : string -> string {
24
24
25
25
let fallback = "(" + ($device.upower_path | path basename) + ")";
26
26
···
50
50
$devices | each {|it| device_info ($it | path basename) | insert "upower_path" $it} | each {|it| $it | insert "friendly_name" (get_name $it)} | where {|it| should_consider $it}
51
51
}
52
52
53
53
-
def should_display_notif [device: record] -> bool {
53
53
+
def should_display_notif [device: record] : bool -> bool {
54
54
55
55
let charging = match ($device.State? | default 0) {
56
56
1 | 4 | 5 => true, # Charging or Fully Charged or Pending Charge
-1
roles/imperm.nix
···
11
11
preConf = preWith ".config";
12
12
in {
13
13
imports = [inputs.imperm.nixosModules.default];
14
14
-
# Requires /nix/persist and /nix/cache to exist
15
14
16
15
environment.etc."machine-id".text = builtins.hashString "md5" config.networking.hostName;
17
16