mirror of
https://github.com/Cian-H/My_NixOS_Config.git
synced 2025-12-22 23:11:57 +00:00
Fresh start to clean history after subtree experiments
This commit is contained in:
258
nixos/homeserver/configuration.nix
Normal file
258
nixos/homeserver/configuration.nix
Normal file
@@ -0,0 +1,258 @@
|
||||
{
|
||||
inputs,
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
unstablePkgs,
|
||||
...
|
||||
}: {
|
||||
imports = [
|
||||
# Include the results of the hardware scan.
|
||||
./hardware-configuration.nix
|
||||
./filesystems.nix
|
||||
./firewall.nix
|
||||
];
|
||||
|
||||
# Allow unfree packages
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
|
||||
# Bootloader.
|
||||
boot.loader.systemd-boot.enable = true;
|
||||
|
||||
networking.hostName = "homeserver"; # Define your hostname.
|
||||
|
||||
# Enable networking
|
||||
networking.networkmanager.enable = true;
|
||||
|
||||
# Set your time zone.
|
||||
time.timeZone = "Europe/Dublin";
|
||||
|
||||
# Select internationalisation properties.
|
||||
i18n.defaultLocale = "en_IE.UTF-8";
|
||||
|
||||
i18n.extraLocaleSettings = {
|
||||
LC_ADDRESS = "en_IE.UTF-8";
|
||||
LC_IDENTIFICATION = "en_IE.UTF-8";
|
||||
LC_MEASUREMENT = "en_IE.UTF-8";
|
||||
LC_MONETARY = "en_IE.UTF-8";
|
||||
LC_NAME = "en_IE.UTF-8";
|
||||
LC_NUMERIC = "en_IE.UTF-8";
|
||||
LC_PAPER = "en_IE.UTF-8";
|
||||
LC_TELEPHONE = "en_IE.UTF-8";
|
||||
LC_TIME = "en_IE.UTF-8";
|
||||
};
|
||||
|
||||
nix = {
|
||||
registry = (lib.mapAttrs (_: flake: {inherit flake;})) ((lib.filterAttrs (_: lib.isType "flake")) inputs);
|
||||
nixPath = ["nixpkgs=${inputs.nixpkgs}"];
|
||||
settings = {
|
||||
experimental-features = "nix-command flakes";
|
||||
auto-optimise-store = true;
|
||||
};
|
||||
extraOptions = ''
|
||||
trusted-users = root cianh
|
||||
'';
|
||||
};
|
||||
|
||||
environment.etc =
|
||||
lib.mapAttrs'
|
||||
(name: value: {
|
||||
name = "nix/path/${name}";
|
||||
value.source = value.flake;
|
||||
})
|
||||
config.nix.registry
|
||||
// {
|
||||
"justfile" = {
|
||||
text = ''
|
||||
default:
|
||||
@just -g --list
|
||||
|
||||
update-root:
|
||||
if `/usr/bin/env grep -Rq "nixos" /etc/*-release`; then \
|
||||
nixos-rebuild switch --flake /home/cianh/.config/nix/#$HOSTNAME; \
|
||||
fi
|
||||
'';
|
||||
mode = "0644";
|
||||
};
|
||||
"root_gitconfig" = {
|
||||
text = ''
|
||||
[safe]
|
||||
directory = /home/cianh/.config/nix
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
system.activationScripts.linkRootJustfile = {
|
||||
text = ''
|
||||
ln -sf /etc/justfile /root/.justfile
|
||||
mkdir -p /root/.config/git
|
||||
ln -sf /etc/root_gitconfig /root/.config/git/config
|
||||
'';
|
||||
deps = [];
|
||||
};
|
||||
|
||||
# Configure console keymap
|
||||
console.keyMap = "uk";
|
||||
|
||||
users.users = {
|
||||
cianh = {
|
||||
isNormalUser = true;
|
||||
hashedPasswordFile = "/etc/hashedPasswordFile";
|
||||
description = "Cian Hughes";
|
||||
extraGroups = ["networkmanager" "wheel" "docker" "podman" "nixcfg"];
|
||||
shell = unstablePkgs.nushell;
|
||||
openssh.authorizedKeys.keyFiles = [
|
||||
./ssh/authorized_keys
|
||||
];
|
||||
};
|
||||
|
||||
root = {
|
||||
shell = pkgs.bashInteractive;
|
||||
openssh.authorizedKeys.keyFiles = [
|
||||
./ssh/authorized_keys
|
||||
];
|
||||
extraGroups = ["docker" "podman" "nixcfg"];
|
||||
};
|
||||
};
|
||||
|
||||
# $ nix search wget
|
||||
environment.systemPackages =
|
||||
(with pkgs; [
|
||||
atuin
|
||||
bat
|
||||
bitwarden-cli
|
||||
bottom
|
||||
delta
|
||||
du-dust
|
||||
duf
|
||||
fastfetch
|
||||
fd
|
||||
fzf
|
||||
gh
|
||||
git
|
||||
git-extras
|
||||
glab
|
||||
glow
|
||||
gnupg
|
||||
hexyl
|
||||
killall
|
||||
less
|
||||
libsecret
|
||||
netcat-gnu
|
||||
nix-index
|
||||
openssl
|
||||
ouch
|
||||
pass
|
||||
passh
|
||||
pinentry-tty
|
||||
pkg-config
|
||||
podman-compose
|
||||
powertop
|
||||
pueue
|
||||
ripgrep
|
||||
rm-improved
|
||||
starship
|
||||
tealdeer
|
||||
wget
|
||||
wl-clipboard
|
||||
xclip
|
||||
xcp
|
||||
zellij
|
||||
zoxide
|
||||
monaspace
|
||||
nerdfonts
|
||||
brotli
|
||||
gcc
|
||||
gnumake
|
||||
micro
|
||||
])
|
||||
++ (with unstablePkgs; [
|
||||
just
|
||||
neovim
|
||||
nushell
|
||||
onefetch
|
||||
serie
|
||||
yazi
|
||||
]);
|
||||
|
||||
programs.neovim = {
|
||||
enable = true;
|
||||
defaultEditor = true;
|
||||
viAlias = true;
|
||||
vimAlias = true;
|
||||
withPython3 = true;
|
||||
withNodeJs = true;
|
||||
withRuby = true;
|
||||
};
|
||||
|
||||
# Enable the OpenSSH daemon and other remote tools.
|
||||
services.openssh = {
|
||||
enable = true;
|
||||
settings = {
|
||||
PasswordAuthentication = false;
|
||||
KbdInteractiveAuthentication = false;
|
||||
};
|
||||
extraConfig = "UsePAM yes";
|
||||
};
|
||||
# Modify the SSH service to prioritise because server is headless
|
||||
systemd.services.sshd = {
|
||||
requires = []; # Remove any non-essential dependencies
|
||||
after = ["network.target"]; # Only need to wait for networking (obviously)
|
||||
serviceConfig = {
|
||||
# If SSH dies, we want to restart it asap
|
||||
Restart = "always";
|
||||
RestartSec = "3";
|
||||
StartLimitIntervalSec = "0";
|
||||
# The CPU should never be too busy to respond to SSH
|
||||
CPUSchedulingPolicy = "rr";
|
||||
CPUSchedulingPriority = "99";
|
||||
IOSchedulingClass = "realtime";
|
||||
IOSchedulingPriority = "0";
|
||||
# Finally, if the system hits an OOM, for the love of god dont kill SSH until last
|
||||
OOMScoreAdjust = "-1000";
|
||||
};
|
||||
};
|
||||
|
||||
# Add custom services
|
||||
systemd.services.pueued = {
|
||||
enable = true;
|
||||
description = "Pueue Daemon - CLI process scheduler and manager";
|
||||
wantedBy = ["default.target"];
|
||||
serviceConfig = {
|
||||
Restart = "no";
|
||||
ExecStart = "${pkgs.pueue.outPath}/bin/pueued -vv";
|
||||
};
|
||||
};
|
||||
|
||||
# Enable GPG signing
|
||||
services.pcscd.enable = true;
|
||||
programs.gnupg.agent = {
|
||||
enable = true;
|
||||
pinentryPackage = pkgs.pinentry-tty;
|
||||
enableSSHSupport = true;
|
||||
};
|
||||
|
||||
virtualisation = {
|
||||
containers.enable = true;
|
||||
|
||||
podman = {
|
||||
enable = true;
|
||||
# Create a `docker` alias for podman, to use it as a drop-in replacement
|
||||
dockerCompat = true;
|
||||
dockerSocket.enable = true;
|
||||
# Required for containers under podman-compose to be able to talk to each other.
|
||||
defaultNetwork.settings.dns_enabled = true;
|
||||
};
|
||||
};
|
||||
|
||||
system.stateVersion = "24.11"; # Did you read the comment?
|
||||
system.autoUpgrade.enable = true;
|
||||
|
||||
# Set user config settings
|
||||
users.defaultUserShell = pkgs.nushell;
|
||||
fonts = {
|
||||
enableDefaultPackages = true;
|
||||
fontDir.enable = true;
|
||||
fontconfig.defaultFonts.monospace = ["MonaspiceArNerdFontMono"];
|
||||
};
|
||||
}
|
||||
21
nixos/homeserver/filesystems.nix
Normal file
21
nixos/homeserver/filesystems.nix
Normal file
@@ -0,0 +1,21 @@
|
||||
{
|
||||
inputs,
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
unstablePkgs,
|
||||
...
|
||||
}: {
|
||||
fileSystems = {
|
||||
"/home/cianh/TV_Archive" = {
|
||||
device = "/dev/disk/by-uuid/2ac3aa3e-91bf-4a98-9fb6-3c0235545be9";
|
||||
fsType = "ext4";
|
||||
options = ["nofail" "x-systemd.automount"];
|
||||
};
|
||||
"/home/cianh/Nextcloud" = {
|
||||
device = "/dev/disk/by-uuid/10ebaf9a-f519-4990-b814-9d6825ad692f";
|
||||
fsType = "ext4";
|
||||
options = ["nofail" "x-systemd.automount"];
|
||||
};
|
||||
};
|
||||
}
|
||||
29
nixos/homeserver/firewall.nix
Normal file
29
nixos/homeserver/firewall.nix
Normal file
@@ -0,0 +1,29 @@
|
||||
{
|
||||
inputs,
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
unstablePkgs,
|
||||
...
|
||||
}: {
|
||||
networking.firewall = {
|
||||
enable = true;
|
||||
allowedTCPPorts = [
|
||||
22 # SSH
|
||||
80 # Webpage
|
||||
3000 # Grafana
|
||||
3005 # Plex
|
||||
8096 # Jellyfin
|
||||
8324 # Plex
|
||||
32400 # Plex
|
||||
32469 # Plex
|
||||
];
|
||||
allowedUDPPorts = [
|
||||
1900 # Plex
|
||||
32410 # Plex
|
||||
32412 # Plex
|
||||
32413 # Plex
|
||||
32414 # Plex
|
||||
];
|
||||
};
|
||||
}
|
||||
42
nixos/homeserver/hardware-configuration.nix
Normal file
42
nixos/homeserver/hardware-configuration.nix
Normal file
@@ -0,0 +1,42 @@
|
||||
# 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 + "/installer/scan/not-detected.nix")
|
||||
];
|
||||
|
||||
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" "sdhci_pci" ];
|
||||
boot.initrd.kernelModules = [ ];
|
||||
boot.kernelModules = [ "kvm-intel" ];
|
||||
boot.extraModulePackages = [ ];
|
||||
|
||||
fileSystems."/" =
|
||||
{ device = "/dev/disk/by-uuid/b6757b17-330d-4820-a45f-bad5e7f06516";
|
||||
fsType = "ext4";
|
||||
};
|
||||
|
||||
fileSystems."/boot" =
|
||||
{ device = "/dev/disk/by-uuid/AAE3-7115";
|
||||
fsType = "vfat";
|
||||
options = [ "fmask=0077" "dmask=0077" ];
|
||||
};
|
||||
|
||||
swapDevices =
|
||||
[ { device = "/dev/disk/by-uuid/173de2f3-09e8-4175-9f52-c8b6ea970ad5"; }
|
||||
];
|
||||
|
||||
# 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.enp1s0.useDHCP = lib.mkDefault true;
|
||||
# networking.interfaces.enp3s0.useDHCP = lib.mkDefault true;
|
||||
# networking.interfaces.wlp2s0.useDHCP = lib.mkDefault true;
|
||||
|
||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||
}
|
||||
4
nixos/homeserver/ssh/authorized_keys
Normal file
4
nixos/homeserver/ssh/authorized_keys
Normal file
@@ -0,0 +1,4 @@
|
||||
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDasyiBOJEJvM0OsRJVqTdNzbVnv7sf8yFz8DGmb3Jl1YdCdDnH7GI6VA0Z0WyMsaKy0xSC0JDkjEoWWr2aLCRoYb49x/WDCVPM6Kj2C9c29YUDvA2binE6PTFQyXNJ/p/uAov9QSTGaVUH4eG91S/4LILXwlgUR6tMrhbit+UlAWAPRUa8H/dwWBxXKjCpolIiFpDE7nRqpG85js3zlde5BBH/xso5koeNaS7hpkzbuhpF+9WyscWKWqJzUhYWSdb1VsXM6lrRRgBdPwnwPc5rV0h3xQw3XxBuYAAxEAd4RygCNO1WO2Z6P2b7g/tJfdSqSOeVVFgMUYB0f/OT2X3uP4nm/sR9KQ3w8J9N7Kz7Ql6a/ZAyBLAaRRSfIbiXfYL2J3CT9/mQnl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AzXXn+DIGULjhUDJ5SneZ8jbZJXkMThFMHdK/iUJ5XZOJFJxDMtClGMZ1e25N+HZbrtCokDFHD6BcH5tf2CJusYgvmY3dUTl1iOxkF4mFyjY9OqO6BwgWjRKTAWzQsUrzE1/Q4zeWqaxb4+GkbgniHu6gkjHlBm058DKJ1zM2GzwDlBcFyvtTg2e9bD84o6VQamhuexkG2YGR/RhCLQykmDT4WLUywukaBblbonJemk82RgVHKx2434osXKh7zplQIlyN63UUtn9JLgiaRklKNTL4wVbe+qBWn+od97EFRQAd5oQlUFDz7H5wt1cx0YeoADHwB/omMSQq+PSnxS8S3Q== cianh@raspberrypi
|
||||
367
nixos/worklaptop/configuration.nix
Normal file
367
nixos/worklaptop/configuration.nix
Normal file
@@ -0,0 +1,367 @@
|
||||
{
|
||||
inputs,
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
unstablePkgs,
|
||||
...
|
||||
}: {
|
||||
imports = [
|
||||
# Include the results of the hardware scan.
|
||||
./hardware-configuration.nix
|
||||
./theming.nix
|
||||
];
|
||||
|
||||
# Allow unfree packages
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
|
||||
hardware.nvidia = {
|
||||
# Modesetting is required.
|
||||
modesetting.enable = true;
|
||||
powerManagement.enable = false;
|
||||
powerManagement.finegrained = false;
|
||||
open = false;
|
||||
nvidiaSettings = true;
|
||||
package = config.boot.kernelPackages.nvidiaPackages.stable;
|
||||
};
|
||||
hardware.nvidia-container-toolkit.enable = true;
|
||||
|
||||
# Bootloader.
|
||||
boot = {
|
||||
loader = {
|
||||
grub = {
|
||||
enable = true;
|
||||
efiSupport = true;
|
||||
device = "nodev";
|
||||
useOSProber = true;
|
||||
};
|
||||
efi = {
|
||||
efiSysMountPoint = "/boot/efi";
|
||||
canTouchEfiVariables = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
networking.hostName = "worklaptop"; # Define your hostname.
|
||||
|
||||
# Enable networking
|
||||
networking.networkmanager.enable = true;
|
||||
|
||||
# Set your time zone.
|
||||
time.timeZone = "Europe/Dublin";
|
||||
|
||||
# Select internationalisation properties.
|
||||
i18n.defaultLocale = "en_IE.UTF-8";
|
||||
|
||||
i18n.extraLocaleSettings = {
|
||||
LC_ADDRESS = "en_IE.UTF-8";
|
||||
LC_IDENTIFICATION = "en_IE.UTF-8";
|
||||
LC_MEASUREMENT = "en_IE.UTF-8";
|
||||
LC_MONETARY = "en_IE.UTF-8";
|
||||
LC_NAME = "en_IE.UTF-8";
|
||||
LC_NUMERIC = "en_IE.UTF-8";
|
||||
LC_PAPER = "en_IE.UTF-8";
|
||||
LC_TELEPHONE = "en_IE.UTF-8";
|
||||
LC_TIME = "en_IE.UTF-8";
|
||||
};
|
||||
|
||||
nix = {
|
||||
registry = (lib.mapAttrs (_: flake: {inherit flake;})) ((lib.filterAttrs (_: lib.isType "flake")) inputs);
|
||||
nixPath = ["nixpkgs=${inputs.nixpkgs}"];
|
||||
settings = {
|
||||
experimental-features = "nix-command flakes";
|
||||
auto-optimise-store = true;
|
||||
};
|
||||
extraOptions = ''
|
||||
trusted-users = root cianh
|
||||
'';
|
||||
};
|
||||
|
||||
environment.etc =
|
||||
lib.mapAttrs'
|
||||
(name: value: {
|
||||
name = "nix/path/${name}";
|
||||
value.source = value.flake;
|
||||
})
|
||||
config.nix.registry;
|
||||
|
||||
# Load nvidia driver for Xorg and Wayland
|
||||
services = {
|
||||
xserver = {
|
||||
videoDrivers = ["nvidia"]; # or "nvidiaLegacy470 etc.
|
||||
enable = true;
|
||||
displayManager.gdm.enable = true;
|
||||
desktopManager.gnome.enable = false;
|
||||
xkb = {
|
||||
layout = "ie";
|
||||
variant = "";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
# Configure console keymap
|
||||
console.keyMap = "ie";
|
||||
|
||||
# Enable CUPS to print documents.
|
||||
# services.printing.enable = true;
|
||||
|
||||
# Enable sound with pipewire.
|
||||
hardware.pulseaudio.enable = false;
|
||||
security.rtkit.enable = true;
|
||||
services.pipewire = {
|
||||
enable = true;
|
||||
alsa.enable = true;
|
||||
alsa.support32Bit = true;
|
||||
pulse.enable = true;
|
||||
|
||||
# use the example session manager (no others are packaged yet so this is enabled by default,
|
||||
# no need to redefine it in your config for now)
|
||||
#media-session.enable = true;
|
||||
};
|
||||
|
||||
users.users.cianh = {
|
||||
isNormalUser = true;
|
||||
hashedPasswordFile = "/etc/hashedPasswordFile";
|
||||
description = "Cian Hughes";
|
||||
extraGroups = ["networkmanager" "wheel" "libvirtd"];
|
||||
shell = unstablePkgs.nushell;
|
||||
};
|
||||
# # The hack below sets the user profile image declaratively
|
||||
system.activationScripts.script.text = ''
|
||||
mkdir -p /var/lib/AccountsService/{icons,users}
|
||||
cp /home/cianh/Pictures/face.png /var/lib/AccountsService/icons/cianh
|
||||
echo "[User]
|
||||
Session=
|
||||
Icon=/var/lib/AccountsService/icons/cianh
|
||||
SystemAccount=false" > /var/lib/AccountsService/users/cianh
|
||||
chown root:root /var/lib/AccountsService/users/cianh
|
||||
chmod 0600 /var/lib/AccountsService/users/cianh
|
||||
chown root:root /var/lib/AccountsService/icons/cianh
|
||||
chmod 0444 /var/lib/AccountsService/icons/cianh
|
||||
'';
|
||||
|
||||
# $ nix search wget
|
||||
environment.systemPackages =
|
||||
(with pkgs; [
|
||||
# shell env programs
|
||||
atuin
|
||||
bat
|
||||
bitwarden-cli
|
||||
bottom
|
||||
delta
|
||||
du-dust
|
||||
duf
|
||||
fastfetch
|
||||
fd
|
||||
fzf
|
||||
gdm
|
||||
gh
|
||||
git
|
||||
git-extras
|
||||
glab
|
||||
glow
|
||||
gnupg
|
||||
grub2_efi
|
||||
hexyl
|
||||
killall
|
||||
less
|
||||
libsecret
|
||||
mosh
|
||||
netcat-gnu
|
||||
nix-index
|
||||
nix-ld
|
||||
nmap
|
||||
nodejs
|
||||
openssl
|
||||
ouch
|
||||
pass
|
||||
passh
|
||||
phinger-cursors
|
||||
pinentry-gnome3
|
||||
pkg-config
|
||||
podman-compose
|
||||
powertop
|
||||
pueue
|
||||
qmk
|
||||
qmk-udev-rules
|
||||
qmk_hid
|
||||
ripgrep
|
||||
rm-improved
|
||||
seahorse
|
||||
starship
|
||||
tealdeer
|
||||
wget
|
||||
wl-clipboard
|
||||
xclip
|
||||
xcp
|
||||
xfce.thunar
|
||||
xfce.tumbler
|
||||
zellij
|
||||
zoxide
|
||||
# package managers
|
||||
flatpak
|
||||
# back-end dev tools
|
||||
brotli
|
||||
gcc
|
||||
gnumake
|
||||
# front-end dev environment
|
||||
micro
|
||||
# DE and accompanying tools
|
||||
wayland
|
||||
wayland-utils
|
||||
sway # More stable, backup DE
|
||||
hyprland
|
||||
hyprlock
|
||||
hyprpaper
|
||||
hyprpicker
|
||||
hyprshot
|
||||
xdg-desktop-portal-hyprland
|
||||
xdg-desktop-portal-wlr
|
||||
xdg-desktop-portal-gtk
|
||||
xdg-desktop-portal-xapp
|
||||
])
|
||||
++ (with unstablePkgs; [
|
||||
just
|
||||
ghostty
|
||||
kitty
|
||||
libnotify
|
||||
neovim
|
||||
nushell
|
||||
onefetch
|
||||
ruff
|
||||
serie
|
||||
swaynotificationcenter
|
||||
uv
|
||||
waybar
|
||||
wofi
|
||||
yazi
|
||||
]);
|
||||
|
||||
hardware.keyboard.qmk.enable = true;
|
||||
|
||||
# Activate DEs
|
||||
programs.hyprland = {
|
||||
enable = true;
|
||||
xwayland.enable = true;
|
||||
};
|
||||
programs.sway = {
|
||||
enable = true;
|
||||
extraOptions = ["--unsupported-gpu"];
|
||||
};
|
||||
programs.neovim = {
|
||||
enable = true;
|
||||
defaultEditor = true;
|
||||
viAlias = true;
|
||||
vimAlias = true;
|
||||
withPython3 = true;
|
||||
withNodeJs = true;
|
||||
withRuby = true;
|
||||
};
|
||||
programs.waybar.enable = true;
|
||||
environment.sessionVariables.NIXOS_OZONE_WL = "1";
|
||||
|
||||
# Enable my preferred DE utilities
|
||||
programs.thunar.enable = true;
|
||||
programs.thunar.plugins = with pkgs.xfce; [
|
||||
thunar-volman
|
||||
thunar-archive-plugin
|
||||
thunar-media-tags-plugin
|
||||
];
|
||||
services.gvfs.enable = true;
|
||||
services.tumbler.enable = true;
|
||||
programs.xfconf.enable = true;
|
||||
xdg.portal = {
|
||||
enable = true;
|
||||
wlr.enable = true;
|
||||
extraPortals = [
|
||||
pkgs.xdg-desktop-portal-hyprland
|
||||
pkgs.xdg-desktop-portal-gtk
|
||||
];
|
||||
};
|
||||
|
||||
# Disable automatically activated programs i dont want
|
||||
programs.foot.enable = false;
|
||||
|
||||
# Lets also activate some handy devenv tools
|
||||
programs.direnv.enable = true;
|
||||
programs.direnv.nix-direnv.enable = true;
|
||||
programs.nix-ld = {
|
||||
enable = true;
|
||||
libraries = with pkgs; [
|
||||
acl
|
||||
alsa-lib
|
||||
at-spi2-core
|
||||
attr
|
||||
bzip2
|
||||
curl
|
||||
dbus
|
||||
expat
|
||||
glib
|
||||
libsodium
|
||||
libssh
|
||||
libxml2
|
||||
nspr
|
||||
nss
|
||||
openssl
|
||||
pango
|
||||
stdenv.cc
|
||||
systemd
|
||||
util-linux
|
||||
vulkan-loader
|
||||
xz
|
||||
zlib
|
||||
zstd
|
||||
];
|
||||
};
|
||||
|
||||
# Enable flatpaks
|
||||
services.flatpak.enable = true;
|
||||
|
||||
# Enable the OpenSSH daemon and other remote tools.
|
||||
services.openssh.enable = true;
|
||||
programs.mosh.enable = true;
|
||||
|
||||
# Add custom services
|
||||
systemd.services.pueued = {
|
||||
enable = true;
|
||||
description = "Pueue Daemon - CLI process scheduler and manager";
|
||||
wantedBy = ["default.target"];
|
||||
serviceConfig = {
|
||||
Restart = "no";
|
||||
ExecStart = "${pkgs.pueue.outPath}/bin/pueued -vv";
|
||||
};
|
||||
};
|
||||
|
||||
# Enable GPG signing
|
||||
services.gnome.gnome-keyring.enable = true;
|
||||
programs.seahorse.enable = true; # enable the graphical frontend
|
||||
security.pam.services.gdm.enableGnomeKeyring = true; # load gnome-keyring at startup
|
||||
services.pcscd.enable = true;
|
||||
programs.gnupg.agent = {
|
||||
enable = true;
|
||||
pinentryPackage = pkgs.pinentry-gnome3;
|
||||
enableSSHSupport = true;
|
||||
};
|
||||
|
||||
virtualisation = {
|
||||
containers.enable = true;
|
||||
|
||||
podman = {
|
||||
enable = true;
|
||||
# Create a `docker` alias for podman, to use it as a drop-in replacement
|
||||
dockerCompat = true;
|
||||
dockerSocket.enable = true;
|
||||
# Required for containers under podman-compose to be able to talk to each other.
|
||||
defaultNetwork.settings.dns_enabled = true;
|
||||
};
|
||||
|
||||
libvirtd.enable = true;
|
||||
};
|
||||
programs.virt-manager.enable = true;
|
||||
|
||||
system.stateVersion = "23.11"; # Did you read the comment?
|
||||
system.autoUpgrade.enable = true;
|
||||
|
||||
# Set user config settings
|
||||
users.defaultUserShell = pkgs.nushell;
|
||||
}
|
||||
57
nixos/worklaptop/hardware-configuration.nix
Normal file
57
nixos/worklaptop/hardware-configuration.nix
Normal file
@@ -0,0 +1,57 @@
|
||||
# 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 + "/installer/scan/not-detected.nix")
|
||||
];
|
||||
|
||||
boot.initrd.availableKernelModules = ["xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod" "rtsx_pci_sdmmc"];
|
||||
boot.initrd.kernelModules = [];
|
||||
boot.kernelModules = ["kvm-intel"];
|
||||
boot.extraModulePackages = [];
|
||||
|
||||
fileSystems."/" = {
|
||||
device = "/dev/disk/by-uuid/1eec95dd-9663-4a46-8b6f-10f7754322fa";
|
||||
fsType = "ext4";
|
||||
};
|
||||
|
||||
fileSystems."/boot/efi" = {
|
||||
device = "/dev/disk/by-uuid/056D-249D";
|
||||
fsType = "vfat";
|
||||
options = ["fmask=0022" "dmask=0022"];
|
||||
};
|
||||
|
||||
fileSystems."/home" = {
|
||||
device = "/dev/disk/by-uuid/92c16a05-22ad-436d-a6ca-37d5f0c2cc3d";
|
||||
fsType = "ext4";
|
||||
};
|
||||
|
||||
swapDevices = [
|
||||
{
|
||||
device = "/var/lib/swapfile";
|
||||
size = 24 * 1024;
|
||||
}
|
||||
{
|
||||
device = "/home/.swapfile";
|
||||
size = 64 * 1024;
|
||||
}
|
||||
];
|
||||
# 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.eno2.useDHCP = lib.mkDefault true;
|
||||
# networking.interfaces.enp58s0u1u4.useDHCP = lib.mkDefault true;
|
||||
# networking.interfaces.wlo1.useDHCP = lib.mkDefault true;
|
||||
|
||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||
}
|
||||
49
nixos/worklaptop/theming.nix
Normal file
49
nixos/worklaptop/theming.nix
Normal file
@@ -0,0 +1,49 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
modulesPath,
|
||||
...
|
||||
}: {
|
||||
# GTK theming
|
||||
environment.sessionVariables.GTK_THEME = "Tokyonight-Dark";
|
||||
|
||||
# Delegate QT theming to kvantum
|
||||
environment.sessionVariables.QT_STYLE_OVERRIDE = "kvantum";
|
||||
|
||||
# Fonts
|
||||
fonts = {
|
||||
enableDefaultPackages = true;
|
||||
fontDir.enable = true;
|
||||
|
||||
fontconfig = {
|
||||
defaultFonts = {
|
||||
serif = ["NotoSerifNerdFont"];
|
||||
sansSerif = ["NotoSansNerdFont"];
|
||||
monospace = ["MonaspiceArNerdFontMono"];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
# Theming packages
|
||||
environment.systemPackages = with pkgs; [
|
||||
# fonts
|
||||
corefonts
|
||||
liberation_ttf
|
||||
monaspace
|
||||
nerdfonts
|
||||
nerd-font-patcher
|
||||
noto-fonts
|
||||
noto-fonts-color-emoji
|
||||
vistafonts
|
||||
winePackages.fonts
|
||||
# Cursor
|
||||
hyprcursor
|
||||
# QT
|
||||
libsForQt5.qtstyleplugin-kvantum
|
||||
qt6Packages.qtstyleplugin-kvantum
|
||||
# Adwaita (i love gnome, but god damn is adwaita annoying on other DEs)
|
||||
adwaita-icon-theme
|
||||
libadwaita
|
||||
];
|
||||
}
|
||||
Reference in New Issue
Block a user