Compare commits

...

10 Commits

17 changed files with 280 additions and 197 deletions

View File

@@ -5,34 +5,20 @@
{ config, lib, pkgs, inputs, ... }:
{
imports =
[
./nix-settings.nix
./fonts.nix
./kde.nix
./virtualisation.nix
];
# Use the systemd-boot EFI boot loader.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
boot.kernelPackages = pkgs.linuxPackages_zen;
nixpkgs.config.allowUnfree = true;
nix.settings.experimental-features = [ "nix-command" "flakes" ];
nix.settings.auto-optimise-store = true;
nix.gc.automatic = true;
nix.gc.options = "--delete-older-than 30d";
services.fstrim.enable = true;
hardware.graphics.enable32Bit = true; # For 32 bit applications
hardware.bluetooth.enable = true;
hardware.steam-hardware.enable = true;
# Enable common container config files in /etc/containers
virtualisation.containers.enable = true;
virtualisation = {
podman = {
enable = true;
# Create a `docker` alias for podman, to use it as a drop-in replacement
# dockerCompat = true;
# Required for containers under podman-compose to be able to talk to each other.
defaultNetwork.settings.dns_enabled = true;
};
};
# networking.hostName = "nixos"; # Define your hostname.
# Pick only one of the below networking options.
@@ -43,12 +29,6 @@
wifi.powersave = false;
};
# services.resolved.enable = true;
services.mullvad-vpn = {
enable = true;
package = pkgs.mullvad-vpn;
};
# Set your time zone.
time.timeZone = "Europe/London";
@@ -56,45 +36,6 @@
# networking.proxy.default = "http://user:password@proxy:port/";
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
fonts.enableDefaultPackages = true;
fonts.packages = with pkgs; [
noto-fonts
noto-fonts-cjk-sans
noto-fonts-cjk-serif
];
# Select internationalisation properties.
i18n = {
defaultLocale = "en_GB.UTF-8";
supportedLocales = [
"en_GB.UTF-8/UTF-8"
"en_US.UTF-8/UTF-8"
"ja_JP.UTF-8/UTF-8"
];
inputMethod = {
enable = true;
type = "fcitx5";
fcitx5 = {
waylandFrontend = true;
addons = with pkgs; [ fcitx5-mozc ];
};
};
};
console = {
# font = "Lat2-Terminus16";
keyMap = "uk";
# useXkbConfig = true; # use xkb.options in tty.
};
# Enable the X11 windowing system.
# services.xserver.enable = true;
# Configure keymap in X11
# services.xserver.xkb.layout = "us";
# services.xserver.xkb.options = "eurosign:e,caps:escape";
# Enable CUPS to print documents.
# services.printing.enable = true;
@@ -106,65 +47,38 @@
pulse.enable = true;
};
services.power-profiles-daemon.enable = false;
services.tlp = {
services.fstrim.enable = true;
# services.resolved.enable = true;
services.mullvad-vpn = {
enable = true;
settings = {
RESTORE_DEVICE_STATE_ON_STARTUP = 1;
USB_AUTOSUSPEND = 0;
PLATFORM_PROFILE_ON_AC = "performance";
PLATFORM_PROFILE_ON_BAT = "low-power";
CPU_ENERGY_PERF_POLICY_ON_AC = "performance";
CPU_ENERGY_PERF_POLICY_ON_BAT = "power";
CPU_BOOST_ON_AC = 1;
CPU_BOOST_ON_BAT = 0;
};
package = pkgs.mullvad-vpn;
};
# Enable touchpad support (enabled default in most desktopManager).
services.libinput.enable = true;
services.xserver.enable = true; # optional
services.displayManager.sddm.enable = true;
services.displayManager.sddm.wayland.enable = true;
services.desktopManager.plasma6.enable = true;
services.fwupd.enable = true;
services.geoclue2.enable = true;
services.flatpak.enable = true;
programs.steam = {
enable = true;
remotePlay.openFirewall = true; # Open ports in the firewall for Steam Remote Play
dedicatedServer.openFirewall = true; # Open ports in the firewall for Source Dedicated Server
#gamescopeSession.enable = true;
};
programs.gamemode.enable = true;
programs.cdemu.enable = true;
programs.nix-ld.enable = true;
# List packages installed in system profile. To search, run:
# $ nix search wget
environment.systemPackages = with pkgs;
[
nixpkgs-fmt
gcc
vim
curl
wget
inetutils
rar
nuspell
hunspellDicts.en-gb-ise
gcc
libva-utils
kdePackages.sddm-kcm
smartmontools
kdePackages.plasma-disks
kdePackages.partitionmanager
kdePackages.filelight
kdePackages.ffmpegthumbs
kdePackages.kcalc
rar
nixpkgs-fmt
];
# Some programs need SUID wrappers, can be configured further or are
@@ -181,8 +95,9 @@
# services.openssh.enable = true;
# Open ports in the firewall.
networking.firewall.allowedTCPPorts = [ ];
networking.firewall.allowedUDPPorts = [ ];
# 443 Helldivers crashes internet otherwise
networking.firewall.allowedTCPPorts = [ 443 ];
networking.firewall.allowedUDPPorts = [ 443 ];
# Or disable the firewall altogether.
# networking.firewall.enable = false;

35
configuration/fonts.nix Normal file
View File

@@ -0,0 +1,35 @@
{ config, lib, pkgs, inputs, ... }:
{
fonts.enableDefaultPackages = true;
fonts.packages = with pkgs; [
noto-fonts
noto-fonts-cjk-sans
noto-fonts-cjk-serif
];
# Select internationalisation properties.
i18n = {
defaultLocale = "en_GB.UTF-8";
supportedLocales = [
"en_GB.UTF-8/UTF-8"
"en_US.UTF-8/UTF-8"
"ja_JP.UTF-8/UTF-8"
];
inputMethod = {
enable = true;
type = "fcitx5";
fcitx5 = {
waylandFrontend = true;
addons = with pkgs; [ fcitx5-mozc ];
};
};
};
console = {
# font = "Lat2-Terminus16";
keyMap = "uk";
# useXkbConfig = true; # use xkb.options in tty.
};
}

23
configuration/kde.nix Normal file
View File

@@ -0,0 +1,23 @@
{ config, lib, pkgs, inputs, ... }:
{
services.xserver.enable = true; # optional
# Configure keymap in X11
# services.xserver.xkb.layout = "us";
# services.xserver.xkb.options = "eurosign:e,caps:escape";
services.displayManager.sddm.enable = true;
services.displayManager.sddm.wayland.enable = true;
services.desktopManager.plasma6.enable = true;
environment.systemPackages = with pkgs;
[ ] ++ (with kdePackages; [
sddm-kcm
plasma-disks
partitionmanager
filelight
ffmpegthumbs
kcalc
]);
}

View File

@@ -0,0 +1,10 @@
{ config, lib, pkgs, inputs, ... }:
{
nixpkgs.config.allowUnfree = true;
nix.settings.experimental-features = [ "nix-command" "flakes" ];
nix.settings.auto-optimise-store = true;
nix.gc.automatic = true;
nix.gc.options = "--delete-older-than 30d";
}

View File

@@ -0,0 +1,22 @@
{ config, lib, pkgs, inputs, ... }:
{
virtualisation = {
containers = {
# Enable common container config files in /etc/containers
enable = true;
};
libvirtd = {
enable = true;
};
podman = {
enable = true;
# Create a `docker` alias for podman, to use it as a drop-in replacement
dockerCompat = true;
# Required for containers under podman-compose to be able to talk to each other.
defaultNetwork.settings.dns_enabled = true;
};
};
programs.virt-manager.enable = true;
}

46
flake.lock generated
View File

@@ -7,11 +7,11 @@
]
},
"locked": {
"lastModified": 1735048446,
"narHash": "sha256-Tc35Y8H+krA6rZeOIczsaGAtobSSBPqR32AfNTeHDRc=",
"lastModified": 1736437680,
"narHash": "sha256-9Sy17XguKdEU9M5peTrkWSlI/O5IAqjHzdzxbXnc30g=",
"owner": "nix-community",
"repo": "disko",
"rev": "3a4de9fa3a78ba7b7170dda6bd8b4cdab87c0b21",
"rev": "4d5d07d37ff773338e40a92088f45f4f88e509c8",
"type": "github"
},
"original": {
@@ -61,15 +61,16 @@
]
},
"locked": {
"lastModified": 1735053786,
"narHash": "sha256-Gm+0DcbUS338vvkwyYWms5jsWlx8z8MeQBzcnIDuIkw=",
"lastModified": 1736373539,
"narHash": "sha256-dinzAqCjenWDxuy+MqUQq0I4zUSfaCvN9rzuCmgMZJY=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "35b98d20ca8f4ca1f6a2c30b8a2c8bb305a36d84",
"rev": "bd65bc3cde04c16755955630b344bc9e35272c56",
"type": "github"
},
"original": {
"owner": "nix-community",
"ref": "release-24.11",
"repo": "home-manager",
"type": "github"
}
@@ -81,11 +82,11 @@
"nixpkgs": "nixpkgs"
},
"locked": {
"lastModified": 1735177600,
"narHash": "sha256-I51oo2juXWvbBHBwuisXlDelwPzSBghDc3hI/feRDk0=",
"lastModified": 1736388880,
"narHash": "sha256-lA+4MhhcdoanbMnFLjZW+jPdEKcsLs9st2GAst1iuVU=",
"owner": "nix-community",
"repo": "nix-vscode-extensions",
"rev": "abc6bc047bffc62632c043708ee23091bc500611",
"rev": "2a84ca07753e3ec608c96ed2907606361979467a",
"type": "github"
},
"original": {
@@ -110,13 +111,13 @@
"type": "github"
}
},
"nixpkgs_2": {
"nixpkgs-unstable": {
"locked": {
"lastModified": 1734649271,
"narHash": "sha256-4EVBRhOjMDuGtMaofAIqzJbg4Ql7Ai0PSeuVZTHjyKQ=",
"lastModified": 1736344531,
"narHash": "sha256-8YVQ9ZbSfuUk2bUf2KRj60NRraLPKPS0Q4QFTbc+c2c=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "d70bd19e0a38ad4790d3913bf08fcbfc9eeca507",
"rev": "bffc22eb12172e6db3c5dde9e3e5628f8e3e7912",
"type": "github"
},
"original": {
@@ -126,12 +127,29 @@
"type": "github"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1736200483,
"narHash": "sha256-JO+lFN2HsCwSLMUWXHeOad6QUxOuwe9UOAF/iSl1J4I=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "3f0a8ac25fb674611b98089ca3a5dd6480175751",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-24.11",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"disko": "disko",
"home-manager": "home-manager",
"nix-vscode-extensions": "nix-vscode-extensions",
"nixpkgs": "nixpkgs_2"
"nixpkgs": "nixpkgs_2",
"nixpkgs-unstable": "nixpkgs-unstable"
}
},
"systems": {

View File

@@ -1,8 +1,9 @@
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.11";
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
home-manager = {
url = "github:nix-community/home-manager";
url = "github:nix-community/home-manager/release-24.11";
inputs.nixpkgs.follows = "nixpkgs";
};
disko = {
@@ -16,7 +17,7 @@
nixosConfigurations.tuxedo = nixpkgs.lib.nixosSystem {
specialArgs = { inherit inputs; };
modules = [
./configuration.nix
./configuration/base.nix
./tuxedo/configuration.nix
];
};

View File

@@ -0,0 +1,15 @@
{ inputs, config, pkgs, ... }:
{
home.packages = with pkgs;[
git-credential-manager
(with dotnetCorePackages; combinePackages [
sdk_8_0
sdk_9_0
])
jetbrains.rider
azure-cli
azuredatastudio
rustup
];
}

View File

@@ -5,7 +5,7 @@ let
in
{
home.packages = with pkgs;[
nerd-fonts.space-mono
(nerdfonts.override { fonts = [ "SpaceMono" ]; })
];
programs = {
@@ -23,6 +23,7 @@ in
vs-extensions.jnoortheen.nix-ide
vs-extensions.esbenp.prettier-vscode
vs-extensions.bradlc.vscode-tailwindcss
vs-extensions.humao.rest-client
];
userSettings = {
"workbench.iconTheme" = "material-icon-theme";
@@ -39,6 +40,7 @@ in
};
"typescript.preferences.preferTypeOnlyAutoImports" = true;
"chat.commandCenter.enabled" = false;
};
};
};

19
home-manager/fonts.nix Normal file
View File

@@ -0,0 +1,19 @@
{ inputs, config, pkgs, ... }:
{
home.packages = with pkgs;[
liberation_ttf
ubuntu-sans
ubuntu-sans-mono
(nerdfonts.override { fonts = [ "SpaceMono" ]; })
];
fonts.fontconfig = {
enable = true;
defaultFonts = {
monospace = [ "Ubuntu Sans Mono" ];
sansSerif = [ "Ubuntu Sans" ];
serif = [ "Liberation Serif" ];
};
};
}

11
home-manager/gaming.nix Normal file
View File

@@ -0,0 +1,11 @@
{ inputs, config, pkgs, ... }:
{
home.packages = with pkgs;[
steamguard-cli
bottles
protontricks
gamescope
inputs.nixpkgs-unstable.legacyPackages."${pkgs.system}".ryujinx-greemdev
];
}

View File

@@ -18,7 +18,7 @@ in
config = {
home.packages = with pkgs;[
blesh
nerd-fonts.space-mono
(nerdfonts.override { fonts = [ "SpaceMono" ]; })
];
programs = {

17
modules/gaming.nix Normal file
View File

@@ -0,0 +1,17 @@
{ config, lib, pkgs, inputs, ... }:
{
hardware.graphics.enable32Bit = true; # For 32 bit applications
hardware.steam-hardware.enable = true;
programs.steam = {
enable = true;
remotePlay.openFirewall = true; # Open ports in the firewall for Steam Remote Play
dedicatedServer.openFirewall = true; # Open ports in the firewall for Source Dedicated Server
#gamescopeSession.enable = true;
};
programs.gamemode.enable = true;
# ensure users who need access to this have `cdrom` as `extraGroups`
programs.cdemu.enable = true;
}

21
modules/laptop.nix Normal file
View File

@@ -0,0 +1,21 @@
{ config, lib, pkgs, inputs, ... }:
{
services.power-profiles-daemon.enable = false;
services.tlp = {
enable = true;
settings = {
RESTORE_DEVICE_STATE_ON_STARTUP = 1;
USB_AUTOSUSPEND = 0;
PLATFORM_PROFILE_ON_AC = "performance";
PLATFORM_PROFILE_ON_BAT = "low-power";
CPU_ENERGY_PERF_POLICY_ON_AC = "performance";
CPU_ENERGY_PERF_POLICY_ON_BAT = "power";
CPU_BOOST_ON_AC = 1;
CPU_BOOST_ON_BAT = 0;
};
};
# Enable touchpad support (enabled default in most desktopManager).
services.libinput.enable = true;
}

View File

@@ -12,6 +12,8 @@
inputs.disko.nixosModules.default
./disk-config.nix
inputs.home-manager.nixosModules.default
../modules/laptop.nix
../modules/gaming.nix
];
fileSystems."/mnt/HDD1" = {
@@ -28,6 +30,9 @@
};
hardware.tuxedo-drivers.enable = true;
programs.gpu-screen-recorder.enable = true;
# ......omit many configurations
# Define a user account. Don't forget to set a password with passwd.
users.users.worble = {
@@ -44,11 +49,4 @@
"worble" = import ./home-manager/home.nix;
};
};
# Open ports in the firewall.
# 443 Helldivers crashes internet otherwise
# 1900 UPNP discovery
# 5001 Universal Media Server
networking.firewall.allowedTCPPorts = [ 443 1900 5001 ];
networking.firewall.allowedUDPPorts = [ 443 1900 ];
}

View File

@@ -2,9 +2,12 @@
{
imports = [
../../home-manager/fonts.nix
../../home-manager/terminal.nix
../../home-manager/firefox/firefox.nix
../../home-manager/vscode.nix
../../home-manager/development/tools.nix
../../home-manager/development/vscode.nix
../../home-manager/gaming.nix
];
terminal.nixUpdateLocation = "/home/worble/Projects/nixos#tuxedo";
@@ -43,53 +46,27 @@
# (pkgs.writeShellScriptBin "my-hello" ''
# echo "Hello, ${config.home.username}!"
# '')
nextcloud-client
ubuntu-sans
ubuntu-sans-mono
nerd-fonts.space-mono
thunderbird
keepassxc
bottles
rustup
strawberry-qt6
rclone
qbittorrent
teamspeak_client
thunderbird
git-credential-manager
# dotnetCorePackages.sdk_8_0_4xx
(with dotnetCorePackages; combinePackages [
sdk_8_0
sdk_9_0
])
gimp-with-plugins
ffmpeg-full
protonup-qt
protontricks
gamescope
yt-dlp
joplin-desktop
obsidian
teamspeak_client
webcord
libreoffice-qt
azure-cli
jetbrains.rider
steamguard-cli
jellyfin-media-player
haruna
azuredatastudio
inotify-tools
libnotify
electrum
gpu-screen-recorder-gtk
];
fonts.fontconfig = {
enable = true;
defaultFonts = {
monospace = [ "Ubuntu Sans Mono" ];
sansSerif = [ "Ubuntu Sans" ];
serif = [ "Liberation Serif" ];
};
};
# Home Manager is pretty good at managing dotfiles. The primary way to manage
# plain files is through 'home.file'.
home.file = {
@@ -125,6 +102,15 @@
NIXOS_OZONE_WL = "1";
};
# home.sessionPath = [
# "$HOME/.local/bin"
# ];
services.nextcloud-client = {
enable = true;
startInBackground = true;
};
# Let Home Manager install and manage itself.
programs = {
home-manager.enable = true;
@@ -156,7 +142,7 @@
vo = "gpu-next";
gpu-api = "vulkan";
hwdec = "vulkan";
screenshot-directory = "~/Pictures/";
screenshot-directory = "/mnt/HDD1/Pictures/";
screenshot-template = "%F/%F_snapshot_%P";
glsl-shaders = "~~/shaders/Anime4K_Clamp_Highlights.glsl:~~/shaders/Anime4K_Restore_CNN_VL.glsl:~~/shaders/Anime4K_Upscale_CNN_x2_VL.glsl:~~/shaders/Anime4K_AutoDownscalePre_x2.glsl:~~/shaders/Anime4K_AutoDownscalePre_x4.glsl:~~/shaders/Anime4K_Upscale_CNN_x2_M.glsl";
};
@@ -172,23 +158,6 @@
};
systemd.user = {
# enable = true;
# paths = {
# rclone-media = {
# Unit = {
# Description = "rclone unit path for /mnt/HDD1/Videos/";
# After = [ "network.target" "mnt-HDD1.mount" ];
# };
# Path = {
# PathChanged = "/mnt/HDD1/Videos/";
# };
# Install = {
# WantedBy = [ "default.target" ];
# };
# };
# };
services = {
rclone-media = {
Unit = {
@@ -203,24 +172,29 @@
Service = {
Type = "exec";
ExecStart = "${pkgs.writeShellApplication {
name = "rclone-media";
runtimeInputs = [ pkgs.inotify-tools pkgs.libnotify pkgs.rclone ];
text = ''
name = "rclone-media";
runtimeInputs = [ pkgs.inotify-tools pkgs.libnotify pkgs.rclone ];
text = ''
function rclonecopy {
file=$1
changed_rel=''${file#"/mnt/HDD1/Videos"}
notify-send -a "rclone-media" "rclone for $file triggered"
if rclone copyto "$file" media:"media-7gM2gcrxRjXqfj$changed_rel" ; then
notify-send -a "rclone-media" "rclone complete for $file"
else
notify-send -u critical -a "rclone-media" "rclone failed for $file"
fi
}
inotifywait -mr \
--format '%w%f' \
-e close_write \
/mnt/HDD1/Videos/ |
--format '%w%f' \
-e close_write \
/mnt/HDD1/Videos/ |
while read -r file; do
changed_rel=''${file#"/mnt/HDD1/Videos"}
notify-send -a "rclone-media" "rclone for $file triggered"
if rclone copyto "$file" media:"media-7gM2gcrxRjXqfj$changed_rel" ; then
notify-send -a "rclone-media" "rclone for $file complete"
else
notify-send -a "rclone-media" "rclone for $file failed"
fi
rclonecopy "$file"
done
'';
}}/bin/rclone-media";
}}/bin/rclone-media";
};
};
};

2
update.sh Executable file
View File

@@ -0,0 +1,2 @@
#!/usr/bin/env bash
sudo nixos-rebuild switch --flake '/home/worble/Projects/nixos#tuxedo'