Sorted some stuff in configuration
This commit is contained in:
parent
6599e23992
commit
5e05a1e5c1
36 changed files with 210 additions and 216 deletions
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -1,2 +0,0 @@
|
|||
{}:
|
||||
{}
|
||||
|
|
@ -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'.
|
||||
|
|
|
|||
14
nixos/homes/kylekrein/default.nix
Normal file
14
nixos/homes/kylekrein/default.nix
Normal 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";
|
||||
};
|
||||
};
|
||||
|
||||
}
|
||||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
6
nixos/hosts/kylekrein-mac/default.nix
Normal file
6
nixos/hosts/kylekrein-mac/default.nix
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
{ pkgs, lib, hwconfig, ... }:
|
||||
{
|
||||
imports = [
|
||||
../../users/kylekrein
|
||||
];
|
||||
}
|
||||
|
Before Width: | Height: | Size: 78 KiB After Width: | Height: | Size: 78 KiB |
6
nixos/modules/hyprland/default.nix
Normal file
6
nixos/modules/hyprland/default.nix
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
{ ... }:
|
||||
{
|
||||
imports = [
|
||||
./hyprland.nix
|
||||
];
|
||||
}
|
||||
|
|
@ -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"]
|
||||
|
Before Width: | Height: | Size: 78 KiB After Width: | Height: | Size: 78 KiB |
|
Before Width: | Height: | Size: 4.2 MiB After Width: | Height: | Size: 4.2 MiB |
|
|
@ -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 -"
|
||||
];
|
||||
|
||||
|
|
|
|||
|
|
@ -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" ];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
12
nixos/modules/libvirt/user.nix
Normal file
12
nixos/modules/libvirt/user.nix
Normal 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" ];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -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;
|
||||
};
|
||||
}
|
||||
|
|
|
|||
28
nixos/users/kylekrein/default.nix
Normal file
28
nixos/users/kylekrein/default.nix
Normal 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
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue