summaryrefslogtreecommitdiff
path: root/modules/root
diff options
context:
space:
mode:
Diffstat (limited to 'modules/root')
-rw-r--r--modules/root/bluetooth.nix2
-rw-r--r--modules/root/default.nix2
-rw-r--r--modules/root/hosts.nix4
-rw-r--r--modules/root/resources/x11/xinit-startx-xdg.patch2
-rw-r--r--modules/root/software/system.nix1
-rw-r--r--modules/root/software/utilities.nix1
-rw-r--r--modules/root/suspend.nix16
7 files changed, 25 insertions, 3 deletions
diff --git a/modules/root/bluetooth.nix b/modules/root/bluetooth.nix
index d55eade..1f41c7e 100644
--- a/modules/root/bluetooth.nix
+++ b/modules/root/bluetooth.nix
@@ -3,7 +3,7 @@
bluetooth.enable = lib.mkEnableOption "enables bluetooth support";
};
- config = {
+ config = lib.mkIf config.bluetooth.enable {
hardware.bluetooth.enable = true;
services.blueman.enable = true;
};
diff --git a/modules/root/default.nix b/modules/root/default.nix
index e108318..5397ec4 100644
--- a/modules/root/default.nix
+++ b/modules/root/default.nix
@@ -17,6 +17,7 @@
./printing.nix
./secrets.nix
./ssh.nix
+ ./suspend.nix
./tlp.nix
./wifi.nix
./x11.nix
@@ -44,6 +45,7 @@
printing.enable = lib.mkDefault true;
tlp.enable = lib.mkDefault true;
scanning.enable = lib.mkDefault true;
+ suspend.enable = lib.mkDefault true;
wifi.enable = lib.mkDefault true;
xserver.enable = lib.mkDefault true;
zsh.enable = lib.mkDefault true;
diff --git a/modules/root/hosts.nix b/modules/root/hosts.nix
index 14daaf1..b9f9d6e 100644
--- a/modules/root/hosts.nix
+++ b/modules/root/hosts.nix
@@ -1,10 +1,12 @@
-{
+{ hostname, ... }: {
+ networking.hostName = hostname; # From flake.nix
networking.hosts = {
"192.168.1.9" = [ "optiplex" ];
"192.168.1.30" = [ "localgit" ];
"192.168.1.11" = [ "truenas-home" ];
"192.168.77.11" = [ "truenas-office" ];
"192.168.77.8" = [ "publicgit" "tjkeller" ];
+ "192.168.77.3" = [ "devel" ];
"173.9.253.3" = [
"git.tjkeller.xyz"
"piped.tjkeller.xyz"
diff --git a/modules/root/resources/x11/xinit-startx-xdg.patch b/modules/root/resources/x11/xinit-startx-xdg.patch
index c1bca97..2c2bf62 100644
--- a/modules/root/resources/x11/xinit-startx-xdg.patch
+++ b/modules/root/resources/x11/xinit-startx-xdg.patch
@@ -7,7 +7,7 @@ index dfbebe1..472a1b0 100644
XCOMM create a file with auth information for the server. ':0' is a dummy.
- xserverauthfile=$HOME/.serverauth.$$
-+ xserverauthfile="${XAUTHORITY:-$HOME/.Xauthority}"
++ 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/software/system.nix b/modules/root/software/system.nix
index f0a31f2..4c81596 100644
--- a/modules/root/software/system.nix
+++ b/modules/root/software/system.nix
@@ -5,6 +5,7 @@
dash # TODO should be default /bin/sh
exfat
git # Needed for home-manager
+ ntfs3g
python3
sops # Secrets
];
diff --git a/modules/root/software/utilities.nix b/modules/root/software/utilities.nix
index dabf163..7622461 100644
--- a/modules/root/software/utilities.nix
+++ b/modules/root/software/utilities.nix
@@ -26,6 +26,7 @@
wireguard-tools
xxHash
yt-dlp
+ (callPackage ./derivations/crazydiskinfo {})
(callPackage ./derivations/lowbat {})
(callPackage ./derivations/pavolctld {})
];
diff --git a/modules/root/suspend.nix b/modules/root/suspend.nix
new file mode 100644
index 0000000..814ae95
--- /dev/null
+++ b/modules/root/suspend.nix
@@ -0,0 +1,16 @@
+{ lib, config, ... }: {
+ options = {
+ suspend.enable = lib.mkEnableOption "enables suspend";
+ };
+
+ config = lib.mkIf (! config.suspend.enable) {
+ # Disable suspend targets
+ systemd.targets = builtins.listToAttrs (map (name: {
+ inherit name;
+ value = {
+ enable = false;
+ unitConfig.DefaultDependencies = "no";
+ };
+ }) ["sleep" "suspend" "hibernate" "hybrid-sleep"]);
+ };
+}