Another reformatting & refactor

- fix all statix lints
- format with nixpkgs-fmt instead of alejandro
This commit is contained in:
Tristan D. 2023-10-17 14:12:26 +02:00
parent 8c7c84c129
commit 4539cc5b75
Signed by: tristan
SSH key fingerprint: SHA256:U7y6eMb7CQDaTHv9XoX6/BaQnPqyxxKc+Xnfcefi6rY
14 changed files with 454 additions and 437 deletions

View file

@ -58,17 +58,18 @@
}; };
}; };
outputs = { outputs =
nixpkgs, { nixpkgs
nixpkgs-unstable, , nixpkgs-unstable
nixos-unstable, , nixos-unstable
home-manager, , home-manager
emacs-overlay, , emacs-overlay
nur, , nur
nix-index-database, , nix-index-database
disko, , disko
... , ...
} @ inputs: let } @ inputs:
let
system = "x86_64-linux"; system = "x86_64-linux";
unstable-os = import nixos-unstable pkgs-args; unstable-os = import nixos-unstable pkgs-args;
unstable-os-overlay = _final: _prev: { unstable-os-overlay = _final: _prev: {
@ -84,8 +85,8 @@
emacs-overlay.overlay emacs-overlay.overlay
]; ];
pkgs-args = { pkgs-args = {
system = system; inherit system;
overlays = overlays; inherit overlays;
config = { config = {
allowUnfree = true; allowUnfree = true;
}; };
@ -108,9 +109,10 @@
inherit inputs; inherit inputs;
inherit system; inherit system;
}; };
in { in
{
formatter = { formatter = {
${system} = pkgs.alejandra; ${system} = pkgs.nixpkgs-fmt;
}; };
diskoConfigurations = { diskoConfigurations = {
nixos-pulse = import ./systems/nixos-pulse/disko.nix; nixos-pulse = import ./systems/nixos-pulse/disko.nix;
@ -123,11 +125,13 @@
[ [
./users/tester.nix ./users/tester.nix
{ {
_module = {inherit args;}; _module = { inherit args; };
targets.genericLinux.enable = true; targets.genericLinux.enable = true;
programs.bash.enable = true; programs = {
programs.zsh.enable = true; bash.enable = true;
programs.home-manager.enable = true; zsh.enable = true;
home-manager.enable = true;
};
} }
] ]
++ hmModules; ++ hmModules;
@ -139,7 +143,7 @@
[ [
./users/tristand.nix ./users/tristand.nix
{ {
_module = {inherit args;}; _module = { inherit args; };
xsession.enable = true; xsession.enable = true;
} }
] ]
@ -152,7 +156,7 @@
[ [
./systems/nixos-pulse ./systems/nixos-pulse
{ {
_module = {inherit args;}; _module = { inherit args; };
nix.registry.nixpkgs.flake = nixpkgs; nix.registry.nixpkgs.flake = nixpkgs;
nixpkgs.pkgs = pkgs; nixpkgs.pkgs = pkgs;

View file

@ -1,10 +1,10 @@
{ { lib
lib, , pkgs
pkgs, , config
config, , inputs
inputs, , ...
... }:
}: let let
doomemacsSrc = builtins.fetchGit { doomemacsSrc = builtins.fetchGit {
url = "https://github.com/doomemacs/doomemacs"; url = "https://github.com/doomemacs/doomemacs";
ref = "master"; ref = "master";
@ -14,12 +14,14 @@
personalDoomConfSrc = builtins.fetchGit { personalDoomConfSrc = builtins.fetchGit {
url = "https://git.vlt81.de/tristan/doom"; url = "https://git.vlt81.de/tristan/doom";
ref = "main"; ref = "main";
rev = "e6d22f794c68a5f3ac56861e7e2ed6642cdef16a"; rev = "c6558ab65f106628a3bdb890df935bb7965edd95";
}; };
in { in
{
xdg.enable = true; xdg.enable = true;
programs.alacritty = { programs = {
alacritty = {
enable = true; enable = true;
settings = { settings = {
window.opacity = 0.88; window.opacity = 0.88;
@ -30,12 +32,12 @@ in {
}; };
}; };
programs.starship = { starship = {
enable = true; enable = true;
package = pkgs.unstable-pkgs.starship; package = pkgs.unstable-pkgs.starship;
}; };
programs.fish = { fish = {
enable = true; enable = true;
package = pkgs.unstable-pkgs.fish; package = pkgs.unstable-pkgs.fish;
@ -55,7 +57,7 @@ in {
}; };
}; };
programs.git = { git = {
enable = true; enable = true;
userName = "Tristan Druyen"; userName = "Tristan Druyen";
userEmail = "tristan@vault81.de"; userEmail = "tristan@vault81.de";
@ -72,12 +74,12 @@ in {
package = pkgs.unstable-pkgs.git; package = pkgs.unstable-pkgs.git;
}; };
programs.nix-index = { nix-index = {
enable = true; enable = true;
enableFishIntegration = true; enableFishIntegration = true;
}; };
programs.ssh = { ssh = {
enable = true; enable = true;
package = pkgs.unstable-pkgs.openssh; package = pkgs.unstable-pkgs.openssh;
@ -103,29 +105,32 @@ in {
}; };
}; };
programs.gpg = { gpg = {
enable = true; enable = true;
package = pkgs.unstable-pkgs.gnupg; package = pkgs.unstable-pkgs.gnupg;
}; };
};
services.gpg-agent = { services = {
gpg-agent = {
enable = true; enable = true;
enableExtraSocket = true; enableExtraSocket = true;
enableSshSupport = true; enableSshSupport = true;
}; };
services.lorri.enable = true; lorri.enable = true;
services.emacs = { emacs = {
enable = true; enable = true;
defaultEditor = true; defaultEditor = true;
package = pkgs.unstable-pkgs.emacs-unstable-pgtk; package = pkgs.unstable-pkgs.emacs-unstable-pgtk;
}; };
};
home = { home = {
activation.installDoomEmacs = lib.hm.dag.entryAfter ["writeBoundary"] '' activation.installDoomEmacs = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
mkdir ~/.config/emacs -p mkdir ~/.config/emacs -p
chmod u+rw -R ~/.config/emacs chmod u+rw -R ~/.config/emacs
cp -r ${doomemacsSrc}/. "$HOME/.config/emacs" cp -r ${doomemacsSrc}/. "$HOME/.config/emacs"
@ -157,15 +162,17 @@ in {
gcc gcc
imagemagick imagemagick
libtool libtool
nil
nixpkgs-fmt
pandoc pandoc
python311Full python311Full
rcm rcm
(lib.mkIf (config.services.gpg-agent.enable) (lib.mkIf config.services.gpg-agent.enable
pinentry-emacs) pinentry-emacs)
(ripgrep.override {withPCRE2 = true;}) (ripgrep.override { withPCRE2 = true; })
nil
shellcheck shellcheck
shfmt shfmt
statix
texlive.combined.scheme-full texlive.combined.scheme-full
tokei tokei
wget wget

View file

@ -1,8 +1,7 @@
{ { config
config, , lib
lib, , pkgs
pkgs, , ...
...
}: { }: {
programs.firefox = { programs.firefox = {
enable = true; enable = true;
@ -67,7 +66,7 @@
search = { search = {
force = true; force = true;
default = "DuckDuckGo"; default = "DuckDuckGo";
order = ["DuckDuckGo" "Nix Packages" "Nix Options" "NixOS Wiki"]; order = [ "DuckDuckGo" "Nix Packages" "Nix Options" "NixOS Wiki" ];
engines = { engines = {
"DuckDuckGo".metaData = { "DuckDuckGo".metaData = {
@ -92,7 +91,7 @@
icon = "/run/current-system/sw/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; icon = "/run/current-system/sw/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
definedAliases = ["@np"]; definedAliases = [ "@np" ];
}; };
"Nix Options" = { "Nix Options" = {
urls = [ urls = [
@ -113,7 +112,7 @@
icon = "/run/current-system/sw/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; icon = "/run/current-system/sw/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
definedAliases = ["@no"]; definedAliases = [ "@no" ];
}; };
"Home-Manager Options" = { "Home-Manager Options" = {
urls = [ urls = [
@ -130,7 +129,7 @@
icon = "/run/current-system/sw/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; icon = "/run/current-system/sw/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
definedAliases = ["@ho"]; definedAliases = [ "@ho" ];
}; };
"NixOS Wiki" = { "NixOS Wiki" = {
@ -141,7 +140,7 @@
]; ];
iconUpdateURL = "https://nixos.wiki/favicon.png"; iconUpdateURL = "https://nixos.wiki/favicon.png";
updateInterval = 24 * 60 * 60 * 1000; updateInterval = 24 * 60 * 60 * 1000;
definedAliases = ["@nw"]; definedAliases = [ "@nw" ];
}; };
"Bing".metaData.hidden = true; "Bing".metaData.hidden = true;
@ -165,7 +164,7 @@
} }
{ {
name = "wikipedia"; name = "wikipedia";
tags = ["wiki"]; tags = [ "wiki" ];
keyword = "wiki"; keyword = "wiki";
url = "https://en.wikipedia.org/wiki/Special:Search?search=%s&go=Go"; url = "https://en.wikipedia.org/wiki/Special:Search?search=%s&go=Go";
} }
@ -182,7 +181,7 @@
} }
{ {
name = "wiki"; name = "wiki";
tags = ["wiki" "nix"]; tags = [ "wiki" "nix" ];
url = "https://nixos.wiki/"; url = "https://nixos.wiki/";
} }
{ {

View file

@ -6,23 +6,23 @@
"kaccess"."Toggle Screen Reader On and Off" = "Meta+Alt+S"; "kaccess"."Toggle Screen Reader On and Off" = "Meta+Alt+S";
"kcm_touchpad"."Disable Touchpad" = "Touchpad Off"; "kcm_touchpad"."Disable Touchpad" = "Touchpad Off";
"kcm_touchpad"."Enable Touchpad" = "Touchpad On"; "kcm_touchpad"."Enable Touchpad" = "Touchpad On";
"kcm_touchpad"."Toggle Touchpad" = ["Touchpad Toggle" "Meta+Ctrl+Zenkaku Hankaku"]; "kcm_touchpad"."Toggle Touchpad" = [ "Touchpad Toggle" "Meta+Ctrl+Zenkaku Hankaku" ];
"kded5"."Show System Activity" = "Ctrl+Esc"; "kded5"."Show System Activity" = "Ctrl+Esc";
"kded5"."display" = ["Display" "Meta+P"]; "kded5"."display" = [ "Display" "Meta+P" ];
"kmix"."decrease_microphone_volume" = "Microphone Volume Down"; "kmix"."decrease_microphone_volume" = "Microphone Volume Down";
"kmix"."decrease_volume" = "Volume Down"; "kmix"."decrease_volume" = "Volume Down";
"kmix"."increase_microphone_volume" = "Microphone Volume Up"; "kmix"."increase_microphone_volume" = "Microphone Volume Up";
"kmix"."increase_volume" = "Volume Up"; "kmix"."increase_volume" = "Volume Up";
"kmix"."mic_mute" = ["Microphone Mute" "Meta+Volume Mute"]; "kmix"."mic_mute" = [ "Microphone Mute" "Meta+Volume Mute" ];
"kmix"."mute" = "Volume Mute"; "kmix"."mute" = "Volume Mute";
"ksmserver"."Lock Session" = ["Meta+L" "Screensaver"]; "ksmserver"."Lock Session" = [ "Meta+L" "Screensaver" ];
"ksmserver"."Log Out" = "Ctrl+Alt+Del"; "ksmserver"."Log Out" = "Ctrl+Alt+Del";
"kwin"."Activate Window Demanding Attention" = "Meta+Ctrl+A"; "kwin"."Activate Window Demanding Attention" = "Meta+Ctrl+A";
"kwin"."ClearLastMouseMark" = "Meta+Shift+F12"; "kwin"."ClearLastMouseMark" = "Meta+Shift+F12";
"kwin"."ClearMouseMarks" = "Meta+Shift+F11"; "kwin"."ClearMouseMarks" = "Meta+Shift+F11";
"kwin"."Edit Tiles" = "Meta+T"; "kwin"."Edit Tiles" = "Meta+T";
"kwin"."Expose" = "Ctrl+F9"; "kwin"."Expose" = "Ctrl+F9";
"kwin"."ExposeAll" = ["Ctrl+F10" "Launch (C)"]; "kwin"."ExposeAll" = [ "Ctrl+F10" "Launch (C)" ];
"kwin"."ExposeClass" = "Ctrl+F7"; "kwin"."ExposeClass" = "Ctrl+F7";
"kwin"."Invert" = "Meta+Ctrl+I"; "kwin"."Invert" = "Meta+Ctrl+I";
"kwin"."InvertWindow" = "Meta+Ctrl+U"; "kwin"."InvertWindow" = "Meta+Ctrl+U";
@ -62,7 +62,7 @@
"kwin"."Window to Next Screen" = "Meta+Shift+Right"; "kwin"."Window to Next Screen" = "Meta+Shift+Right";
"kwin"."Window to Previous Screen" = "Meta+Shift+Left"; "kwin"."Window to Previous Screen" = "Meta+Shift+Left";
"kwin"."view_actual_size" = "Meta+0"; "kwin"."view_actual_size" = "Meta+0";
"kwin"."view_zoom_in" = ["Meta++" "Meta+="]; "kwin"."view_zoom_in" = [ "Meta++" "Meta+=" ];
"kwin"."view_zoom_out" = "Meta+-"; "kwin"."view_zoom_out" = "Meta+-";
"mediacontrol"."nextmedia" = "Media Next"; "mediacontrol"."nextmedia" = "Media Next";
"mediacontrol"."pausemedia" = "Media Pause"; "mediacontrol"."pausemedia" = "Media Pause";
@ -72,8 +72,8 @@
"org.kde.dolphin.desktop"."_launch" = "Meta+E"; "org.kde.dolphin.desktop"."_launch" = "Meta+E";
"org.kde.konsole.desktop"."_launch" = "Ctrl+Alt+T"; "org.kde.konsole.desktop"."_launch" = "Ctrl+Alt+T";
"org.kde.krunner.desktop"."RunClipboard" = "Alt+Shift+F2"; "org.kde.krunner.desktop"."RunClipboard" = "Alt+Shift+F2";
"org.kde.krunner.desktop"."_launch" = ["Alt+Space" "Alt+F2" "Search"]; "org.kde.krunner.desktop"."_launch" = [ "Alt+Space" "Alt+F2" "Search" ];
"org.kde.plasma.emojier.desktop"."_launch" = ["Meta+." "Meta+Ctrl+Alt+Shift+Space"]; "org.kde.plasma.emojier.desktop"."_launch" = [ "Meta+." "Meta+Ctrl+Alt+Shift+Space" ];
"org.kde.spectacle.desktop"."ActiveWindowScreenShot" = "Meta+Print"; "org.kde.spectacle.desktop"."ActiveWindowScreenShot" = "Meta+Print";
"org.kde.spectacle.desktop"."FullScreenScreenShot" = "Shift+Print"; "org.kde.spectacle.desktop"."FullScreenScreenShot" = "Shift+Print";
"org.kde.spectacle.desktop"."RectangularRegionScreenShot" = "Meta+Shift+Print"; "org.kde.spectacle.desktop"."RectangularRegionScreenShot" = "Meta+Shift+Print";

View file

@ -1,13 +1,12 @@
{ { config
config, , lib
lib, , pkgs
pkgs, , ...
...
}: { }: {
dconf.settings = { dconf.settings = {
"org/virt-manager/virt-manager/connections" = { "org/virt-manager/virt-manager/connections" = {
autoconnect = ["qemu:///system"]; autoconnect = [ "qemu:///system" ];
uris = ["qemu:///system"]; uris = [ "qemu:///system" ];
}; };
}; };

View file

@ -1,7 +1,6 @@
{ { config
config, , pkgs
pkgs, , ...
...
}: { }: {
nix = { nix = {
gc = { gc = {
@ -16,8 +15,6 @@
''; '';
}; };
services.fwupd.enable = true;
# locale # locale
time.timeZone = "Europe/Berlin"; time.timeZone = "Europe/Berlin";
@ -55,27 +52,29 @@
vim # fallback ed vim # fallback ed
]; ];
# nix convenience programs = {
services.envfs.enable = true; nix-ld.dev.enable = true;
programs.nix-ld.dev.enable = true; command-not-found.enable = false;
programs.command-not-found.enable = false; nix-index-database.comma.enable = true;
programs.nix-index-database.comma.enable = true;
###################
programs.fish.enable = true; fish.enable = true;
programs.gnupg.agent = { gnupg.agent = {
enable = true; enable = true;
enableSSHSupport = true; enableSSHSupport = true;
}; };
};
services.openssh.enable = true; services = {
fwupd.enable = true;
# For SMB #### envfs.enable = true;
services.gvfs.enable = true;
services.avahi.enable = true; openssh.enable = true;
services.avahi.nssmdns = true;
gvfs.enable = true;
avahi.enable = true;
avahi.nssmdns = true;
};
# netbios dns
networking.firewall.extraCommands = ''iptables -t raw -A OUTPUT -p udp -m udp --dport 137 -j CT --helper netbios-ns''; networking.firewall.extraCommands = ''iptables -t raw -A OUTPUT -p udp -m udp --dport 137 -j CT --helper netbios-ns'';
##############
} }

View file

@ -1,8 +1,7 @@
{ { config
config, , lib
lib, , pkgs
pkgs, , ...
...
}: { }: {
programs.dconf.enable = true; programs.dconf.enable = true;
@ -23,11 +22,11 @@
mplus-outline-fonts.githubRelease mplus-outline-fonts.githubRelease
dina-font dina-font
proggyfonts proggyfonts
(nerdfonts.override {fonts = ["FiraCode" "DroidSansMono" "NerdFontsSymbolsOnly"];}) (nerdfonts.override { fonts = [ "FiraCode" "DroidSansMono" "NerdFontsSymbolsOnly" ]; })
]; ];
# Desktop env services = {
services.xserver = { xserver = {
enable = true; enable = true;
layout = "us"; layout = "us";
xkbVariant = "alt-intl"; xkbVariant = "alt-intl";
@ -45,13 +44,7 @@
# }; # };
}; };
}; };
######################### pipewire = {
## audio
sound.enable = true;
hardware.bluetooth.enable = true;
hardware.pulseaudio.enable = false;
services.pipewire = {
enable = true; enable = true;
alsa.enable = true; alsa.enable = true;
alsa.support32Bit = true; alsa.support32Bit = true;
@ -62,14 +55,21 @@
## printing ## printing
services.printing.enable = true; printing = {
services.printing.drivers = with pkgs; [ enable = true;
drivers = with pkgs; [
gutenprint gutenprint
gutenprintBin gutenprintBin
hplipWithPlugin hplipWithPlugin
brlaser brlaser
brgenml1cupswrapper brgenml1cupswrapper
]; ];
};
};
## audio
sound.enable = true;
hardware.bluetooth.enable = true;
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
cifs-utils cifs-utils

View file

@ -1,8 +1,7 @@
{ { config
config, , lib
lib, , pkgs
pkgs, , ...
...
}: { }: {
networking.networkmanager.enable = true; networking.networkmanager.enable = true;
networking.nameservers = [ networking.nameservers = [
@ -12,22 +11,24 @@
"2a07:a8c1::#921984.dns.nextdns.io" "2a07:a8c1::#921984.dns.nextdns.io"
]; ];
services.resolved = { services = {
resolved = {
enable = true; enable = true;
dnssec = "true"; dnssec = "true";
domains = ["~."]; domains = [ "~." ];
fallbackDns = ["1.1.1.1#one.one.one.one" "1.0.0.1#one.one.one.one"]; fallbackDns = [ "1.1.1.1#one.one.one.one" "1.0.0.1#one.one.one.one" ];
extraConfig = '' extraConfig = ''
DNSOverTLS=yes DNSOverTLS=yes
''; '';
}; };
services.tailscale = { tailscale = {
enable = true; enable = true;
useRoutingFeatures = "both"; useRoutingFeatures = "both";
}; };
services.mozillavpn = { mozillavpn = {
enable = true; enable = true;
}; };
};
} }

View file

@ -1,8 +1,7 @@
{ { config
config, , lib
lib, , pkgs
pkgs, , ...
...
}: { }: {
environment.systemPackages = with pkgs.unstable-os; [ environment.systemPackages = with pkgs.unstable-os; [
virtiofsd virtiofsd
@ -29,7 +28,7 @@
qemu = { qemu = {
package = pkgs.qemu_kvm; package = pkgs.qemu_kvm;
ovmf.enable = true; ovmf.enable = true;
ovmf.packages = [pkgs.OVMFFull.fd]; ovmf.packages = [ pkgs.OVMFFull.fd ];
swtpm.enable = true; swtpm.enable = true;
runAsRoot = false; runAsRoot = false;
}; };

View file

@ -1,11 +1,10 @@
{ { config
config, , lib
lib, , pkgs
pkgs, , modulesPath
modulesPath, , system
system, , inputs
inputs, , ...
...
}: { }: {
imports = [ imports = [
(modulesPath + "/installer/scan/not-detected.nix") (modulesPath + "/installer/scan/not-detected.nix")
@ -31,17 +30,17 @@
}; };
initrd = { initrd = {
availableKernelModules = ["amdgpu" "nvme" "xhci_pci" "uas" "usbhid" "usb_storage" "sd_mod"]; availableKernelModules = [ "amdgpu" "nvme" "xhci_pci" "uas" "usbhid" "usb_storage" "sd_mod" ];
kernelModules = []; kernelModules = [ ];
systemd.enable = true; systemd.enable = true;
}; };
kernelModules = ["kvm-amd" "amdgpu"]; kernelModules = [ "kvm-amd" "amdgpu" ];
extraModulePackages = []; extraModulePackages = [ ];
}; };
services.btrfs.autoScrub.enable = true; services.btrfs.autoScrub.enable = true;
services.xserver.videoDrivers = ["amdgpu"]; services.xserver.videoDrivers = [ "amdgpu" ];
networking = { networking = {
hostName = "nixos-pulse"; hostName = "nixos-pulse";
@ -70,11 +69,29 @@
}; };
}; };
systemd = {
services = {
# This manually configures the automatically created network-adresses service to be more flexible # This manually configures the automatically created network-adresses service to be more flexible
# regarding booting without the the device being available on boot # regarding booting without the the device being available on boot
# It prevents slow timeouts & errors on boot while preserving Plug & Play ability # It prevents slow timeouts & errors on boot while preserving Plug & Play ability
systemd.services.network-addresses-enp5s0f4u1u1c2.unitConfig.ConditionPathExists = "/sys/class/net/enp5s0f4u1u1c2"; network-addresses-enp5s0f4u1u1c2.unitConfig = {
systemd.services.network-addresses-enp5s0f4u1u1c2.unitConfig.BindsTo = lib.mkForce null; ConditionPathExists = "/sys/class/net/enp5s0f4u1u1c2";
BindsTo = lib.mkForce null;
};
powertop.postStart = ''
HIDDEVICES=$(ls /sys/bus/usb/drivers/usbhid | grep -oE '^[0-9]+-[0-9\.]+' | sort -u)
for i in $HIDDEVICES; do
echo -n "Enabling " | cat - /sys/bus/usb/devices/$i/product
echo 'on' > /sys/bus/usb/devices/$i/power/control
done
'';
};
tmpfiles.rules = [
"L+ /opt/rocm/hip - - - - ${pkgs.hip}"
];
};
services.udev.extraRules = '' services.udev.extraRules = ''
ACTION=="add", KERNEL=="enp5s0f4u1u1c2", TAG+="systemd", ENV{SYSTEMD_WANTS}="network-addresses-enp5s0f4u1u1c2.service" ACTION=="add", KERNEL=="enp5s0f4u1u1c2", TAG+="systemd", ENV{SYSTEMD_WANTS}="network-addresses-enp5s0f4u1u1c2.service"
ACTION=="remove", KERNEL=="enp5s0f4u1u1c2", RUN+="${pkgs.systemd}/bin/systemctl stop network-addresses-enp5s0f4u1u1c2.service" ACTION=="remove", KERNEL=="enp5s0f4u1u1c2", RUN+="${pkgs.systemd}/bin/systemctl stop network-addresses-enp5s0f4u1u1c2.service"
@ -82,13 +99,6 @@
# energy saving stuff # energy saving stuff
powerManagement.powertop.enable = true; powerManagement.powertop.enable = true;
systemd.services.powertop.postStart = ''
HIDDEVICES=$(ls /sys/bus/usb/drivers/usbhid | grep -oE '^[0-9]+-[0-9\.]+' | sort -u)
for i in $HIDDEVICES; do
echo -n "Enabling " | cat - /sys/bus/usb/devices/$i/product
echo 'on' > /sys/bus/usb/devices/$i/power/control
done
'';
hardware = { hardware = {
tuxedo-control-center = { tuxedo-control-center = {
@ -107,9 +117,5 @@
cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}; };
systemd.tmpfiles.rules = [
"L+ /opt/rocm/hip - - - - ${pkgs.hip}"
];
zramSwap.enable = true; zramSwap.enable = true;
} }

View file

@ -18,9 +18,9 @@
content = { content = {
type = "luks"; type = "luks";
name = "crypted_0"; name = "crypted_0";
extraOpenArgs = ["--allow-discards"]; extraOpenArgs = [ "--allow-discards" ];
passwordFile = "/tmp/secret.key"; passwordFile = "/tmp/secret.key";
additionalKeyFiles = []; additionalKeyFiles = [ ];
# content is empty here as the btrfs partition will be created via extraArgs of the cryptroot_1 partition def # content is empty here as the btrfs partition will be created via extraArgs of the cryptroot_1 partition def
}; };
}; };
@ -29,9 +29,9 @@
content = { content = {
type = "luks"; type = "luks";
name = "crypted_swap_0"; name = "crypted_swap_0";
extraOpenArgs = ["--allow-discards"]; extraOpenArgs = [ "--allow-discards" ];
passwordFile = "/tmp/secret.key"; passwordFile = "/tmp/secret.key";
additionalKeyFiles = []; additionalKeyFiles = [ ];
content = { content = {
type = "swap"; type = "swap";
}; };
@ -65,9 +65,9 @@
content = { content = {
type = "luks"; type = "luks";
name = "crypted_1"; name = "crypted_1";
extraOpenArgs = ["--allow-discards"]; extraOpenArgs = [ "--allow-discards" ];
passwordFile = "/tmp/secret.key"; passwordFile = "/tmp/secret.key";
additionalKeyFiles = []; additionalKeyFiles = [ ];
content = { content = {
# this partiton needs to be in the last parent part alphabetically to ensure the referenced /crypted_0 dev already exists # this partiton needs to be in the last parent part alphabetically to ensure the referenced /crypted_0 dev already exists
type = "btrfs"; type = "btrfs";
@ -79,18 +79,18 @@
"/dev/mapper/crypted_0" "/dev/mapper/crypted_0"
]; ];
subvolumes = { subvolumes = {
"/_active" = {}; "/_active" = { };
"/_active/root" = { "/_active/root" = {
mountpoint = "/"; mountpoint = "/";
mountOptions = ["compress=zstd" "noatime"]; mountOptions = [ "compress=zstd" "noatime" ];
}; };
"/_active/home" = { "/_active/home" = {
mountpoint = "/home"; mountpoint = "/home";
mountOptions = ["compress=zstd" "relatime"]; mountOptions = [ "compress=zstd" "relatime" ];
}; };
"/_active/nix" = { "/_active/nix" = {
mountpoint = "/nix"; mountpoint = "/nix";
mountOptions = ["compress=zstd" "noatime"]; mountOptions = [ "compress=zstd" "noatime" ];
}; };
}; };
}; };
@ -101,9 +101,9 @@
content = { content = {
type = "luks"; type = "luks";
name = "crypted_swap_1"; name = "crypted_swap_1";
extraOpenArgs = ["--allow-discards"]; extraOpenArgs = [ "--allow-discards" ];
passwordFile = "/tmp/secret.key"; passwordFile = "/tmp/secret.key";
additionalKeyFiles = []; additionalKeyFiles = [ ];
content = { content = {
type = "swap"; type = "swap";
resumeDevice = true; resumeDevice = true;

View file

@ -1,14 +1,13 @@
{ { pkgs
pkgs, , config
config, , inputs
inputs, , system
system, , ...
...
}: { }: {
users.users.tester = { users.users.tester = {
isNormalUser = true; isNormalUser = true;
description = "Testa Test"; description = "Testa Test";
extraGroups = ["docker" "networkmanager" "wheel" "libvirtd" "qemu-libvirtd"]; extraGroups = [ "docker" "networkmanager" "wheel" "libvirtd" "qemu-libvirtd" ];
shell = pkgs.fish; shell = pkgs.fish;
home = "/home/tester"; home = "/home/tester";
hashedPassword = "$6$YJT50/Za3FSFQuNT$0orD1URwoURoRKO9sIAsUiIHxOtEOjmPXn5Mp7vAmIYlgVmI629qS7YPUInmztEtEorRpkSMbV3.fCy9NQhKX."; hashedPassword = "$6$YJT50/Za3FSFQuNT$0orD1URwoURoRKO9sIAsUiIHxOtEOjmPXn5Mp7vAmIYlgVmI629qS7YPUInmztEtEorRpkSMbV3.fCy9NQhKX.";
@ -16,7 +15,7 @@
users.users.tristand = { users.users.tristand = {
isNormalUser = true; isNormalUser = true;
description = "Tristan Druyen"; description = "Tristan Druyen";
extraGroups = ["docker" "networkmanager" "wheel" "libvirtd" "qemu-libvirtd"]; extraGroups = [ "docker" "networkmanager" "wheel" "libvirtd" "qemu-libvirtd" ];
shell = pkgs.fish; shell = pkgs.fish;
home = "/home/tristand"; home = "/home/tristand";
hashedPassword = "$6$Wj.XY8JgH5EWuog4$HnbtPJXDEqKXFrzkPVEjih3PytcpBCrkfL7TAwkXd0IFced7kGMlZNliNsAqQ3XqfyUzAYiiKTIqoPVJEk.s.."; hashedPassword = "$6$Wj.XY8JgH5EWuog4$HnbtPJXDEqKXFrzkPVEjih3PytcpBCrkfL7TAwkXd0IFced7kGMlZNliNsAqQ3XqfyUzAYiiKTIqoPVJEk.s..";

View file

@ -1,16 +1,17 @@
{ { pkgs
pkgs, , config
config, , inputs
inputs, , system
system, , ...
... }:
}: let let
wallpaper = inputs.nix-wallpaper.packages.${pkgs.system}.default.override { wallpaper = inputs.nix-wallpaper.packages.${pkgs.system}.default.override {
logoSize = 24; logoSize = 24;
preset = "gruvbox-dark-rainbow"; preset = "gruvbox-dark-rainbow";
}; };
wallpaperPath = "${wallpaper}/share/wallpapers/nixos-wallpaper.png"; wallpaperPath = "${wallpaper}/share/wallpapers/nixos-wallpaper.png";
in { in
{
imports = [ imports = [
../home-mods/dev ../home-mods/dev
../home-mods/firefox ../home-mods/firefox
@ -18,11 +19,12 @@ in {
../home-mods/virt ../home-mods/virt
]; ];
home.file.".background".source = wallpaperPath; home = {
home.username = "tester"; file.".background".source = wallpaperPath;
home.homeDirectory = "/home/tester"; username = "tester";
homeDirectory = "/home/tester";
home.packages = with pkgs.unstable-pkgs; [ packages = with pkgs.unstable-pkgs; [
bitwarden bitwarden
brave brave
btop btop
@ -39,10 +41,10 @@ in {
rustdesk rustdesk
tutanota-desktop tutanota-desktop
signal-desktop signal-desktop
statix
thunderbird thunderbird
zellij zellij
]; ];
home.stateVersion = "23.05"; stateVersion = "23.05";
};
} }

View file

@ -1,16 +1,17 @@
{ { pkgs
pkgs, , config
config, , inputs
inputs, , system
system, , ...
... }:
}: let let
wallpaper = inputs.nix-wallpaper.packages.${pkgs.system}.default.override { wallpaper = inputs.nix-wallpaper.packages.${pkgs.system}.default.override {
logoSize = 24; logoSize = 24;
preset = "gruvbox-dark-rainbow"; preset = "gruvbox-dark-rainbow";
}; };
wallpaperPath = "${wallpaper}/share/wallpapers/nixos-wallpaper.png"; wallpaperPath = "${wallpaper}/share/wallpapers/nixos-wallpaper.png";
in { in
{
imports = [ imports = [
../home-mods/dev ../home-mods/dev
../home-mods/firefox ../home-mods/firefox
@ -18,11 +19,12 @@ in {
../home-mods/virt ../home-mods/virt
]; ];
home.file.".background".source = wallpaperPath; home = {
home.username = "tristand"; file.".background".source = wallpaperPath;
home.homeDirectory = "/home/tristand"; username = "tristand";
homeDirectory = "/home/tristand";
home.packages = with pkgs.unstable-pkgs; [ packages = with pkgs.unstable-pkgs; [
bitwarden bitwarden
brave brave
btop btop
@ -39,10 +41,10 @@ in {
rustdesk rustdesk
tutanota-desktop tutanota-desktop
signal-desktop signal-desktop
statix
thunderbird thunderbird
zellij zellij
]; ];
home.stateVersion = "23.05"; stateVersion = "23.05";
};
} }