refactor: move user configs into separate dir
This commit is contained in:
parent
4807a091c4
commit
80b7bf0ed4
20
flake.nix
20
flake.nix
@ -34,6 +34,7 @@
|
|||||||
./modules
|
./modules
|
||||||
./hosts/common.nix
|
./hosts/common.nix
|
||||||
./hosts/Yura-PC
|
./hosts/Yura-PC
|
||||||
|
./users/cazzzer
|
||||||
# https://nix-community.github.io/home-manager/index.xhtml#sec-flakes-nixos-module
|
# https://nix-community.github.io/home-manager/index.xhtml#sec-flakes-nixos-module
|
||||||
home-manager.nixosModules.home-manager
|
home-manager.nixosModules.home-manager
|
||||||
{
|
{
|
||||||
@ -52,7 +53,9 @@
|
|||||||
modules = [
|
modules = [
|
||||||
./modules
|
./modules
|
||||||
./hosts/common.nix
|
./hosts/common.nix
|
||||||
|
./hosts/hw-vm.nix
|
||||||
./hosts/vm
|
./hosts/vm
|
||||||
|
./users/cazzzer
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
router = nixpkgs.lib.nixosSystem {
|
router = nixpkgs.lib.nixosSystem {
|
||||||
@ -62,6 +65,7 @@
|
|||||||
./modules
|
./modules
|
||||||
./hosts/common.nix
|
./hosts/common.nix
|
||||||
./hosts/router
|
./hosts/router
|
||||||
|
./users/cazzzer
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
@ -72,11 +76,25 @@
|
|||||||
modules = [
|
modules = [
|
||||||
./modules
|
./modules
|
||||||
./hosts/common.nix
|
./hosts/common.nix
|
||||||
./hosts/vm/proxmox.nix
|
./hosts/hw-proxmox.nix
|
||||||
./hosts/vm
|
./hosts/vm
|
||||||
|
./users/cazzzer
|
||||||
];
|
];
|
||||||
format = "proxmox";
|
format = "proxmox";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
vm-proxmox = let
|
||||||
|
image = nixpkgs.lib.nixosSystem {
|
||||||
|
system = "x86_64-linux";
|
||||||
|
modules = [
|
||||||
|
./modules
|
||||||
|
./hosts/common.nix
|
||||||
|
./hosts/hw-proxmox.nix
|
||||||
|
./hosts/vm
|
||||||
|
./users/cazzzer
|
||||||
|
];
|
||||||
|
};
|
||||||
|
in
|
||||||
|
image.config.system.build.VMA;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -1,15 +1,12 @@
|
|||||||
{ config, lib, pkgs, ... }:
|
{ config, lib, pkgs, ... }:
|
||||||
let
|
let
|
||||||
defaultFont = {
|
username = "cazzzer";
|
||||||
family = "Noto Sans";
|
|
||||||
pointSize = 14;
|
|
||||||
};
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
# 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 = "cazzzer";
|
home.username = username;
|
||||||
home.homeDirectory = "/home/cazzzer";
|
home.homeDirectory = "/home/${username}";
|
||||||
|
|
||||||
# Let Home Manager install and manage itself.
|
# Let Home Manager install and manage itself.
|
||||||
programs.home-manager.enable = true;
|
programs.home-manager.enable = true;
|
||||||
@ -126,8 +123,15 @@ in
|
|||||||
programs.plasma = {
|
programs.plasma = {
|
||||||
enable = true;
|
enable = true;
|
||||||
overrideConfig = true;
|
overrideConfig = true;
|
||||||
|
# TODO: figure out how to enable tela-circle icon theme if installed in systemPackages
|
||||||
|
# workspace.iconTheme = if builtins.elem pkgs.tela-circle-icon-theme config.environment.systemPackages then "Tela-circle" else null;
|
||||||
workspace.iconTheme = "Tela-circle";
|
workspace.iconTheme = "Tela-circle";
|
||||||
fonts = {
|
fonts = let
|
||||||
|
defaultFont = {
|
||||||
|
family = "Noto Sans";
|
||||||
|
pointSize = 14;
|
||||||
|
};
|
||||||
|
in {
|
||||||
general = defaultFont;
|
general = defaultFont;
|
||||||
fixedWidth = defaultFont // { family = "Hack"; };
|
fixedWidth = defaultFont // { family = "Hack"; };
|
||||||
small = defaultFont // { pointSize = defaultFont.pointSize - 2; };
|
small = defaultFont // { pointSize = defaultFont.pointSize - 2; };
|
||||||
|
@ -88,7 +88,7 @@
|
|||||||
services.openssh.enable = true;
|
services.openssh.enable = true;
|
||||||
services.flatpak.enable = true;
|
services.flatpak.enable = true;
|
||||||
# services.geoclue2.enable = true;
|
# services.geoclue2.enable = true;
|
||||||
location.provider = "geoclue2";
|
# location.provider = "geoclue2";
|
||||||
# services.gnome.gnome-keyring.enable = true;
|
# services.gnome.gnome-keyring.enable = true;
|
||||||
security.pam.services.sddm.enableGnomeKeyring = true;
|
security.pam.services.sddm.enableGnomeKeyring = true;
|
||||||
# security.pam.services.sddm.gnupg.enable = true;
|
# security.pam.services.sddm.gnupg.enable = true;
|
||||||
@ -97,42 +97,6 @@
|
|||||||
# Enable touchpad support (enabled default in most desktopManager).
|
# Enable touchpad support (enabled default in most desktopManager).
|
||||||
# services.xserver.libinput.enable = true;
|
# services.xserver.libinput.enable = true;
|
||||||
|
|
||||||
# Define a user account. Don't forget to set a password with ‘passwd’.
|
|
||||||
users.groups = {
|
|
||||||
cazzzer = {
|
|
||||||
gid = 1000;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
users.users.cazzzer = {
|
|
||||||
isNormalUser = true;
|
|
||||||
description = "Yura";
|
|
||||||
uid = 1000;
|
|
||||||
group = "cazzzer";
|
|
||||||
extraGroups = [ "networkmanager" "wheel" "docker" "wireshark" "geoclue" ];
|
|
||||||
packages = with pkgs; [
|
|
||||||
# Python
|
|
||||||
python3
|
|
||||||
poetry
|
|
||||||
|
|
||||||
# Haskell
|
|
||||||
haskellPackages.ghc
|
|
||||||
haskellPackages.stack
|
|
||||||
|
|
||||||
# Node
|
|
||||||
nodejs_22
|
|
||||||
pnpm
|
|
||||||
bun
|
|
||||||
|
|
||||||
# Nix
|
|
||||||
nixd
|
|
||||||
nil
|
|
||||||
|
|
||||||
# Gleam
|
|
||||||
gleam
|
|
||||||
beamMinimal26Packages.erlang
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
hardware.bluetooth.enable = true;
|
hardware.bluetooth.enable = true;
|
||||||
hardware.bluetooth.powerOnBoot = false;
|
hardware.bluetooth.powerOnBoot = false;
|
||||||
# Install firefox.
|
# Install firefox.
|
||||||
@ -168,9 +132,6 @@
|
|||||||
# };
|
# };
|
||||||
# };
|
# };
|
||||||
|
|
||||||
# Allow unfree packages
|
|
||||||
nixpkgs.config.allowUnfree = true;
|
|
||||||
|
|
||||||
# List packages installed in system profile. To search, run:
|
# List packages installed in system profile. To search, run:
|
||||||
# $ nix search wget
|
# $ nix search wget
|
||||||
|
|
||||||
@ -219,6 +180,7 @@
|
|||||||
ripgrep
|
ripgrep
|
||||||
starship
|
starship
|
||||||
tealdeer
|
tealdeer
|
||||||
|
transcrypt
|
||||||
] ++ [
|
] ++ [
|
||||||
efibootmgr
|
efibootmgr
|
||||||
ffmpeg
|
ffmpeg
|
||||||
|
16
hosts/hw-proxmox.nix
Normal file
16
hosts/hw-proxmox.nix
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
{ config, lib, pkgs, modulesPath, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
"${modulesPath}/virtualisation/proxmox-image.nix"
|
||||||
|
];
|
||||||
|
|
||||||
|
# boot.kernelParams = [ "console=tty0" ];
|
||||||
|
proxmox.qemuConf.bios = "ovmf";
|
||||||
|
proxmox.qemuExtraConf = {
|
||||||
|
machine = "q35";
|
||||||
|
# efidisk0 = "local-lvm:vm-9999-disk-1";
|
||||||
|
cpu = "host";
|
||||||
|
};
|
||||||
|
proxmox.cloudInit.enable = false;
|
||||||
|
}
|
26
hosts/hw-vm.nix
Normal file
26
hosts/hw-vm.nix
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
{ config, lib, pkgs, modulesPath, ... }: {
|
||||||
|
imports = [
|
||||||
|
"${modulesPath}/profiles/qemu-guest.nix"
|
||||||
|
];
|
||||||
|
|
||||||
|
boot.initrd.availableKernelModules = lib.mkDefault [ "uhci_hcd" "ehci_pci" "ahci" "virtio_pci" "virtio_scsi" "sd_mod" "sr_mod" ];
|
||||||
|
|
||||||
|
fileSystems."/" = lib.mkDefault {
|
||||||
|
device = "/dev/disk/by-label/nixos";
|
||||||
|
autoResize = true;
|
||||||
|
fsType = "ext4";
|
||||||
|
};
|
||||||
|
fileSystems."/boot" = lib.mkDefault {
|
||||||
|
device = "/dev/disk/by-label/ESP";
|
||||||
|
fsType = "vfat";
|
||||||
|
};
|
||||||
|
|
||||||
|
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
|
||||||
|
# (the default) this is the recommended approach. When using systemd-networkd it's
|
||||||
|
# still possible to use this option, but it's recommended to use it in conjunction
|
||||||
|
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
|
||||||
|
networking.useDHCP = lib.mkDefault true;
|
||||||
|
# networking.interfaces.enp6s18.useDHCP = lib.mkDefault true;
|
||||||
|
|
||||||
|
# nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||||
|
}
|
@ -53,24 +53,6 @@ in
|
|||||||
|
|
||||||
security.sudo.wheelNeedsPassword = false;
|
security.sudo.wheelNeedsPassword = false;
|
||||||
|
|
||||||
users.groups = {
|
|
||||||
cazzzer = {
|
|
||||||
gid = 1000;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
users.users.cazzzer = {
|
|
||||||
password = "";
|
|
||||||
openssh.authorizedKeys.keys = [
|
|
||||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPWgEzbEjbbu96MVQzkiuCrw+UGYAXN4sRe2zM6FVopq cazzzer@Yura-PC"
|
|
||||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIApFeLVi3BOquL0Rt+gQK2CutNHaBDQ0m4PcGWf9Bc43 cazzzer@Yura-TPX13"
|
|
||||||
];
|
|
||||||
isNormalUser = true;
|
|
||||||
description = "Yura";
|
|
||||||
uid = 1000;
|
|
||||||
group = "cazzzer";
|
|
||||||
extraGroups = [ "wheel" "wireshark" ];
|
|
||||||
};
|
|
||||||
|
|
||||||
programs.firefox.enable = true;
|
programs.firefox.enable = true;
|
||||||
programs.fish.enable = true;
|
programs.fish.enable = true;
|
||||||
programs.git.enable = true;
|
programs.git.enable = true;
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
{
|
{
|
||||||
imports =
|
imports =
|
||||||
[ # Include the results of the hardware scan.
|
[ # Include the results of the hardware scan.
|
||||||
# ./hardware-configuration-vm.nix
|
# ./hardware-configuration.nix
|
||||||
];
|
];
|
||||||
mods.kb-input.enable = false;
|
mods.kb-input.enable = false;
|
||||||
|
|
||||||
@ -47,8 +47,8 @@
|
|||||||
services.flatpak.enable = true;
|
services.flatpak.enable = true;
|
||||||
|
|
||||||
# VM services
|
# VM services
|
||||||
services.cloud-init.enable = true;
|
# services.cloud-init.enable = false;
|
||||||
# services.cloud-init.network.enable = false;
|
# services.cloud-init.network.enable = false;
|
||||||
services.qemuGuest.enable = true;
|
services.qemuGuest.enable = true;
|
||||||
services.spice-vdagentd.enable = true;
|
services.spice-vdagentd.enable = true;
|
||||||
services.openssh.enable = true;
|
services.openssh.enable = true;
|
||||||
@ -57,24 +57,6 @@
|
|||||||
|
|
||||||
security.sudo.wheelNeedsPassword = false;
|
security.sudo.wheelNeedsPassword = false;
|
||||||
|
|
||||||
users.groups = {
|
|
||||||
cazzzer = {
|
|
||||||
gid = 1000;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
users.users.cazzzer = {
|
|
||||||
password = "";
|
|
||||||
openssh.authorizedKeys.keys = [
|
|
||||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPWgEzbEjbbu96MVQzkiuCrw+UGYAXN4sRe2zM6FVopq cazzzer@Yura-PC"
|
|
||||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIApFeLVi3BOquL0Rt+gQK2CutNHaBDQ0m4PcGWf9Bc43 cazzzer@Yura-TPX13"
|
|
||||||
];
|
|
||||||
isNormalUser = true;
|
|
||||||
description = "Yura";
|
|
||||||
uid = 1000;
|
|
||||||
group = "cazzzer";
|
|
||||||
extraGroups = [ "wheel" "docker" "wireshark" ];
|
|
||||||
};
|
|
||||||
|
|
||||||
# Install firefox.
|
# Install firefox.
|
||||||
programs.firefox.enable = true;
|
programs.firefox.enable = true;
|
||||||
programs.fish.enable = true;
|
programs.fish.enable = true;
|
||||||
|
@ -1,37 +0,0 @@
|
|||||||
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
|
||||||
# and may be overwritten by future invocations. Please make changes
|
|
||||||
# to /etc/nixos/configuration.nix instead.
|
|
||||||
{ config, lib, pkgs, modulesPath, ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
imports =
|
|
||||||
[ (modulesPath + "/profiles/qemu-guest.nix")
|
|
||||||
];
|
|
||||||
|
|
||||||
boot.initrd.availableKernelModules = [ "uhci_hcd" "ehci_pci" "ahci" "virtio_pci" "virtio_scsi" "sd_mod" "sr_mod" ];
|
|
||||||
boot.initrd.kernelModules = [ ];
|
|
||||||
boot.kernelModules = [ ];
|
|
||||||
boot.extraModulePackages = [ ];
|
|
||||||
|
|
||||||
fileSystems."/" =
|
|
||||||
{ device = "/dev/disk/by-uuid/da85e220-e2b0-443a-9a0c-a9516b8e5030";
|
|
||||||
fsType = "ext4";
|
|
||||||
};
|
|
||||||
|
|
||||||
fileSystems."/boot" =
|
|
||||||
{ device = "/dev/disk/by-uuid/3F96-8974";
|
|
||||||
fsType = "vfat";
|
|
||||||
options = [ "fmask=0022" "dmask=0022" ];
|
|
||||||
};
|
|
||||||
|
|
||||||
swapDevices = [ ];
|
|
||||||
|
|
||||||
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
|
|
||||||
# (the default) this is the recommended approach. When using systemd-networkd it's
|
|
||||||
# still possible to use this option, but it's recommended to use it in conjunction
|
|
||||||
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
|
|
||||||
networking.useDHCP = lib.mkDefault true;
|
|
||||||
# networking.interfaces.enp6s18.useDHCP = lib.mkDefault true;
|
|
||||||
|
|
||||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
|
||||||
}
|
|
@ -1,11 +0,0 @@
|
|||||||
{ ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
# boot.kernelParams = [ "console=tty0" ];
|
|
||||||
proxmox.qemuConf.bios = "ovmf";
|
|
||||||
proxmox.qemuExtraConf = {
|
|
||||||
machine = "q35";
|
|
||||||
# efidisk0 = "local-lvm:vm-9999-disk-1";
|
|
||||||
cpu = "host";
|
|
||||||
};
|
|
||||||
}
|
|
42
users/cazzzer/default.nix
Normal file
42
users/cazzzer/default.nix
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
{ config, lib, pkgs, ... }: {
|
||||||
|
users.groups.cazzzer.gid = 1000;
|
||||||
|
users.users.cazzzer = {
|
||||||
|
uid = 1000;
|
||||||
|
isNormalUser = true;
|
||||||
|
description = "Yura";
|
||||||
|
group = "cazzzer";
|
||||||
|
extraGroups = [ "wheel" ]
|
||||||
|
++ lib.optionals config.networking.networkmanager.enable [ "networkmanager" ]
|
||||||
|
++ lib.optionals config.virtualisation.docker.enable [ "docker" ]
|
||||||
|
++ lib.optionals config.programs.wireshark.enable [ "wireshark" ]
|
||||||
|
;
|
||||||
|
openssh.authorizedKeys.keys = [
|
||||||
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIE02AhJIZtrtZ+5sZhna39LUUCEojQzmz2BDWguT9ZHG yuri@tati.sh"
|
||||||
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHczlipzGWv8c6oYwt2/9ykes5ElfneywDXBTOYbfSfn Pixel7Pro"
|
||||||
|
];
|
||||||
|
# TODO: think of a better way to do this
|
||||||
|
packages = with pkgs; lib.optionals (config.networking.hostName == "Yura-PC") [
|
||||||
|
# Python
|
||||||
|
python3
|
||||||
|
poetry
|
||||||
|
|
||||||
|
# Haskell
|
||||||
|
haskellPackages.ghc
|
||||||
|
haskellPackages.stack
|
||||||
|
|
||||||
|
# Node
|
||||||
|
nodejs_22
|
||||||
|
pnpm
|
||||||
|
bun
|
||||||
|
|
||||||
|
# Nix
|
||||||
|
nil
|
||||||
|
nixd
|
||||||
|
nixfmt-rfc-style
|
||||||
|
|
||||||
|
# Gleam
|
||||||
|
gleam
|
||||||
|
beamMinimal26Packages.erlang
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user