Compare commits

..

4 Commits

Author SHA1 Message Date
d5dbc09e2c try firmware 2025-08-28 00:46:08 -05:00
14c3f7ad1b swaylock broke 2025-08-27 21:43:18 -05:00
cbdc9b0d7c hardware specific pi4 stuff 2025-08-27 20:37:55 -05:00
38bd11aea7 pi4 almost ready 2025-08-27 09:44:13 -05:00
14 changed files with 330 additions and 165 deletions

View File

@@ -11,6 +11,10 @@ creation_rules:
key_groups: key_groups:
- age: - age:
- *laptop - *laptop
- path_regex: pi4/secrets.yaml$
key_groups:
- age:
- *laptop
- path_regex: nathan/secrets.yaml$ - path_regex: nathan/secrets.yaml$
key_groups: key_groups:
- age: - age:

View File

@@ -8,7 +8,7 @@
./terminal ./terminal
./rofi ./rofi
./pywal ./pywal
./swaylock ./hyprlock
./calcurse ./calcurse
./firefox ./firefox
]; ];

View File

@@ -0,0 +1,18 @@
{ config, lib, pkgs, ... }: {
options.homeconfig.hyprlock.enable = lib.options.mkOption {
type = lib.types.bool;
default = false;
};
config = lib.mkIf config.homeconfig.hyprlock.enable {
programs.hyprlock = {
enable = true;
};
programs.hypridle = {
enable = true;
};
};
}

View File

@@ -1,12 +0,0 @@
{ config, lib, pkgs, ... }: {
options.homeconfig.swaylock.enable = lib.options.mkOption {
type = lib.types.bool;
default = false;
};
config = lib.mkIf config.homeconfig.swaylock.enable {
home.packages = with pkgs; [ swaylock-effects ];
};
}

View File

@@ -38,27 +38,16 @@
defaultSopsFile = ./secrets.yaml; defaultSopsFile = ./secrets.yaml;
defaultSopsFormat = "yaml"; defaultSopsFormat = "yaml";
}; };
/*
nix = { nix = lib.mkIf config.homeconfig.standalone.enable {
nixPath = [ "nixpkgs=${inputs.nixpkgs}" ]; nixPath = [ "nixpkgs=${inputs.nixpkgs}" ];
settings = { settings = {
experimental-features = [ "nix-command" "flakes" ]; experimental-features = [ "nix-command" "flakes" ];
builders = '' builders = "ssh://builder x86_64-linux,aarch64-linux /run/secrets/remoteBuildKey 1 1 nixos-test,benchmark,big-parallel,kvm - -";
ssh://remote-builder@blunkall.us
'';
builders-use-substituters = true; builders-use-substituters = true;
}; };
}; };
programs.ssh.matchBlocks = {
"builder" = {
hostname = "blunkall.us";
user = "remote-builder";
identityFile = config.sops.secrets."".path;
port = 2222;
};
};
*/
services.mpris-proxy.enable = true; services.mpris-proxy.enable = true;
programs.ssh = { programs.ssh = {

View File

@@ -0,0 +1,27 @@
general {
lock_cmd = pidof hyprlock || hyprlock # avoid starting multiple hyprlock instances.
before_sleep_cmd = loginctl lock-session # lock before suspend.
after_sleep_cmd = hyprctl --instance 0 dispatch dpms on # to avoid having to press a key twice to turn on the display.
}
listener {
timeout = 150 # 2.5min.
on-timeout = brightnessctl -s set 10 # set monitor backlight to minimum, avoid 0 on OLED monitor.
on-resume = brightnessctl -r # monitor backlight restore.
}
listener {
timeout = 300 # 5min
on-timeout = loginctl lock-session # lock screen when timeout has passed
}
listener {
timeout = 330 # 5.5min
on-timeout = hyprctl --instance 0 dispatch dpms off # screen off when timeout has passed
on-resume = hyprctl --instance 0 dispatch dpms on && brightnessctl -r # screen on when activity is detected after timeout has fired.
}
listener {
timeout = 1800 # 30min
on-timeout = systemctl suspend # suspend pc
}

View File

@@ -0,0 +1,106 @@
# sample hyprlock.conf
# for more configuration options, refer https://wiki.hyprland.org/Hypr-Ecosystem/hyprlock
#
# rendered text in all widgets supports pango markup (e.g. <b> or <i> tags)
# ref. https://wiki.hyprland.org/Hypr-Ecosystem/hyprlock/#general-remarks
#
# shortcuts to clear password buffer: ESC, Ctrl+U, Ctrl+Backspace
#
# you can get started by copying this config to ~/.config/hypr/hyprlock.conf
#
$font = Monospace
general {
hide_cursor = false
}
# uncomment to enable fingerprint authentication
# auth {
# fingerprint {
# enabled = true
# ready_message = Scan fingerprint to unlock
# present_message = Scanning...
# retry_delay = 250 # in milliseconds
# }
# }
animations {
enabled = true
bezier = linear, 1, 1, 0, 0
animation = fadeIn, 1, 5, linear
animation = fadeOut, 1, 5, linear
animation = inputFieldDots, 1, 2, linear
}
background {
monitor =
path = screenshot
blur_passes = 3
}
input-field {
monitor =
size = 20%, 5%
outline_thickness = 3
inner_color = rgba(0, 0, 0, 0.0) # no fill
outer_color = rgba(33ccffee) rgba(00ff99ee) 45deg
check_color = rgba(00ff99ee) rgba(ff6633ee) 120deg
fail_color = rgba(ff6633ee) rgba(ff0066ee) 40deg
font_color = rgb(143, 143, 143)
fade_on_empty = false
rounding = 15
font_family = $font
placeholder_text = Input password...
fail_text = $PAMFAIL
# uncomment to use a letter instead of a dot to indicate the typed password
# dots_text_format = *
# dots_size = 0.4
dots_spacing = 0.3
# uncomment to use an input indicator that does not show the password length (similar to swaylock's input indicator)
# hide_input = true
position = 0, -20
halign = center
valign = center
}
# TIME
label {
monitor =
text = $TIME # ref. https://wiki.hyprland.org/Hypr-Ecosystem/hyprlock/#variable-substitution
font_size = 90
font_family = $font
position = -30, 0
halign = right
valign = top
}
# DATE
label {
monitor =
text = cmd[update:60000] date +"%A, %d %B %Y" # update every 60 seconds
font_size = 25
font_family = $font
position = -30, -150
halign = right
valign = top
}
label {
monitor =
text = $LAYOUT[en,ru]
font_size = 24
onclick = hyprctl switchxkblayout all next
position = 250, -20
halign = center
valign = center
}

View File

@@ -92,7 +92,7 @@
system.stateVersion = "23.05"; # Did you read the comment? system.stateVersion = "23.05"; # Did you read the comment?
sops = { sops = {
age.keyFile = "/home/nathan/.config/sops/age/keys.txt"; age.keyFile = "/var/lib/sops/age/keys.txt";
defaultSopsFile = ./secrets.yaml; defaultSopsFile = ./secrets.yaml;
defaultSopsFormat = "yaml"; defaultSopsFormat = "yaml";
@@ -134,7 +134,7 @@
homeconfig = { homeconfig = {
minimal = false; minimal = false;
hyprland.enable = true; hyprland.enable = true;
swaylock.enable = true; hyprlock.enable = true;
wal.enable = true; wal.enable = true;
mpd.enable = true; mpd.enable = true;
hyprpanel.enable = true; hyprpanel.enable = true;

View File

@@ -31,6 +31,10 @@
hardware = { hardware = {
graphics.enable = true; graphics.enable = true;
firmware = with pkgs; [
sof-firmware
];
nvidia = { nvidia = {
modesetting.enable = true; modesetting.enable = true;
powerManagement.enable = true; powerManagement.enable = true;
@@ -80,7 +84,7 @@
homeconfig = { homeconfig = {
minimal = false; minimal = false;
hyprland.enable = true; hyprland.enable = true;
swaylock.enable = true; hyprlock.enable = true;
wal.enable = true; wal.enable = true;
mpd.enable = true; mpd.enable = true;
hyprpanel.enable = true; hyprpanel.enable = true;
@@ -162,7 +166,7 @@
}; };
sops = { sops = {
age.keyFile = "/home/nathan/.config/sops/age/keys.txt"; age.keyFile = "/var/lib/sops/age/keys.txt";
defaultSopsFile = ./secrets.yaml; defaultSopsFile = ./secrets.yaml;
defaultSopsFormat = "yaml"; defaultSopsFormat = "yaml";
secrets."nathan/pass".neededForUsers = true; secrets."nathan/pass".neededForUsers = true;

View File

@@ -1,16 +1,16 @@
{ config, lib, pkgs, inputs, modulesPath, ... }: { { config, pkgs, inputs, modulesPath, ... }: {
imports = with inputs; [ imports = with inputs; [
disko.nixosModules.default disko.nixosModules.default
(import ./disko.nix { device = "/dev/sda"; }) (import ./disko.nix { device = "/dev/mmcblk0"; })
(modulesPath + "/installer/cd-dvd/installation-cd-minimal.nix") (modulesPath + "/installer/cd-dvd/installation-cd-minimal.nix")
#sops-nix.nixosModules.sops sops-nix.nixosModules.sops
#home-manager.nixosModules.default home-manager.nixosModules.default
]; ];
@@ -19,63 +19,75 @@
nixpkgs.hostPlatform = "x86_64-linux"; nixpkgs.hostPlatform = "x86_64-linux";
boot = { boot = {
#kernelPackages = pkgs.linuxKernel.packages.linux_6_6;
loader = { loader = {
systemd-boot.enable = true; systemd-boot.enable = true;
efi.canTouchEfiVariables = true; efi.canTouchEfiVariables = true;
}; };
}; };
sysconfig = {
/*sysconfig.opts = { remoteBuildClient = true;
sddm.enable = true; host = "live";
openssh.enable = false; graphical = true;
pipewire.enable = true;
hyprpanel.enable = true;
hyprland.enable = true;
git.enable = true;
nh.enable = true;
};*/
users.users."nathan" = {
isNormalUser = true;
initialPassword = "7567";
extraGroups = [ "wheel" ];
};
/*home-manager = {
backupFileExtension = "backup";
extraSpecialArgs = { inherit inputs; };
users = { users = {
"nathan" = lib.mkMerge [ nathan = {
inputs.nathan-home-manager extraGroups = [ "wheel" "networkmanager" ];
{ hashedPasswordFile = config.sops.secrets."nathan/pass".path;
config.homeconfig = { shell = pkgs.zsh;
hyprland.enable = true; home-manager = {
swaylock.enable = true; enable = true;
wal.enable = true; standalone = false;
mpd.enable = true; extraModules = [
hyprpanel.enable = true; {
calcurse.enable = true; homeconfig = {
rofi.enable = true; minimal = false;
firefox.enable = true; hyprland.enable = true;
}; hyprlock.enable = true;
} wal.enable = true;
]; mpd.enable = true;
hyprpanel.enable = true;
calcurse.enable = true;
rofi.enable = true;
firefox.enable = true;
git.enable = true;
nh.enable = true;
};
}
];
};
};
}; };
};*/
system.stateVersion = "24.11"; services = {
sddm.enable = true;
#openssh.enable = false;
pipewire.enable = true;
#kdePlasma6.enable = true;
netbird.enable = true;
#ollama.enable = true;
};
nix = { programs = {
nixPath = [ "nixpkgs=${inputs.nixpkgs}" ]; #steam.enable = true;
settings = { hyprpanel.enable = true;
experimental-features = [ "nix-command" "flakes" ]; hyprland.enable = true;
};
virtualization = {
wyoming = {
enable = false;
};
homeassistant = {
enable = false;
};
}; };
}; };
networking.hostName = "live"; system.stateVersion = "25.05";
fonts.packages = with pkgs; [ fira-code-nerdfont ]; fonts.packages = with pkgs; [ nerd-fonts.fira-code ];
}; };
} }

View File

@@ -1,45 +1,66 @@
{ {
device ? throw "Set this to your disk device, e.g. /dev/sda", device1 ? throw "Set this to your disk device, e.g. /dev/sda",
... ...
}: { }: {
disko.devices = { disko.devices = {
disk = { disk = {
main = { main = {
inherit device; device = device1;
type = "disk"; type = "disk";
content = { content = {
type = "gpt"; type = "gpt";
partitions = { partitions = {
boot = { boot = {
name = "boot"; name = "boot";
size = "1M"; size = "1M";
type = "EF02"; type = "EF02";
priority = 1; };
esp = {
name = "ESP";
size = "500M";
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
};
};
root = {
name = "root";
size = "100%";
content = {
type = "lvm_pv";
vg = "root_vg";
};
};
};
};
}; };
esp = {
name = "ESP";
size = "500M";
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
mountOptions = [ "unmask=0077" ];
};
};
root = {
name = "root";
size = "100%";
content = {
type = "filesystem";
format = "ext4";
mountpoint = "/";
};
};
};
}; };
}; lvm_vg = {
}; root_vg = {
type = "lvm_vg";
lvs = {
root = {
size = "100%FREE";
content = {
type = "btrfs";
extraArgs = ["-f"];
subvolumes = {
"/root" = {
mountpoint = "/";
};
"/nix" = {
mountOptions = ["subvol=nix" "noatime"];
mountpoint = "/nix";
};
};
};
};
};
};
};
}; };
} }

View File

@@ -1,4 +1,4 @@
{ config, lib, pkgs, inputs, ... }: { { config, pkgs, inputs, ... }: {
imports = [ imports = [
./hardware-configuration.nix ./hardware-configuration.nix
@@ -16,28 +16,46 @@
sysconfig = { sysconfig = {
remoteBuildClient = true; remoteBuildClient = true;
openssh.enable = true;
#pipewire.enable = true;
git.enable = true;
nh.enable = true;
netbird.enable = true;
};
home-manager = {
backupFileExtension = "backup";
extraSpecialArgs = { inherit inputs; };
sharedModules = [ inputs.sops-nix.homeManagerModules.sops ];
users = { users = {
"nathan" = lib.mkMerge [ nathan = {
{ hashedPasswordFile = config.sops.secrets."nathan/pass".path;
config.homeconfig = { shell = pkgs.zsh;
homeScripts.enable = false; sshKeys = [
minimal = true; "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAsU69CxfQk58CvItPN426h5Alnpb60SH37wet97Vb57 nathan@laptop"
mpd.enable = true; "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEnUhN2uHwAJF/SLRX3wlGRmfhV3zpP88JQAYB+gh8jW nathan@localhost"
}; ];
} extraGroups = [
inputs.nathan-home-manager "wheel"
]; "networkmanager"
"gpio"
"spi"
"audio"
"pulse"
"pulse-access"
];
home-manager = {
enable = true;
standalone = false;
extraModules = [
{
homeconfig = {
scripts.enable = false;
minimal = true;
mpd.enable = true;
git.enable = true;
nh.enable = true;
};
}
];
};
};
};
services = {
openssh.enable = true;
#pipewire.enable = true;
netbird.enable = true;
}; };
}; };
@@ -80,35 +98,20 @@
environment.shells = with pkgs; [ zsh ]; environment.shells = with pkgs; [ zsh ];
users = { users = {
defaultUserShell = pkgs.zsh;
groups.gpio = {}; groups.gpio = {};
users = {
nathan = {
isNormalUser = true;
description = "Nathan";
initialPassword = "7567";
extraGroups = [
"wheel"
"networkmanager"
"gpio"
"spi"
"audio"
"pulse"
"pulse-access"
];
};
};
}; };
services = { services = {
udev.extraRules = '' udev.extraRules = ''
SUBSYSTEM=="bcm2835-gpiomem", KERNEL=="gpiomem", GROUP="gpio",MODE="0660"
SUBSYSTEM=="gpio", KERNEL=="gpiochip*", ACTION=="add", RUN+="${pkgs.bash}/bin/bash -c 'chown root:gpio /sys/class/gpio/export /sys/class/gpio/unexport ; chmod 220 /sys/class/gpio/export /sys/class/gpio/unexport'"
SUBSYSTEM=="gpio", KERNEL=="gpio*", ACTION=="add",RUN+="${pkgs.bash}/bin/bash -c 'chown root:gpio /sys%p/active_low /sys%p/direction /sys%p/edge /sys%p/value ; chmod 660 /sys%p/active_low /sys%p/direction /sys%p/edge /sys%p/value'"
''; '';
pulseaudio = { pulseaudio = {
enable = true; enable = true;
extraConfig = '' extraConfig = ''
load-module module-native-protocol-tcp auth-ip-acl=127.0.0.1
''; '';
}; };
@@ -124,21 +127,13 @@
}; };
}; };
nix = {
nixPath = [ "nixpkgs=${inputs.nixpkgs}" ];
settings = {
experimental-features = [ "nix-command" "flakes" ];
};
};
sops = { sops = {
age.keyFile = "/home/nathan/.config/sops/age/keys.txt"; age.keyFile = "/var/lib/sops/age/keys.txt";
defaultSopsFile = ./secrets.yaml; defaultSopsFile = ./secrets.yaml;
defaultSopsFormat = "yaml"; defaultSopsFormat = "yaml";
}; };
fonts.packages = with pkgs; [ nerd-fonts.fira-code ]; fonts.packages = with pkgs; [ nerd-fonts.fira-code ];
sound.enable = true; sound.enable = true;

View File

@@ -125,7 +125,7 @@
hyprland.enable = false; hyprland.enable = false;
wal.enable = false; wal.enable = false;
hyprpanel.enable = false; hyprpanel.enable = false;
swaylock.enable = true; hyprlock.enable = false;
mpd.enable = true; mpd.enable = true;
calcurse.enable = true; calcurse.enable = true;
rofi.enable = true; rofi.enable = true;

View File

@@ -19,6 +19,7 @@
services.netbird = { services.netbird = {
enable = config.sysconfig.services.netbird.enable; enable = config.sysconfig.services.netbird.enable;
ui.enable = true;
/*package = let /*package = let
pkgs-us = import inputs.nixpkgs-us { pkgs-us = import inputs.nixpkgs-us {
system = "x86_64-linux"; system = "x86_64-linux";