working on screens and power stuff

This commit is contained in:
Matt Nish-Lapidus 2025-02-16 16:24:34 -05:00
parent 6d3a143ce2
commit 2002da4dcf
14 changed files with 237 additions and 150 deletions

View file

@ -1,7 +1,3 @@
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running nixos-help).
{
nix-config,
config,
@ -13,11 +9,13 @@
{
imports = with nix-config.nixosModules; [
# Include the results of the hardware scan.
./hardware-configuration.nix
./razer-speaker-fix.nix
sops-config
niri
kanata
filesystems
];
nixpkgs = {
@ -42,8 +40,6 @@
};
nix = {
# registry.nixpkgs.flake = nixpkgs;
# channel.enable = false;
settings = {
experimental-features = [
"nix-command"
@ -57,79 +53,14 @@
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
"cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g="
];
# Workaround for https://github.com/NixOS/nix/issues/9574
nix-path = config.nix.nixPath;
};
};
sops = {
age.keyFile = "/home/emenel/.config/sops/age/keys.txt"; # must have no password!
defaultSopsFile = ./secrets.yaml;
secrets = {
filez = {};
};
templates."smb-secrets".content = ''
username=admin
password=${config.sops.placeholder.filez}
# '';
};
environment.etc = {
"nixos/smb-secrets" = {
source = config.sops.templates."smb-secrets".path;
group = "users";
};
};
fileSystems =
let
automount_opts = "x-systemd.automount,noauto,users,x-systemd.idle-timeout=60,x-systemd.device-timeout=5s,x-systemd.mount-timeout=5s,uid=1000,credentials=/etc/nixos/smb-secrets";
in {
"/mnt/filez/media" = {
device = "//100.70.114.113/Media";
fsType = "smb3";
options = [
"${automount_opts}"
];
};
"/mnt/filez/music-production" = {
device = "//100.70.114.113/Music Production";
fsType = "smb3";
options = [
"${automount_opts}"
];
};
"/mnt/filez/storage" = {
device = "//100.70.114.113/Storage";
fsType = "smb3";
options = [
"${automount_opts}"
];
};
"/mnt/filez/photos" = {
device = "//100.70.114.113/Photo Storage";
fsType = "smb3";
options = [
"${automount_opts}"
];
};
};
# fileSystems."/mnt/beets-import" = {
# device = "//100.103.170.132/media";
# fsType = "smb3";
# options = let
# automount_opts = "x-systemd.automount,noauto,users,x-systemd.idle-timeout=60,x-systemd.device-timeout=5s,x-systemd.mount-timeout=5s,uid=1000";
# in [
# "${automount_opts}"
# ];
# };
# Set your time zone.
time.timeZone = "America/Toronto";
# Select internationalisation properties.
i18n.defaultLocale = "en_CA.UTF-8";
environment.systemPackages = with pkgs; [
wget
@ -264,10 +195,11 @@ password=${config.sops.placeholder.filez}
services.udev = {
extraRules = ''
DEVPATH=="/devices/virtual/misc/cpu_dma_latency", OWNER="root", GROUP="audio", MODE="0660"
ACTION=="add", SUBSYSTEM=="i2c-dev", ATTR{name}=="AMDGPU DM*", TAG+="ddcci", TAG+="systemd", ENV{SYSTEMD_WANTS}+="ddcci@$kernel.service"
ACTION=="add", SUBSYSTEM=="backlight", KERNEL=="ddcci*", RUN+="${pkgs.coreutils-full}/bin/chgrp video /sys/class/backlight/%k/brightness"
ACTION=="add", SUBSYSTEM=="backlight", KERNEL=="ddcci*", RUN+="${pkgs.coreutils-full}/bin/chmod a+w /sys/class/backlight/%k/brightness"
ACTION=="add", SUBSYSTEM=="i2c-dev", ATTR{name}=="AMDGPU DM*", TAG+="ddcci", TAG+="systemd", ENV{SYSTEMD_WANTS}+="ddcci@$kernel.service"
ACTION=="add", SUBSYSTEM=="i2c-dev", ATTR{name}=="NVIDIA i2c adapter*", TAG+="ddcci", TAG+="systemd", ENV{SYSTEMD_WANTS}+="ddcci@$kernel.service"
SUBSYSTEM=="i2c", ACTION=="add", ATTR{name}=="AMDGPU DM aux hw bus 3", RUN+="${pkgs.bash}/bin/bash -c 'sleep 30; printf ddcci\ 0x37 > /sys/bus/i2c/devices/i2c-17/new_device'"
'';
packages = [
pkgs.via
@ -313,6 +245,7 @@ password=${config.sops.placeholder.filez}
security.rtkit.enable = true;
security.pam.services.swaylock = { };
security.pam.services.hyprlock = { };
security.pam.services.greetd.enableGnomeKeyring = true;
services.xserver.videoDrivers = [
"nvidia"
@ -356,12 +289,6 @@ password=${config.sops.placeholder.filez}
'';
};
# Set your time zone.
time.timeZone = "America/Toronto";
# Select internationalisation properties.
i18n.defaultLocale = "en_CA.UTF-8";
services.xserver.enable = true;
# Enable the GNOME Desktop Environment.
@ -541,21 +468,6 @@ password=${config.sops.placeholder.filez}
services.accounts-daemon.enable = true;
services.gnome.gnome-online-accounts.enable = true;
services.kmonad = {
enable = true;
keyboards = {
sinc = {
device = "/dev/input/by-id/usb-Keebio_Sinc_Rev._4-event-kbd";
config = builtins.readFile ../../homes/emenel/dotfiles/dot_config/kmonad/sinc.kbd;
};
razer = {
extraGroups = [ "openrazer" ];
device = "/dev/input/by-id/usb-Razer_Razer_Blade-if01-event-kbd";
config = builtins.readFile ../../homes/emenel/dotfiles/dot_config/kmonad/razer.kbd;
};
};
};
programs.virt-manager.enable = true;
virtualisation = {