Cleaning up
This commit is contained in:
parent
45992b10ae
commit
a4765b4fee
7 changed files with 84 additions and 54 deletions
|
|
@ -4,10 +4,8 @@
|
|||
inputs = {
|
||||
nixpkgs.url = "https://flakehub.com/f/NixOS/nixpkgs/*";
|
||||
|
||||
lanzaboote = {
|
||||
url = "github:nix-community/lanzaboote/v1.0.0";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
lanzaboote.url = "github:nix-community/lanzaboote/v1.0.0";
|
||||
lanzaboote.inputs.nixpkgs.follows = "nixpkgs";
|
||||
|
||||
apple-fonts.url = "github:Lyndeno/apple-fonts.nix";
|
||||
apple-fonts.inputs.nixpkgs.follows = "nixpkgs";
|
||||
|
|
@ -40,11 +38,14 @@
|
|||
system = "x86_64-linux";
|
||||
specialArgs = { inherit inputs; };
|
||||
modules = [
|
||||
{ nixpkgs.overlays = [ self.overlays.default ]; }
|
||||
./machines/hermes
|
||||
./users/pml.nix
|
||||
];
|
||||
};
|
||||
|
||||
overlays.default = import ./overlays;
|
||||
|
||||
devShells = forEachSupportedSystem (
|
||||
{ pkgs, system }:
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,4 +1,9 @@
|
|||
{ lib, pkgs, ... }:
|
||||
{
|
||||
inputs,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
imports = [
|
||||
|
|
@ -9,6 +14,7 @@
|
|||
./audio.nix
|
||||
./bluetooth.nix
|
||||
./networking.nix
|
||||
./hardware.nix
|
||||
];
|
||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||
|
||||
|
|
@ -38,30 +44,10 @@
|
|||
# You can use https://search.nixos.org/ to find more packages (and options).
|
||||
environment.systemPackages = with pkgs; [
|
||||
wget
|
||||
sbctl
|
||||
alacritty
|
||||
fuzzel
|
||||
libva-utils
|
||||
firefox
|
||||
(openrgb.overrideAttrs (old: {
|
||||
src = pkgs.fetchFromGitLab {
|
||||
owner = "CalcProgrammer1";
|
||||
repo = "OpenRGB";
|
||||
rev = "release_candidate_1.0rc2";
|
||||
sha256 = "vdIA9i1ewcrfX5U7FkcRR+ISdH5uRi9fz9YU5IkPKJQ=";
|
||||
};
|
||||
patches = [
|
||||
./remove_systemd_service.patch
|
||||
];
|
||||
postPatch = ''
|
||||
patchShebangs scripts/build-udev-rules.sh
|
||||
substituteInPlace scripts/build-udev-rules.sh \
|
||||
--replace-fail /usr/bin/env "${pkgs.coreutils}/bin/env"
|
||||
'';
|
||||
version = "1.0rc2";
|
||||
}))
|
||||
adwaita-icon-theme
|
||||
i2c-tools
|
||||
];
|
||||
|
||||
fonts.fontconfig = {
|
||||
|
|
@ -75,7 +61,6 @@
|
|||
rgba = "rgb";
|
||||
lcdfilter = "default";
|
||||
};
|
||||
|
||||
defaultFonts = {
|
||||
serif = [
|
||||
"SF Pro"
|
||||
|
|
@ -145,15 +130,10 @@
|
|||
polkitPolicyOwners = [ "pml" ];
|
||||
};
|
||||
|
||||
#services.hardware.openrgb.enable = true;
|
||||
services.udev.packages = [ pkgs.openrgb ];
|
||||
boot.kernelModules = [ "i2c-dev" ];
|
||||
hardware.i2c.enable = true;
|
||||
|
||||
environment.etc = {
|
||||
"1password/custom_allowed_browsers" = {
|
||||
text = ''
|
||||
firefox
|
||||
firefox
|
||||
'';
|
||||
mode = "0755";
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,7 +1,5 @@
|
|||
{
|
||||
config,
|
||||
inputs,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
|
|
|||
43
machines/hermes/hardware.nix
Normal file
43
machines/hermes/hardware.nix
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
{ pkgs, ... }:
|
||||
let
|
||||
no-rgb = pkgs.writeScriptBin "no-rgb" ''
|
||||
#!/bin/sh
|
||||
NUM_DEVICES=$(${pkgs.openrgb}/bin/openrgb --list-devices | grep -E '^[0-9]+: ' | wc -l)
|
||||
|
||||
for i in $(seq 0 $(($NUM_DEVICES - 1))); do
|
||||
${pkgs.openrgb}/bin/openrgb --device $i --mode static --color 000000
|
||||
done
|
||||
'';
|
||||
in
|
||||
{
|
||||
environment.systemPackages = with pkgs; [
|
||||
i2c-tools
|
||||
lm_sensors
|
||||
];
|
||||
|
||||
boot.kernelModules = [ "i2c-dev" ];
|
||||
boot.blacklistedKernelModules = [
|
||||
# The spd5118 driver is in conflict with openrgb by holding onto I2C adresses when using Kingston Fury DRAM.
|
||||
# On boot, I need to access those i2c regions in other to poweroff the RGB lighting.
|
||||
# Then, I manually enable the kernel module in any script.
|
||||
# It's possible to let this module disabled, but I lose the ability to get temperature values for the DIMMs.
|
||||
# https://gitlab.com/CalcProgrammer1/OpenRGB/-/merge_requests/2557
|
||||
"spd5118"
|
||||
];
|
||||
|
||||
hardware.i2c.enable = true;
|
||||
|
||||
# OpenRGB
|
||||
services.udev.packages = [ pkgs.openrgb ];
|
||||
services.hardware.openrgb.enable = true;
|
||||
systemd.services.no-rgb = {
|
||||
description = "no-rgb";
|
||||
serviceConfig = {
|
||||
ExecStart = "${no-rgb}/bin/no-rgb";
|
||||
Type = "oneshot";
|
||||
};
|
||||
after = [ "openrgb.service" ];
|
||||
requires = [ "openrgb.service" ];
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
};
|
||||
}
|
||||
3
overlays/default.nix
Normal file
3
overlays/default.nix
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
final: prev: {
|
||||
openrgb = final.callPackage ./openrgb/package.nix { openrgb = prev.openrgb; };
|
||||
}
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
final: prev: {
|
||||
openrgb = prev.openrgb.overrideAttrs (old: {
|
||||
src = final.fetchFromGitLab {
|
||||
owner = "CalcProgrammer1";
|
||||
repo = "OpenRGB";
|
||||
rev = "release_candidate_1.0rc2";
|
||||
sha256 = "vdIA9i1ewcrfX5U7FkcRR+ISdH5uRi9fz9YU5IkPKJQ=";
|
||||
};
|
||||
patches = [
|
||||
./remove_systemd_service.patch
|
||||
];
|
||||
postPatch = ''
|
||||
patchShebangs scripts/build-udev-rules.sh
|
||||
substituteInPlace scripts/build-udev-rules.sh \
|
||||
--replace-fail /usr/bin/env "${final.coreutils}/bin/env"
|
||||
'';
|
||||
|
||||
version = "1.0rc2";
|
||||
});
|
||||
}
|
||||
25
overlays/openrgb/package.nix
Normal file
25
overlays/openrgb/package.nix
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
{
|
||||
coreutils,
|
||||
fetchFromGitLab,
|
||||
openrgb,
|
||||
...
|
||||
}:
|
||||
|
||||
openrgb.overrideAttrs (old: {
|
||||
version = "1.0rc2";
|
||||
src = fetchFromGitLab {
|
||||
owner = "CalcProgrammer1";
|
||||
repo = "OpenRGB";
|
||||
rev = "release_candidate_1.0rc2";
|
||||
sha256 = "vdIA9i1ewcrfX5U7FkcRR+ISdH5uRi9fz9YU5IkPKJQ=";
|
||||
};
|
||||
patches = [
|
||||
./remove_systemd_service.patch
|
||||
];
|
||||
postPatch = ''
|
||||
patchShebangs scripts/build-udev-rules.sh
|
||||
substituteInPlace scripts/build-udev-rules.sh \
|
||||
--replace-fail /usr/bin/env "${coreutils}/bin/env"
|
||||
'';
|
||||
|
||||
})
|
||||
Loading…
Add table
Add a link
Reference in a new issue