summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/home/default.nix5
-rw-r--r--modules/home/firefox.nix2
-rw-r--r--modules/home/gtk-bookmarks.nix10
-rw-r--r--modules/home/initial-home-setup.nix4
-rw-r--r--modules/home/resources/firefox/userChrome.css11
-rw-r--r--modules/home/theme-st.nix22
-rw-r--r--modules/home/theme.nix11
-rw-r--r--modules/home/userdirs.nix5
-rw-r--r--modules/hosts/X230/configuration.nix14
-rw-r--r--modules/hosts/X230/hardware-configuration.nix48
-rw-r--r--modules/hosts/X230/home.nix18
-rw-r--r--modules/hosts/hp-envy-office/home.nix4
-rw-r--r--modules/hosts/libreX60/bios-flashing.nix8
-rw-r--r--modules/hosts/libreX60/configuration.nix20
-rw-r--r--modules/hosts/libreX60/home.nix4
-rw-r--r--modules/hosts/libreX60/powertop-auto-tune.nix17
-rw-r--r--modules/hosts/optiplex/configuration.nix4
-rw-r--r--modules/root/fonts.nix4
-rw-r--r--modules/root/normaluser.nix2
-rw-r--r--modules/root/printing.nix1
-rw-r--r--modules/root/resources/x11/xinit-startx-xdg.patch14
-rw-r--r--modules/root/secrets.nix2
-rw-r--r--modules/root/software/desktop.nix1
-rw-r--r--modules/root/software/development.nix7
-rw-r--r--modules/root/software/overlays.nix22
-rw-r--r--modules/root/software/utilities.nix1
-rw-r--r--modules/root/x11.nix36
27 files changed, 234 insertions, 63 deletions
diff --git a/modules/home/default.nix b/modules/home/default.nix
index 8748fb9..9abf1b5 100644
--- a/modules/home/default.nix
+++ b/modules/home/default.nix
@@ -1,7 +1,7 @@
{ lib, userDetails, homeStateVersion, ... }: {
home = {
username = userDetails.username;
- homeDirectory = userDetails.home.root;
+ homeDirectory = userDetails.home;
stateVersion = homeStateVersion;
};
@@ -13,10 +13,13 @@
./htop.nix
./initial-home-setup.nix
./pcmanfm.nix # TODO mk name changeable & doesn't seem to work right now
+ ./theme-st.nix
./theme.nix
+ ./userdirs.nix
./wallpapers.nix
];
+ theme.st.enable = lib.mkDefault false;
theme.mint.enable = lib.mkDefault true;
wallpapers.enable = lib.mkDefault false;
}
diff --git a/modules/home/firefox.nix b/modules/home/firefox.nix
index 000277f..30fd08a 100644
--- a/modules/home/firefox.nix
+++ b/modules/home/firefox.nix
@@ -50,7 +50,7 @@
"app.normandy.first_run" = false;
"browser.aboutConfig.showWarning" = false; # arkenfox does
- "browser.download.dir" = userDetails.home.downloads;
+ #"browser.download.dir" = userDetails.userDirs.downloads;
"browser.newtabpage.activity-stream.feeds.section.topstories" = false;
"browser.newtabpage.activity-stream.feeds.topsites" = false;
"browser.urlbar.suggest.topsites" = false;
diff --git a/modules/home/gtk-bookmarks.nix b/modules/home/gtk-bookmarks.nix
index e6c1ec7..24c6563 100644
--- a/modules/home/gtk-bookmarks.nix
+++ b/modules/home/gtk-bookmarks.nix
@@ -8,10 +8,10 @@
};
config = {
- gtk.gtk3.bookmarks = with userDetails.home; [
- "file://${downloads} Downloads"
- "file://${documents} Documents"
- "file://${pictures} Pictures"
- ] ++ config.additional-gtk-bookmarks;
+ gtk.gtk3.bookmarks = (
+ lib.mapAttrsToList (name: path:
+ "file://${path} ${lib.toUpper (lib.substring 0 1 name)}${lib.substring 1 (-1) name}"
+ ) userDetails.userDirs
+ ) ++ config.additional-gtk-bookmarks;
};
}
diff --git a/modules/home/initial-home-setup.nix b/modules/home/initial-home-setup.nix
index 6aa6ac7..4132386 100644
--- a/modules/home/initial-home-setup.nix
+++ b/modules/home/initial-home-setup.nix
@@ -15,8 +15,8 @@
export PATH="$HOME/.local/bin/misc:$PATH"
run mimewiz -i # already verbose
'';
- createDirs = with userDetails.home; lib.hm.dag.entryAfter ["writeBoundary"] ''
- run mkdir -p $VERBOSE_ARG "${downloads}" "${documents}" "${pictures}"
+ createDirs = lib.hm.dag.entryAfter ["writeBoundary"] ''
+ run mkdir -p $VERBOSE_ARG ${ lib.concatStringsSep " " (lib.attrValues userDetails.userDirs) }
'';
};
}
diff --git a/modules/home/resources/firefox/userChrome.css b/modules/home/resources/firefox/userChrome.css
index de0e112..624ab26 100644
--- a/modules/home/resources/firefox/userChrome.css
+++ b/modules/home/resources/firefox/userChrome.css
@@ -14,6 +14,17 @@
background: var(--toolbar-field-border-color) !important;
}
+/* Change background color of bookmarks toolbar */
+#PersonalToolbar {
+ background: var(--toolbox-bgcolor) !important;
+}
+
+/* Adjust spacing of toolbar items */
+#PlacesToolbarItems {
+ gap: .35rem;
+ margin-block: .2rem;
+}
+
/* Fix vertical spacing of tabs */
#TabsToolbar {
margin-top: -1px;
diff --git a/modules/home/theme-st.nix b/modules/home/theme-st.nix
new file mode 100644
index 0000000..bc22791
--- /dev/null
+++ b/modules/home/theme-st.nix
@@ -0,0 +1,22 @@
+{ config, lib, pkgs, ... }: {
+ options = {
+ theme.st = {
+ enable = lib.mkEnableOption "enables theming st with home manager";
+ font = lib.mkOption {
+ type = lib.types.str;
+ default = "JetBrainsMonoNL Nerd Font Mono:size=12:antialias=true:autohint=true";
+ };
+ };
+ };
+ config = let
+ themed-st = pkgs.st.overrideAttrs (old: {
+ buildInputs = old.buildInputs or [] ++ [ pkgs.makeWrapper ];
+ postInstall = old.postInstall or "" + ''
+ wrapProgram $out/bin/st \
+ --add-flags '-f${config.theme.st.font}'
+ '';
+ });
+ in {
+ home.packages = [ themed-st ];
+ };
+}
diff --git a/modules/home/theme.nix b/modules/home/theme.nix
index 4edaffa..2288610 100644
--- a/modules/home/theme.nix
+++ b/modules/home/theme.nix
@@ -47,15 +47,20 @@ in {
description = "default gtk font";
};
size = lib.mkOption {
- type = lib.types.int;
+ type = with lib.types; nullOr int;
default = null;
description = "default gtk font size";
};
};
};
theme.cursor = {
+ name = lib.mkOption {
+ type = lib.types.str;
+ default = "Adwaita";
+ description = "gtk cursor theme";
+ };
size = lib.mkOption {
- type = lib.types.int;
+ type = with lib.types; nullOr int;
default = null;
description = "gtk cursor size";
};
@@ -78,7 +83,7 @@ in {
size = config.theme.font.gtk.size;
};
cursorTheme = {
- name = "Adwaita";
+ name = config.theme.cursor.name;
size = config.theme.cursor.size;
};
gtk2.configLocation = "${config.xdg.configHome}/gtk-2.0/gtkrc";
diff --git a/modules/home/userdirs.nix b/modules/home/userdirs.nix
new file mode 100644
index 0000000..58c1d59
--- /dev/null
+++ b/modules/home/userdirs.nix
@@ -0,0 +1,5 @@
+{ userDetails, ... }: {
+ xdg.userDirs = {
+ enable = true;
+ } // userDetails.userDirs;
+}
diff --git a/modules/hosts/X230/configuration.nix b/modules/hosts/X230/configuration.nix
new file mode 100644
index 0000000..385b383
--- /dev/null
+++ b/modules/hosts/X230/configuration.nix
@@ -0,0 +1,14 @@
+{ config, lib, pkgs, ... }: {
+ imports = [
+ ./hardware-configuration.nix
+ ];
+ bootloader.mode = "efi";
+
+ # Enable extra software pkgs
+ software.desktop = {
+ crypto.enable = true;
+ office.enable = true;
+ };
+
+ system.stateVersion = "24.05";
+}
diff --git a/modules/hosts/X230/hardware-configuration.nix b/modules/hosts/X230/hardware-configuration.nix
new file mode 100644
index 0000000..0791585
--- /dev/null
+++ b/modules/hosts/X230/hardware-configuration.nix
@@ -0,0 +1,48 @@
+# 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" "ehci_pci" "ahci" "usb_storage" "sd_mod" "sdhci_pci" ];
+ boot.initrd.kernelModules = [ ];
+ boot.kernelModules = [ "kvm-intel" ];
+ boot.extraModulePackages = [ ];
+
+ fileSystems."/" =
+ { device = "/dev/disk/by-uuid/41036740-73bc-4004-a302-01233b4d83b8";
+ fsType = "btrfs";
+ options = [ "subvol=@" ];
+ };
+
+ boot.initrd.luks.devices."enc".device = "/dev/disk/by-uuid/6019772f-4a1c-4abd-9c70-b1d71cc2de65";
+
+ fileSystems."/home" =
+ { device = "/dev/disk/by-uuid/41036740-73bc-4004-a302-01233b4d83b8";
+ fsType = "btrfs";
+ options = [ "subvol=@home" ];
+ };
+
+ fileSystems."/boot" =
+ { device = "/dev/disk/by-uuid/72D4-F66A";
+ 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.enp0s25.useDHCP = lib.mkDefault true;
+ # networking.interfaces.wlp3s0.useDHCP = lib.mkDefault true;
+
+ nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
+ hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
+}
diff --git a/modules/hosts/X230/home.nix b/modules/hosts/X230/home.nix
new file mode 100644
index 0000000..87a16ea
--- /dev/null
+++ b/modules/hosts/X230/home.nix
@@ -0,0 +1,18 @@
+{ ... }: {
+ imports = [ ../../home ];
+
+ theme = {
+ mint.theme.color = "Dark-Teal";
+ mint.icons.color = "Teal";
+ font = {
+ monospace = "Tamzen";
+ gtk.name = "monospace";
+ gtk.size = 8;
+ };
+ cursor.size = 24;
+ st = {
+ enable = true;
+ font = "Tamzen:pixelsize=14";
+ };
+ };
+}
diff --git a/modules/hosts/hp-envy-office/home.nix b/modules/hosts/hp-envy-office/home.nix
index ed02130..2e4f61f 100644
--- a/modules/hosts/hp-envy-office/home.nix
+++ b/modules/hosts/hp-envy-office/home.nix
@@ -5,8 +5,8 @@
theme.mint.icons.color = "Green";
wallpapers.enable = true;
- additional-gtk-bookmarks = with userDetails; [
- "file://${home.documents}/src/sites/admin Admin"
+ additional-gtk-bookmarks = with userDetails.userDirs; [
+ "file://${documents}/src/sites/admin Admin"
"file:///media/chexx/chexx cHEXx"
];
}
diff --git a/modules/hosts/libreX60/bios-flashing.nix b/modules/hosts/libreX60/bios-flashing.nix
new file mode 100644
index 0000000..6117813
--- /dev/null
+++ b/modules/hosts/libreX60/bios-flashing.nix
@@ -0,0 +1,8 @@
+# https://libreboot.org/docs/install/#thinkpad-t60x60x60tabletx60s
+
+{ pkgs, ... }: {
+ environment.systemPackages = [ pkgs.flashprog ];
+
+ boot.kernelParams = [ "iomem=relaxed" ];
+}
+
diff --git a/modules/hosts/libreX60/configuration.nix b/modules/hosts/libreX60/configuration.nix
index b2acd8c..55f1774 100644
--- a/modules/hosts/libreX60/configuration.nix
+++ b/modules/hosts/libreX60/configuration.nix
@@ -1,5 +1,10 @@
{ config, lib, pkgs, ... }: {
- imports = [ ./hardware-configuration.nix ];
+ imports = [
+ ./hardware-configuration.nix
+ ./powertop-auto-tune.nix
+ # Uncomment this module and reboot to enable bios flashing
+ #./bios-flashing.nix
+ ];
# Use grub
bootloader = {
@@ -17,18 +22,5 @@
# i915 Gpu requires intel driver
services.xserver.videoDrivers = [ "intel" ];
- # Tamzen font in st
- nixpkgs.overlays = [
- (final: prev: {
- st = prev.st.overrideAttrs (old: {
- buildInputs = old.buildInputs or [] ++ [ pkgs.makeWrapper ];
- postInstall = old.postInstall or "" + ''
- wrapProgram $out/bin/st \
- --add-flags '-fTamzen:pixelsize=14'
- '';
- });
- })
- ];
-
system.stateVersion = "24.11";
}
diff --git a/modules/hosts/libreX60/home.nix b/modules/hosts/libreX60/home.nix
index 01496db..5b35457 100644
--- a/modules/hosts/libreX60/home.nix
+++ b/modules/hosts/libreX60/home.nix
@@ -10,5 +10,9 @@
gtk.size = 8;
};
cursor.size = 24;
+ st = {
+ enable = true;
+ font = "Tamzen:pixelsize=14";
+ };
};
}
diff --git a/modules/hosts/libreX60/powertop-auto-tune.nix b/modules/hosts/libreX60/powertop-auto-tune.nix
new file mode 100644
index 0000000..0eb9578
--- /dev/null
+++ b/modules/hosts/libreX60/powertop-auto-tune.nix
@@ -0,0 +1,17 @@
+# https://en.wikibooks.org/wiki/Libreboot/ThinkPad_X60#Remove_High_Pitched_Whining_Noise
+# TLDR; running `powertop --auto-tune` is supposed to kill the high pitched noises produced by the X60
+
+{ pkgs, ... }: {
+ environment.systemPackages = [ pkgs.powertop ];
+
+ # Create systemd service
+ systemd.services.powertop-autotune = {
+ description = "Powertop Auto-Tune";
+ wantedBy = [ "multi-user.target" ];
+ after = [ "network.target" ];
+ serviceConfig = {
+ Type = "oneshot";
+ ExecStart = "${pkgs.powertop}/bin/powertop --auto-tune";
+ };
+ };
+}
diff --git a/modules/hosts/optiplex/configuration.nix b/modules/hosts/optiplex/configuration.nix
index d018c02..16ba475 100644
--- a/modules/hosts/optiplex/configuration.nix
+++ b/modules/hosts/optiplex/configuration.nix
@@ -14,6 +14,9 @@
office.enable = true;
utilities.enable = true;
};
+ software.development = {
+ docker.enable = true;
+ };
# Install more programs
environment.systemPackages = with pkgs; [
@@ -36,6 +39,7 @@
nvidiaSettings = true;
open = false; # Not compatible w/ GTX-1050
package = config.boot.kernelPackages.nvidiaPackages.stable; # Still good for 1050
+ forceFullCompositionPipeline = true; # Enables vsync
};
# Disable suspend
diff --git a/modules/root/fonts.nix b/modules/root/fonts.nix
index 3ae8eef..256e1ab 100644
--- a/modules/root/fonts.nix
+++ b/modules/root/fonts.nix
@@ -7,10 +7,8 @@
fonts.packages = with pkgs; [
commit-mono
inter
+ nerd-fonts.jetbrains-mono
tamzen
- (nerdfonts.override {
- fonts = [ "JetBrainsMono" ];
- })
];
};
}
diff --git a/modules/root/normaluser.nix b/modules/root/normaluser.nix
index b4be0cc..88eb338 100644
--- a/modules/root/normaluser.nix
+++ b/modules/root/normaluser.nix
@@ -4,7 +4,7 @@
};
users.users.${userDetails.username} = {
description = userDetails.fullname;
- #home = userDetails.home.root;
+ #home = userDetails.home;
isNormalUser = true;
hashedPasswordFile = config.sops.secrets.hashed-root-password.path;
extraGroups = [
diff --git a/modules/root/printing.nix b/modules/root/printing.nix
index 69ff573..f0d0dd8 100644
--- a/modules/root/printing.nix
+++ b/modules/root/printing.nix
@@ -10,6 +10,7 @@
enable = true;
drivers = [
pkgs.epson-escpr2
+ pkgs.workcentre-7800-series
];
};
diff --git a/modules/root/resources/x11/xinit-startx-xdg.patch b/modules/root/resources/x11/xinit-startx-xdg.patch
deleted file mode 100644
index 2c2bf62..0000000
--- a/modules/root/resources/x11/xinit-startx-xdg.patch
+++ /dev/null
@@ -1,14 +0,0 @@
-diff --git a/startx.cpp b/startx.cpp
-index dfbebe1..472a1b0 100644
---- a/startx.cpp
-+++ b/startx.cpp
-@@ -272,7 +272,7 @@ if [ x"$enable_xauth" = x1 ] ; then
- dummy=0
-
- XCOMM create a file with auth information for the server. ':0' is a dummy.
-- xserverauthfile=$HOME/.serverauth.$$
-+ xserverauthfile="${XAUTHORITY:-$HOME/.Xauthority}.$$"
- trap "rm -f '$xserverauthfile'" HUP INT QUIT ILL TRAP BUS TERM
- xauth -q -f "$xserverauthfile" << EOF
- add :$dummy . $mcookie
-
diff --git a/modules/root/secrets.nix b/modules/root/secrets.nix
index 47262fd..045e3f4 100644
--- a/modules/root/secrets.nix
+++ b/modules/root/secrets.nix
@@ -4,7 +4,7 @@
sops = {
defaultSopsFile = ./resources/secrets/secrets.yaml;
defaultSopsFormat = "yaml";
- age.keyFile = "${userDetails.home.root}/.config/sops/age/keys.txt";
+ age.keyFile = "${userDetails.home}/.config/sops/age/keys.txt";
secrets = {
wpa_supplicant-conf = { };
diff --git a/modules/root/software/desktop.nix b/modules/root/software/desktop.nix
index b194029..dbcce1e 100644
--- a/modules/root/software/desktop.nix
+++ b/modules/root/software/desktop.nix
@@ -53,6 +53,7 @@
inkscape
] ++ pkgs.lib.optionals config.software.desktop.office.enable [
# Office
+ kdePackages.okular
libreoffice
pdfchain
thunderbird
diff --git a/modules/root/software/development.nix b/modules/root/software/development.nix
index 2a4dfba..af8a8a7 100644
--- a/modules/root/software/development.nix
+++ b/modules/root/software/development.nix
@@ -5,7 +5,7 @@
config = lib.mkIf config.software.development.enable {
environment.systemPackages = with pkgs; [
- adb-sync
+ #adb-sync
android-tools
gcc
git
@@ -14,5 +14,10 @@
lua
pkg-config
];
+
+ # Open 1313 for hugo serve
+ networking.firewall.allowedTCPPorts = [
+ 1313
+ ];
};
}
diff --git a/modules/root/software/overlays.nix b/modules/root/software/overlays.nix
index 670acfb..04ad398 100644
--- a/modules/root/software/overlays.nix
+++ b/modules/root/software/overlays.nix
@@ -2,15 +2,19 @@
nixpkgs.overlays = with pkgs; [
(final: prev: {
crazydiskinfo = (callPackage ./derivations/crazydiskinfo {});
- })
- (final: prev: {
- lowbat = (callPackage ./derivations/lowbat {});
- })
- (final: prev: {
- pavolctld = (callPackage ./derivations/pavolctld {});
- })
- (final: prev: {
- st = (callPackage ./derivations/st {});
+ lowbat = (callPackage ./derivations/lowbat {});
+ st = (callPackage ./derivations/st {});
+ workcentre-7800-series = (callPackage ./derivations/xerox-workcentre-7800-series-driver {});
+
+ # Use my vimv-rs until pr gets merged
+ vimv-rs = prev.vimv-rs.overrideAttrs (oldAttrs: {
+ src = fetchFromGitHub {
+ owner = "tjkeller-xyz";
+ repo = "vimv-rs";
+ rev = "5deb76fb81dd4acf3c4809087ff3a1d846ab4769";
+ sha256 = "sha256-XMn+5mIxSEHaR31ixMi6o7PSkN1iYjDT4aOiQkfEwpA=";
+ };
+ });
})
];
}
diff --git a/modules/root/software/utilities.nix b/modules/root/software/utilities.nix
index 9bd76a6..79285a1 100644
--- a/modules/root/software/utilities.nix
+++ b/modules/root/software/utilities.nix
@@ -25,6 +25,7 @@
testdisk
tmux
uhubctl
+ vimv-rs
wget
wireguard-tools
xxHash
diff --git a/modules/root/x11.nix b/modules/root/x11.nix
index 7311cba..b7b23ae 100644
--- a/modules/root/x11.nix
+++ b/modules/root/x11.nix
@@ -8,6 +8,30 @@
services.xserver.displayManager.startx.enable = true;
services.libinput.enable = true; # Enable touchpad support
+ # Apply startx patch to create serverauth file in /tmp instead of home directory
+ nixpkgs.overlays = with pkgs; [
+ (final: prev: {
+ xorg = prev.xorg // {
+ xinit = (prev.xorg.xinit.overrideAttrs (oldAttrs: rec {
+ version = "1.4.4";
+ patchtag = "${version}-1"; # Archlinux xinit package tagged release to fetch patch from
+ # Override src since is hardcoded to 1.4.2
+ src = prev.fetchurl {
+ url = "mirror://xorg/individual/app/xinit-${version}.tar.xz";
+ sha256 = "sha256-QKR8ehZMf5gc43h7Szf35BH7QyMdzeVD1wCUB12s/vk=";
+ };
+ patches = [
+ (prev.fetchpatch {
+ url = "https://gitlab.archlinux.org/archlinux/packaging/packages/xorg-xinit/-/raw/${patchtag}/06_move_serverauthfile_into_tmp.diff";
+ sha256 = "1whzs5bw7ph12r3abs1g9fydibkr291jh56a0zp17d4x070jnkda";
+ })
+ ];
+ }));
+ };
+ })
+ ];
+
+ # Install basic X utilities
environment.systemPackages = with pkgs; [
unclutter
xcape
@@ -19,12 +43,12 @@
xorg.xrandr
xorg.xset
xwallpaper
- # Patch startx to be compliant with xdg base dir spec
- #(xorg.xinit.overrideAttrs (old: rec {
- # patches = [
- # ./resources/x11/xinit-startx-xdg.patch
- # ];
- #}))
];
+
+ # Enable TearFree option by default
+ # Not all video drivers support this option
+ services.xserver.deviceSection = ''
+ Option "TearFree" "true"
+ '';
};
}