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:
- age:
- *laptop
- path_regex: pi4/secrets.yaml$
key_groups:
- age:
- *laptop
- path_regex: nathan/secrets.yaml$
key_groups:
- age:

View File

@@ -8,7 +8,7 @@
./terminal
./rofi
./pywal
./swaylock
./hyprlock
./calcurse
./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;
defaultSopsFormat = "yaml";
};
/*
nix = {
nix = lib.mkIf config.homeconfig.standalone.enable {
nixPath = [ "nixpkgs=${inputs.nixpkgs}" ];
settings = {
experimental-features = [ "nix-command" "flakes" ];
builders = ''
ssh://remote-builder@blunkall.us
'';
builders = "ssh://builder x86_64-linux,aarch64-linux /run/secrets/remoteBuildKey 1 1 nixos-test,benchmark,big-parallel,kvm - -";
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;
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?
sops = {
age.keyFile = "/home/nathan/.config/sops/age/keys.txt";
age.keyFile = "/var/lib/sops/age/keys.txt";
defaultSopsFile = ./secrets.yaml;
defaultSopsFormat = "yaml";
@@ -134,7 +134,7 @@
homeconfig = {
minimal = false;
hyprland.enable = true;
swaylock.enable = true;
hyprlock.enable = true;
wal.enable = true;
mpd.enable = true;
hyprpanel.enable = true;

View File

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

View File

@@ -1,16 +1,16 @@
{ config, lib, pkgs, inputs, modulesPath, ... }: {
{ config, pkgs, inputs, modulesPath, ... }: {
imports = with inputs; [
disko.nixosModules.default
(import ./disko.nix { device = "/dev/sda"; })
(import ./disko.nix { device = "/dev/mmcblk0"; })
(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";
boot = {
#kernelPackages = pkgs.linuxKernel.packages.linux_6_6;
loader = {
systemd-boot.enable = true;
efi.canTouchEfiVariables = true;
};
};
/*sysconfig.opts = {
sddm.enable = true;
openssh.enable = false;
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; };
sysconfig = {
remoteBuildClient = true;
host = "live";
graphical = true;
users = {
"nathan" = lib.mkMerge [
inputs.nathan-home-manager
{
config.homeconfig = {
hyprland.enable = true;
swaylock.enable = true;
wal.enable = true;
mpd.enable = true;
hyprpanel.enable = true;
calcurse.enable = true;
rofi.enable = true;
firefox.enable = true;
};
}
];
nathan = {
extraGroups = [ "wheel" "networkmanager" ];
hashedPasswordFile = config.sops.secrets."nathan/pass".path;
shell = pkgs.zsh;
home-manager = {
enable = true;
standalone = false;
extraModules = [
{
homeconfig = {
minimal = false;
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 = {
nixPath = [ "nixpkgs=${inputs.nixpkgs}" ];
settings = {
experimental-features = [ "nix-command" "flakes" ];
programs = {
#steam.enable = true;
hyprpanel.enable = true;
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 = {
disk = {
main = {
inherit device;
type = "disk";
content = {
type = "gpt";
partitions = {
boot = {
name = "boot";
size = "1M";
type = "EF02";
priority = 1;
disk = {
main = {
device = device1;
type = "disk";
content = {
type = "gpt";
partitions = {
boot = {
name = "boot";
size = "1M";
type = "EF02";
};
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 = [
./hardware-configuration.nix
@@ -16,28 +16,46 @@
sysconfig = {
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 = {
"nathan" = lib.mkMerge [
{
config.homeconfig = {
homeScripts.enable = false;
minimal = true;
mpd.enable = true;
};
}
inputs.nathan-home-manager
];
nathan = {
hashedPasswordFile = config.sops.secrets."nathan/pass".path;
shell = pkgs.zsh;
sshKeys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAsU69CxfQk58CvItPN426h5Alnpb60SH37wet97Vb57 nathan@laptop"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEnUhN2uHwAJF/SLRX3wlGRmfhV3zpP88JQAYB+gh8jW nathan@localhost"
];
extraGroups = [
"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 ];
users = {
defaultUserShell = pkgs.zsh;
groups.gpio = {};
users = {
nathan = {
isNormalUser = true;
description = "Nathan";
initialPassword = "7567";
extraGroups = [
"wheel"
"networkmanager"
"gpio"
"spi"
"audio"
"pulse"
"pulse-access"
];
};
};
};
services = {
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 = {
enable = true;
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 = {
age.keyFile = "/home/nathan/.config/sops/age/keys.txt";
age.keyFile = "/var/lib/sops/age/keys.txt";
defaultSopsFile = ./secrets.yaml;
defaultSopsFormat = "yaml";
};
fonts.packages = with pkgs; [ nerd-fonts.fira-code ];
sound.enable = true;

View File

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

View File

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