i've locked myself out

This commit is contained in:
unexplrd
2025-03-02 21:30:47 +02:00
parent f14623365c
commit 604cd9315d
10 changed files with 75 additions and 20 deletions

8
flake.lock generated
View File

@ -544,11 +544,11 @@
"mysecrets": { "mysecrets": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1740938097, "lastModified": 1740942589,
"narHash": "sha256-3wKuEorlAQPRjF03q2co7/mUIAMoqSfDr3Wf0Ipl/+s=", "narHash": "sha256-ND33Zox6hj7DrcjtIEMuAZ7zwToy1iC3hmRjiWQclK4=",
"ref": "refs/heads/main", "ref": "refs/heads/main",
"rev": "7a7a965f15ec332625a9a21b5229e076db21f224", "rev": "764a6753bc3e24df936060f7314e9da9a29b06e5",
"revCount": 5, "revCount": 7,
"type": "git", "type": "git",
"url": "ssh://gitea@gitea.linerds.us/unexplrd/nix-secrets" "url": "ssh://gitea@gitea.linerds.us/unexplrd/nix-secrets"
}, },

View File

@ -13,6 +13,7 @@
./programs.nix ./programs.nix
./stylix.nix ./stylix.nix
./users.nix ./users.nix
./sops.nix
]; ];
desktop = { desktop = {

View File

@ -69,6 +69,10 @@
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
services.thermald.enable = true;
services.upower.enable = true;
powerManagement.powertop.enable = true;
services.udev.extraHwdb = '' services.udev.extraHwdb = ''
evdev:input:b0011v0001p0001eAB83* evdev:input:b0011v0001p0001eAB83*
KEYBOARD_KEY_d5=sysrq KEYBOARD_KEY_d5=sysrq

24
hosts/sarien/sops.nix Normal file
View File

@ -0,0 +1,24 @@
{inputs, ...}: let
secretsPath = builtins.toString inputs.mysecrets;
in {
imports = [
inputs.sops-nix.nixosModules.sops
];
sops = {
age = {
sshKeyPaths = ["/etc/ssh/ssh_host_ed25519_key"];
keyFile = "/var/lib/sops-nix/key.txt";
generateKey = true;
};
defaultSopsFile = "${secretsPath}/secrets.yaml";
secrets = {
"user-password-hashed" = {};
"ssh-private-sarien-user" = {
path = "/home/user/.ssh/id_ed25519";
mode = "0400";
owner = "user";
};
};
};
}

View File

@ -12,7 +12,7 @@
]; ];
stylix = { stylix = {
enable = true; enable = true;
base16Scheme = "${pkgs.base16-schemes}/share/themes/onedark.yaml"; base16Scheme = "${pkgs.base16-schemes}/share/themes/tomorrow-night.yaml";
polarity = "dark"; polarity = "dark";
cursor = { cursor = {
package = pkgs.google-cursor; package = pkgs.google-cursor;
@ -20,10 +20,10 @@
size = 24; size = 24;
}; };
image = builtins.fetchurl { image = builtins.fetchurl {
url = "https://w.wallhaven.cc/full/57/wallhaven-573e81.png"; url = "https://w.wallhaven.cc/full/9m/wallhaven-9mwzwk.jpg";
name = "wallhaven-573e81"; name = "wallhaven-9mwzwk";
sha256 = "1ygsmmzk6icnvkr18s2r3mqh2kmigwb1424chji730cjhm8zc3cx"; sha256 = "0pj2k30mfhqr02dzdj40z62awmy58s5gg5mm4xzxiialclbd5n8d";
}; # ../../wallpapers/wallhaven-jxmo1y.jpg; };
opacity.terminal = 0.9; opacity.terminal = 0.9;
fonts = { fonts = {
sizes = { sizes = {

View File

@ -1,15 +1,24 @@
{pkgs, ...}: { {
inputs,
config,
pkgs,
...
}: let
sopSec = config.sops.secrets;
secrets = inputs.mysecrets;
in {
nix.settings.trusted-users = ["user"]; nix.settings.trusted-users = ["user"];
users.mutableUsers = false;
users.users = { users.users = {
user = { user = {
hashedPasswordFile = sopSec."user-password-hashed".path;
isNormalUser = true; isNormalUser = true;
extraGroups = ["wheel" "video" "libvirtd" "dialout"]; extraGroups = ["wheel" "video" "libvirtd" "dialout"];
shell = pkgs.fish; shell = pkgs.fish;
openssh.authorizedKeys.keyFiles = [
"${secrets}/ssh/id_ed25519_sarien_user.pub"
"${secrets}/ssh/id_ed25519_eldrid_user.pub"
];
}; };
# work = {
# isNormalUser = true;
# extraGroups = ["video"];
# shell = pkgs.nushell;
# };
}; };
} }

View File

@ -4,6 +4,7 @@
]; ];
services.flatpak = { services.flatpak = {
enable = true; enable = true;
uninstallUnmanaged = true;
remotes = [ remotes = [
{ {
name = "flathub"; name = "flathub";

View File

@ -1,5 +1,6 @@
{inputs, ...}: { {inputs, ...}: {
imports = with inputs; [ imports = with inputs; [
nix-index-database.hmModules.nix-index
self.homeModules.desktop self.homeModules.desktop
self.homeModules.programs self.homeModules.programs
./programs.nix ./programs.nix

View File

@ -7,6 +7,7 @@
console.yazi.enable = true; console.yazi.enable = true;
stylix.targets.fzf.enable = false;
programs = { programs = {
bat.enable = true; bat.enable = true;
btop = { btop = {
@ -15,7 +16,13 @@
}; };
eza.enable = true; eza.enable = true;
fd.enable = true; fd.enable = true;
fzf.enable = true; fzf = {
enable = true;
defaultOptions = ["--color=16"];
};
pay-respects.enable = true;
nix-index.enable = true;
nix-index-database.comma.enable = true;
gitui.enable = true; gitui.enable = true;
git = { git = {
enable = true; enable = true;
@ -38,6 +45,7 @@
editor = { editor = {
helix.enable = true; helix.enable = true;
neve.enable = true; neve.enable = true;
zed.enable = true;
}; };
home.packages = with pkgs; [ home.packages = with pkgs; [
@ -45,14 +53,16 @@
flatpak # flatpak cli flatpak # flatpak cli
trashy # trash cli trashy # trash cli
procs # ps in rust procs # ps in rust
ouch # archive manager in runt
dust # du in rust dust # du in rust
fend # calc in rust fend # calc in rust
moar # better pager
tree # tree util tree # tree util
rbw # bitwarden cli in rust rbw # bitwarden cli in rust
zip # zip util pinentry-qt # pinentry for rbw
vial # qmk keyboard configuring app vial # qmk keyboard configuring app
unzip # unzip util
waycheck # check wayland protocols waycheck # check wayland protocols
virt-manager # libvirt gui virt-manager # libvirt gui
]; ];
systemd.user.settings.Manager.DefaultEnvironment.PAGER = "moar";
} }

View File

@ -37,7 +37,10 @@ in {
settings = { settings = {
input = { input = {
kb_layout = "us,ua"; kb_layout = "us,ua";
resolve_binds_by_sym = 0; resolve_binds_by_sym =
if hostname == "dunamis"
then 1
else 0;
repeat_rate = 50; repeat_rate = 50;
repeat_delay = 300; repeat_delay = 300;
# mouse # mouse
@ -157,6 +160,8 @@ in {
scroller = { scroller = {
column_widths = "onethird onehalf twothirds one"; column_widths = "onethird onehalf twothirds one";
window_heights = "onethird onehalf twothirds one"; window_heights = "onethird onehalf twothirds one";
gesture_scroll_fingers = 3;
gesture_overview_fingers = 3;
jump_labels_font = "${config.stylix.fonts.sansSerif.name}"; jump_labels_font = "${config.stylix.fonts.sansSerif.name}";
jump_labels_color = "0xff${config.lib.stylix.colors.base0A}"; jump_labels_color = "0xff${config.lib.stylix.colors.base0A}";
}; };
@ -364,7 +369,7 @@ in {
"$mod ALT, mouse:272, resizewindow" "$mod ALT, mouse:272, resizewindow"
]; ];
gestures = { gestures = {
workspace_swipe = true; workspace_swipe = false;
workspace_swipe_fingers = 3; workspace_swipe_fingers = 3;
workspace_swipe_distance = 300; workspace_swipe_distance = 300;
}; };