Sorted some stuff in configuration

This commit is contained in:
Aleksandr Lebedev 2024-12-19 01:09:26 +01:00
parent 6599e23992
commit 5e05a1e5c1
36 changed files with 210 additions and 216 deletions

42
flake.lock generated
View file

@ -314,11 +314,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1734279981, "lastModified": 1734425854,
"narHash": "sha256-NdaCraHPp8iYMWzdXAt5Nv6sA3MUzlCiGiR586TCwo0=", "narHash": "sha256-nzE5UbJ41aPEKf8R2ZFYtLkqPmF7EIUbNEdHMBLg0Ig=",
"owner": "cachix", "owner": "cachix",
"repo": "git-hooks.nix", "repo": "git-hooks.nix",
"rev": "aa9f40c906904ebd83da78e7f328cd8aeaeae785", "rev": "0ddd26d0925f618c3a5d85a4fa5eb1e23a09491d",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -416,11 +416,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1734093295, "lastModified": 1734344598,
"narHash": "sha256-hSwgGpcZtdDsk1dnzA0xj5cNaHgN9A99hRF/mxMtwS4=", "narHash": "sha256-wNX3hsScqDdqKWOO87wETUEi7a/QlPVgpC/Lh5rFOuA=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "66c5d8b62818ec4c1edb3e941f55ef78df8141a8", "rev": "83ecd50915a09dca928971139d3a102377a8d242",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -524,11 +524,11 @@
"xdph": "xdph" "xdph": "xdph"
}, },
"locked": { "locked": {
"lastModified": 1734456362, "lastModified": 1734563337,
"narHash": "sha256-eb+OcQaSp7pcJxNe6wi52AiqLle820aD4Ejq10wmsjo=", "narHash": "sha256-0nOMDLi0aldc7VUfy/aBBL+4QLizccuSRG/MsBCrLQk=",
"owner": "hyprwm", "owner": "hyprwm",
"repo": "Hyprland", "repo": "Hyprland",
"rev": "5f1df55fcb45a72e92258113685aa9064f6ebf3e", "rev": "23e7d8f6a7d4e25c2dc6be33af07249570e66940",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -799,11 +799,11 @@
}, },
"nixpkgs_3": { "nixpkgs_3": {
"locked": { "locked": {
"lastModified": 1734119587, "lastModified": 1734424634,
"narHash": "sha256-AKU6qqskl0yf2+JdRdD0cfxX4b9x3KKV5RqA6wijmPM=", "narHash": "sha256-cHar1vqHOOyC7f1+tVycPoWTfKIaqkoe1Q6TnKzuti4=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "3566ab7246670a43abd2ffa913cc62dad9cdf7d5", "rev": "d3c42f187194c26d9f0309a8ecc469d6c878ce33",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -860,11 +860,11 @@
"treefmt-nix": "treefmt-nix" "treefmt-nix": "treefmt-nix"
}, },
"locked": { "locked": {
"lastModified": 1734472356, "lastModified": 1734563049,
"narHash": "sha256-RIoG3zXarfuHfzM/z/NPjoHHxl3sqYrtEatSLA1/bIk=", "narHash": "sha256-P/103iUx75XPXeX21M20kzttGaZJ6+c8xp9yo3fx3Zg=",
"owner": "nix-community", "owner": "nix-community",
"repo": "nixvim", "repo": "nixvim",
"rev": "4f1fe403b18c45614d6b81423038a34cff371244", "rev": "79a637d1962e725218ff46f5234cb3d5617ed36b",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -955,11 +955,11 @@
"nixpkgs": "nixpkgs_4" "nixpkgs": "nixpkgs_4"
}, },
"locked": { "locked": {
"lastModified": 1733965552, "lastModified": 1734546875,
"narHash": "sha256-GZ4YtqkfyTjJFVCub5yAFWsHknG1nS/zfk7MuHht4Fs=", "narHash": "sha256-6OvJbqQ6qPpNw3CA+W8Myo5aaLhIJY/nNFDk3zMXLfM=",
"owner": "Mic92", "owner": "Mic92",
"repo": "sops-nix", "repo": "sops-nix",
"rev": "2d73fc6ac4eba4b9a83d3cb8275096fbb7ab4004", "rev": "ed091321f4dd88afc28b5b4456e0a15bd8374b4d",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -985,11 +985,11 @@
"tinted-tmux": "tinted-tmux" "tinted-tmux": "tinted-tmux"
}, },
"locked": { "locked": {
"lastModified": 1734110168, "lastModified": 1734531336,
"narHash": "sha256-Q0eeLYn45ErXlqGQyXmLLHGe1mqnUiK0Y9wZRa1SNFI=", "narHash": "sha256-BWwJTAiWmZudUdUbyets7e3zQfjvZYtkU51blBnUBjw=",
"owner": "danth", "owner": "danth",
"repo": "stylix", "repo": "stylix",
"rev": "a9e3779949925ef22f5a215c5f49cf520dea30b1", "rev": "a2d66f25478103ac9b4adc6d6713794f7005221e",
"type": "github" "type": "github"
}, },
"original": { "original": {

190
flake.nix
View file

@ -1,20 +1,20 @@
{ {
description = "NixOS config"; description = "NixOS config";
inputs = { inputs = {
nixpkgs = { nixpkgs = {
url = "github:nixos/nixpkgs?ref=nixos-unstable"; url = "github:nixos/nixpkgs?ref=nixos-unstable";
}; };
nixvim = { nixvim = {
url = "github:nix-community/nixvim"; url = "github:nix-community/nixvim";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
hyprland.url = "github:hyprwm/Hyprland"; hyprland.url = "github:hyprwm/Hyprland";
stylix.url = "github:danth/stylix"; stylix.url = "github:danth/stylix";
#nix-flatpak.url = "github:GermanBread/declarative-flatpak/stable-v3"; #nix-flatpak.url = "github:GermanBread/declarative-flatpak/stable-v3";
apple-silicon-support.url = "github:tpwrules/nixos-apple-silicon"; apple-silicon-support.url = "github:tpwrules/nixos-apple-silicon";
#nur.url = "github:nix-community/NUR"; #nur.url = "github:nix-community/NUR";
sops-nix.url = "github:Mic92/sops-nix"; sops-nix.url = "github:Mic92/sops-nix";
home-manager = { home-manager = {
@ -22,9 +22,9 @@
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
disko = { disko = {
url = "github:nix-community/disko"; url = "github:nix-community/disko";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
nixos-facter-modules.url = "github:numtide/nixos-facter-modules"; nixos-facter-modules.url = "github:numtide/nixos-facter-modules";
@ -32,96 +32,92 @@
}; };
outputs = { self, nixpkgs, stylix, nixvim, ... }@inputs: outputs = { self, nixpkgs, stylix, nixvim, ... }@inputs:
let let
#systems = ["aarch64-linux" "x86_64-linux" ]; #systems = ["aarch64-linux" "x86_64-linux" ];
#forAllSystems = nixpkgs.lib.genAttrs systems; #forAllSystems = nixpkgs.lib.genAttrs systems;
#pkgs = import nixpkgs { #pkgs = import nixpkgs {
# inherit system; # inherit system;
# config = { # config = {
# allowUnfree = true; # allowUnfree = true;
# }; # };
#}; #};
arm = "aarch64-linux"; arm = "aarch64-linux";
x86 = "x86_64-linux"; x86 = "x86_64-linux";
username = "kylekrein";
general-modules = [ general-modules = [
inputs.sops-nix.nixosModules.sops inputs.sops-nix.nixosModules.sops
inputs.home-manager.nixosModules.default inputs.home-manager.nixosModules.default
stylix.nixosModules.stylix stylix.nixosModules.stylix
inputs.nixos-facter-modules.nixosModules.facter inputs.nixos-facter-modules.nixosModules.facter
]; ];
first-nixos-install = "1729112485"; #stat -c %W / first-nixos-install = "1729112485"; #stat -c %W /
in in
{ {
nixosConfigurations = { nixosConfigurations = {
"${username}-homepc" = nixpkgs.lib.nixosSystem { "kylekrein-homepc" = nixpkgs.lib.nixosSystem {
specialArgs = { specialArgs = {
hwconfig = { hwconfig = {
hostname = "${username}-homepc"; hostname = "kylekrein-homepc";
isLaptop = false; isLaptop = false;
system = x86; system = x86;
useImpermanence = true; useImpermanence = true;
}; };
inherit username; inherit first-nixos-install;
inherit first-nixos-install; inherit inputs; };
inherit inputs; };
system = x86; system = x86;
#pkgs = import nixpkgs { #pkgs = import nixpkgs {
# system = x86; # system = x86;
# config = { # config = {
# allowBroken = true; # allowBroken = true;
# allowUnfree = true; # allowUnfree = true;
# }; # };
# }; # };
modules = [ modules = [
inputs.impermanence.nixosModules.impermanence inputs.impermanence.nixosModules.impermanence
inputs.disko.nixosModules.default inputs.disko.nixosModules.default
(import ./nixos/modules/disko/impermanence-disko.nix { device = "/dev/nvme0n1"; } ) (import ./nixos/modules/disko/impermanence-disko.nix { device = "/dev/nvme0n1"; } )
./nixos/modules/impermanence ./nixos/modules/impermanence
#nur.nixosModules.nur #nur.nixosModules.nur
./nixos/configuration.nix ./nixos/configuration.nix
./nixos/nvidia.nix ./nixos/hardware/nvidia.nix
#./nixos/homepc-hardware-conf.nix #./nixos/homepc-hardware-conf.nix
./nixos/libvirt.nix #nix-flatpak.nixosModules.default
#nix-flatpak.nixosModules.default ] ++ general-modules;
] ++ general-modules; };
}; "kylekrein-mac" = nixpkgs.lib.nixosSystem {
"${username}-mac" = nixpkgs.lib.nixosSystem { specialArgs = {
specialArgs = { hwconfig = {
hwconfig = { hostname = "kylekrein-mac";
hostname = "${username}-mac"; isLaptop = true;
isLaptop = true; system = arm;
system = arm; useImpermanence = true;
useImpermanence = true; };
}; inherit first-nixos-install;
inherit username; inherit inputs; };
inherit first-nixos-install;
inherit inputs; };
system = arm; system = arm;
#pkgs = import nixpkgs { #pkgs = import nixpkgs {
# system = arm; # system = arm;
# overlays = [ # overlays = [
# (import ./nixos/macos/widevine.nix) # (import ./nixos/macos/widevine.nix)
# ]; # ];
# config = { # config = {
# allowBroken = true; # allowBroken = true;
# allowUnfree = true; # allowUnfree = true;
# }; # };
# }; # };
modules = [ modules = [
inputs.impermanence.nixosModules.impermanence inputs.impermanence.nixosModules.impermanence
./nixos/configuration.nix ./nixos/configuration.nix
./nixos/modules/impermanence ./nixos/modules/impermanence
inputs.apple-silicon-support.nixosModules.default inputs.apple-silicon-support.nixosModules.default
./nixos/mac-hardware-conf.nix ./nixos/hosts/kylekrein-mac/mac-hardware-conf.nix
./nixos/macos/configuration.nix ./nixos/hardware/macos/configuration.nix
] ++ general-modules; ] ++ general-modules;
}; };
};
}; };
};
} }

View file

@ -2,13 +2,13 @@
# your system. Help is available in the configuration.nix(5) man page # your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running nixos-help). # and in the NixOS manual (accessible by running nixos-help).
{ config, lib, pkgs, stylix, hwconfig, first-nixos-install, username, nixvim, inputs, ... }: { config, lib, pkgs, stylix, hwconfig, first-nixos-install, nixvim, inputs, ... }:
{ {
imports = imports =
[ # Include the results of the hardware scan. [ # Include the results of the hardware scan.
inputs.home-manager.nixosModules.default inputs.home-manager.nixosModules.default
inputs.nixvim.nixosModules.nixvim inputs.nixvim.nixosModules.nixvim
./firefox.nix ./modules/firefox
./modules/services/autoupgrade ./modules/services/autoupgrade
./modules/sops ./modules/sops
./hosts/${hwconfig.hostname} ./hosts/${hwconfig.hostname}
@ -16,9 +16,9 @@
facter.reportPath = ./hosts/${hwconfig.hostname}/facter.json; facter.reportPath = ./hosts/${hwconfig.hostname}/facter.json;
kylekrein.services.autoUpgrade = { kylekrein.services.autoUpgrade = {
enable = true; enable = true;
pushUpdates = if hwconfig.hostname == "${username}-homepc" then true else false; pushUpdates = if hwconfig.hostname == "kylekrein-homepc" then true else false;
configDir = "/home/${username}/nixos-config"; configDir = "/etc/nixos-config";
user = username; user = "root";
}; };
boot = { boot = {
@ -27,7 +27,7 @@
}; };
loader = { loader = {
systemd-boot.enable = true; systemd-boot.enable = true;
efi.canTouchEfiVariables = if hwconfig.hostname != "${username}-mac" then true else false; efi.canTouchEfiVariables = if hwconfig.hostname != "kylekrein-mac" then true else false;
}; };
# Enable "Silent Boot" # Enable "Silent Boot"
consoleLogLevel = 0; consoleLogLevel = 0;
@ -93,19 +93,7 @@
# https://discourse.nixos.org/t/how-to-disable-root-user-account-in-configuration-nix/13235/3 # https://discourse.nixos.org/t/how-to-disable-root-user-account-in-configuration-nix/13235/3
hashedPassword = "!"; # disable root logins, nothing hashes to ! hashedPassword = "!"; # disable root logins, nothing hashes to !
}; };
${username} = { };
isNormalUser = true;
description = "Aleksandr Lebedev";
extraGroups = [ "networkmanager" "wheel" ];
initialPassword = "1234";
packages = with pkgs; [];
};
};
#test = {
# isNormalUser = true;
# initialPassword = "1234";
# extraGroups = [ "networkmanager" ];
#};
}; };
qt = { qt = {
@ -265,7 +253,7 @@
enable = true; enable = true;
clean.enable = true; clean.enable = true;
clean.extraArgs = "--keep-since 4d --keep 3"; clean.extraArgs = "--keep-since 4d --keep 3";
flake = "/home/${username}/nixos-config"; flake = "/etc/nixos-config";
}; };
#https://discourse.nixos.org/t/dolphin-does-not-have-mime-associations/48985/3 #https://discourse.nixos.org/t/dolphin-does-not-have-mime-associations/48985/3
# This fixes the unpopulated MIME menus # This fixes the unpopulated MIME menus
@ -332,14 +320,11 @@
}; };
home-manager = { home-manager = {
extraSpecialArgs = {inherit pkgs; inherit hwconfig; inherit username; inherit first-nixos-install; inherit nixvim; inherit inputs;}; extraSpecialArgs = {inherit pkgs; inherit hwconfig; inherit first-nixos-install; inherit nixvim; inherit inputs;};
users = {
"${username}" = import ./home.nix;
};
}; };
stylix = { stylix = {
enable = true; enable = true;
image = "${./hyprland/wallpaper.jpg}"; image = "${./modules/hyprland/wallpaper.jpg}";
autoEnable = true; autoEnable = true;
opacity = { opacity = {
desktop = 0.5; desktop = 0.5;

View file

@ -1,2 +0,0 @@
{}:
{}

View file

@ -13,11 +13,12 @@
{ {
imports = imports =
[ [
./hyprland/hyprland.nix ./modules/hyprland
./nixvim ./modules/nixvim
./fastfetch ./modules/fastfetch
./homes/${username}
#"${if hostname != "nixosbtw" then ./macos/homemac.nix else ./empty.nix }" #"${if hostname != "nixosbtw" then ./macos/homemac.nix else ./empty.nix }"
] ++ (if hwconfig.useImpermanence then [ ./modules/impermanence/home.nix ] else []); ] ++ (if hwconfig.useImpermanence then [ (import ./modules/impermanence/home.nix { inherit username; inherit inputs; } ) ] else []);
# Home Manager needs a bit of information about you and the paths it should # Home Manager needs a bit of information about you and the paths it should
# manage. # manage.
home.username = username; home.username = username;
@ -101,45 +102,8 @@
#Also available: Catppuccin-Frappe Catppuccin-Latte Catppuccin-Macchiato Catppuccin-Mocha #Also available: Catppuccin-Frappe Catppuccin-Latte Catppuccin-Macchiato Catppuccin-Mocha
# See all available kitty themes at: https://github.com/kovidgoyal/kitty-themes/blob/46d9dfe230f315a6a0c62f4687f6b3da20fd05e4/themes.json # See all available kitty themes at: https://github.com/kovidgoyal/kitty-themes/blob/46d9dfe230f315a6a0c62f4687f6b3da20fd05e4/themes.json
}; };
programs.git = {
enable = true;
userName = "Aleksandr Lebedev";
userEmail = "alex.lebedev2003@icloud.com";
extraConfig = {
credential.helper = "manager";#"${pkgs.git.override { withLibsecret = true; }}/bin/git-credential-libsecret";
credential."https://github.com".username = "KyleKrein";
credential.credentialStore = "plaintext";
};
};
#gtk = {
# enable = true;
# cursorTheme.name = "Bibata-Modern-Ice";
# cursorTheme.package = pkgs.bibata-cursors;
# theme.package = pkgs.adw-gtk3;
# theme.name = "adw-gtk3";
# iconTheme.package = gruvboxPlus;
# iconTheme.name = "GruvboxPlus";
# };
#programs.firefox = {
#enable = true;
#profiles."kylekrein".extensions = with nur.repos.rycee.firefox-addons; [
# ublock-origin
#darkreader
#videospeed
#auto-tab-discard
#privacy-badger
#sponsorblock
#];
#profiles.default = {
# id = 0;
# name = "Default";
# isDefault = true;
#};
#};
# Home Manager is pretty good at managing dotfiles. The primary way to manage # Home Manager is pretty good at managing dotfiles. The primary way to manage
# plain files is through 'home.file'. # plain files is through 'home.file'.
home.file = { home.file = {

View file

@ -0,0 +1,14 @@
{ username, ... }:
{
programs.git = {
enable = true;
userName = "Aleksandr Lebedev";
userEmail = "alex.lebedev2003@icloud.com";
extraConfig = {
credential.helper = "manager";#"${pkgs.git.override { withLibsecret = true; }}/bin/git-credential-libsecret";
credential."https://github.com".username = "KyleKrein";
credential.credentialStore = "plaintext";
};
};
}

View file

@ -1,4 +1,10 @@
{ pkgs, lib, hwconfig, inputs, ... }: { pkgs, lib, hwconfig, inputs, ... }:
{ {
imports = [
../../modules/libvirt
../../users/kylekrein
(import ../../modules/libvirt/user.nix { username = "kylekrein"; })
];
systemd.network.wait-online.enable = lib.mkForce false; systemd.network.wait-online.enable = lib.mkForce false;
} }

View file

@ -0,0 +1,6 @@
{ pkgs, lib, hwconfig, ... }:
{
imports = [
../../users/kylekrein
];
}

View file

Before

Width:  |  Height:  |  Size: 78 KiB

After

Width:  |  Height:  |  Size: 78 KiB

Before After
Before After

View file

@ -0,0 +1,6 @@
{ ... }:
{
imports = [
./hyprland.nix
];
}

View file

@ -13,7 +13,7 @@ in
enable = true; enable = true;
xwayland.enable = true; xwayland.enable = true;
settings = { settings = {
monitor = if hwconfig.hostname == "${username}-homepc" then [ monitor = if hwconfig.hostname == "kylekrein-homepc" then [
"DP-1,2560x1440@75,1600x0,1.6" "DP-1,2560x1440@75,1600x0,1.6"
"DP-3,2560x1440@75,0x0,1.6" "DP-3,2560x1440@75,0x0,1.6"
] else [",highres,auto,1.6"] ] else [",highres,auto,1.6"]

View file

Before

Width:  |  Height:  |  Size: 78 KiB

After

Width:  |  Height:  |  Size: 78 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 4.2 MiB

After

Width:  |  Height:  |  Size: 4.2 MiB

Before After
Before After

View file

@ -1,4 +1,4 @@
{ lib, username, ... }: { lib, ... }:
{ {
fileSystems."/persist".neededForBoot = true; fileSystems."/persist".neededForBoot = true;
@ -20,7 +20,7 @@
}; };
systemd.tmpfiles.rules = [ systemd.tmpfiles.rules = [
"d /persist/home/ 0777 root root -" # /persist/home created, owned by root "d /persist/home/ 0777 root root -" # /persist/home created, owned by root
"d /persist/home/${username} 0700 ${username} users -" # /persist/home/<user> created, owned by that user #"d /persist/home/${username} 0700 ${username} users -" # /persist/home/<user> created, owned by that user
#"d /persist/nixos-config 0700 ${username} users -" #"d /persist/nixos-config 0700 ${username} users -"
]; ];

View file

@ -1,4 +1,4 @@
{ pkgs, username, ... }: { pkgs, ... }:
{ {
virtualisation = { virtualisation = {
libvirtd = { libvirtd = {
@ -13,8 +13,6 @@
spiceUSBRedirection.enable = true; spiceUSBRedirection.enable = true;
}; };
users.users.${username}.extraGroups = [ "libvirtd" ];
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
spice spice
spice-gtk spice-gtk
@ -24,13 +22,4 @@
#win-spice #win-spice
]; ];
programs.virt-manager.enable = true; programs.virt-manager.enable = true;
home-manager.users.${username} = {
dconf.settings = {
"org/virt-manager/virt-manager/connections" = {
autoconnect = [ "qemu:///system" ];
uris = [ "qemu:///system" ];
};
};
};
} }

View file

@ -0,0 +1,12 @@
{ username, ... }:
{
users.users.${username}.extraGroups = [ "libvirtd" ];
home-manager.users.${username} = {
dconf.settings = {
"org/virt-manager/virt-manager/connections" = {
autoconnect = [ "qemu:///system" ];
uris = [ "qemu:///system" ];
};
};
};
}

View file

@ -1,4 +1,4 @@
{ config, pkgs, inputs, username, lib, hwconfig, ... }: { config, pkgs, inputs, lib, hwconfig, ... }:
let let
keyPath = (if hwconfig.useImpermanence then "/persist/sops/age/keys.txt" else "/var/lib/sops/age/keys.txt"); keyPath = (if hwconfig.useImpermanence then "/persist/sops/age/keys.txt" else "/var/lib/sops/age/keys.txt");
in in
@ -9,14 +9,4 @@ in
sops.age.keyFile = keyPath; sops.age.keyFile = keyPath;
# This will generate a new key if the key specified above does not exist # This will generate a new key if the key specified above does not exist
sops.age.generateKey = true; sops.age.generateKey = true;
sops.secrets = {
"users/kylekrein" = {
neededForUsers = true;
};
};
users.users.${username} = {
hashedPasswordFile = config.sops.secrets."users/${username}".path;
initialPassword = lib.mkForce null;
};
} }

View file

@ -0,0 +1,28 @@
{ pkgs, config, lib, hwconfig, inputs, stylix, first-nixos-install, ... }:
let username = "kylekrein";
in
{
imports = [
];
users.users.${username} = {
isNormalUser = true;
description = "Aleksandr Lebedev";
extraGroups = [ "networkmanager" "wheel" ];
#initialPassword = "1234";
hashedPasswordFile = config.sops.secrets."users/${username}".path;
packages = with pkgs; [];
};
sops.secrets = {
"users/${username}" = {
neededForUsers = true;
};
};
home-manager.users."${username}" = import ../../home.nix { inherit username; inherit inputs; inherit stylix; inherit first-nixos-install; inherit hwconfig; inherit config; inherit pkgs; };
kylekrein.services.autoUpgrade = {
configDir = lib.mkForce "/home/${username}/nixos-config";
user = lib.mkForce username;
};
programs.nh.flake = lib.mkForce "/home/${username}/nixos-config";
systemd.tmpfiles.rules = (if hwconfig.useImpermanence then ["d /persist/home/${username} 0700 ${username} users -"] else []); # /persist/home/<user> created, owned by that user
}