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

View file

@ -2,13 +2,13 @@
# your system. Help is available in the configuration.nix(5) man page
# 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 =
[ # Include the results of the hardware scan.
inputs.home-manager.nixosModules.default
inputs.nixvim.nixosModules.nixvim
./firefox.nix
./modules/firefox
./modules/services/autoupgrade
./modules/sops
./hosts/${hwconfig.hostname}
@ -16,9 +16,9 @@
facter.reportPath = ./hosts/${hwconfig.hostname}/facter.json;
kylekrein.services.autoUpgrade = {
enable = true;
pushUpdates = if hwconfig.hostname == "${username}-homepc" then true else false;
configDir = "/home/${username}/nixos-config";
user = username;
pushUpdates = if hwconfig.hostname == "kylekrein-homepc" then true else false;
configDir = "/etc/nixos-config";
user = "root";
};
boot = {
@ -27,7 +27,7 @@
};
loader = {
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"
consoleLogLevel = 0;
@ -93,19 +93,7 @@
# https://discourse.nixos.org/t/how-to-disable-root-user-account-in-configuration-nix/13235/3
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 = {
@ -265,7 +253,7 @@
enable = true;
clean.enable = true;
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
# This fixes the unpopulated MIME menus
@ -332,14 +320,11 @@
};
home-manager = {
extraSpecialArgs = {inherit pkgs; inherit hwconfig; inherit username; inherit first-nixos-install; inherit nixvim; inherit inputs;};
users = {
"${username}" = import ./home.nix;
};
extraSpecialArgs = {inherit pkgs; inherit hwconfig; inherit first-nixos-install; inherit nixvim; inherit inputs;};
};
stylix = {
enable = true;
image = "${./hyprland/wallpaper.jpg}";
image = "${./modules/hyprland/wallpaper.jpg}";
autoEnable = true;
opacity = {
desktop = 0.5;

View file

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

View file

@ -13,11 +13,12 @@
{
imports =
[
./hyprland/hyprland.nix
./nixvim
./fastfetch
./modules/hyprland
./modules/nixvim
./modules/fastfetch
./homes/${username}
#"${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
# manage.
home.username = username;
@ -101,44 +102,7 @@
#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
};
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
# plain files is through '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, ... }:
{
imports = [
../../modules/libvirt
../../users/kylekrein
(import ../../modules/libvirt/user.nix { username = "kylekrein"; })
];
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;
xwayland.enable = true;
settings = {
monitor = if hwconfig.hostname == "${username}-homepc" then [
monitor = if hwconfig.hostname == "kylekrein-homepc" then [
"DP-1,2560x1440@75,1600x0,1.6"
"DP-3,2560x1440@75,0x0,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;
@ -20,7 +20,7 @@
};
systemd.tmpfiles.rules = [
"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 -"
];

View file

@ -1,4 +1,4 @@
{ pkgs, username, ... }:
{ pkgs, ... }:
{
virtualisation = {
libvirtd = {
@ -13,8 +13,6 @@
spiceUSBRedirection.enable = true;
};
users.users.${username}.extraGroups = [ "libvirtd" ];
environment.systemPackages = with pkgs; [
spice
spice-gtk
@ -24,13 +22,4 @@
#win-spice
];
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
keyPath = (if hwconfig.useImpermanence then "/persist/sops/age/keys.txt" else "/var/lib/sops/age/keys.txt");
in
@ -9,14 +9,4 @@ in
sops.age.keyFile = keyPath;
# This will generate a new key if the key specified above does not exist
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
}