summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/home/default.nix6
-rw-r--r--modules/home/firefox.nix27
-rw-r--r--modules/home/gtk-bookmarks.nix8
-rw-r--r--modules/home/initial-home-setup.nix4
-rw-r--r--modules/home/resources/activation-scripts/clone-repos.sh8
-rw-r--r--modules/hosts/T430/configuration.nix1
-rw-r--r--modules/hosts/T430/home.nix1
-rw-r--r--modules/hosts/T495/configuration.nix8
-rw-r--r--modules/hosts/hp-envy-office/configuration.nix5
-rw-r--r--modules/hosts/libreX60/configuration.nix1
-rw-r--r--modules/hosts/optiplex/configuration.nix13
-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/software/system.nix1
-rw-r--r--modules/root/software/utilities.nix1
-rw-r--r--modules/root/suspend.nix16
17 files changed, 60 insertions, 48 deletions
diff --git a/modules/home/default.nix b/modules/home/default.nix
index b44f360..8748fb9 100644
--- a/modules/home/default.nix
+++ b/modules/home/default.nix
@@ -1,12 +1,11 @@
-{ lib, userDetails, ... }: {
+{ lib, userDetails, homeStateVersion, ... }: {
home = {
username = userDetails.username;
homeDirectory = userDetails.home.root;
- stateVersion = "24.05";
+ stateVersion = homeStateVersion;
};
imports = [
- ./alacritty.nix
#./chrome.nix
./firefox.nix
./git.nix
@@ -18,7 +17,6 @@
./wallpapers.nix
];
- alacritty.enable = lib.mkDefault true;
theme.mint.enable = lib.mkDefault true;
wallpapers.enable = lib.mkDefault false;
}
diff --git a/modules/home/firefox.nix b/modules/home/firefox.nix
index 5e015ff..9d4bb4e 100644
--- a/modules/home/firefox.nix
+++ b/modules/home/firefox.nix
@@ -1,29 +1,33 @@
{ pkgs, userDetails, ... }: {
programs.firefox = {
- # TODO see if there is way to login to moz account in profile
enable = true;
- arkenfox = {
- enable = true;
- };
+ arkenfox.enable = true;
profiles = let
search = {
engines = {
"Timmy Search" = {
- urls = [{ template = "https://search.tjkeller.xyz/search?q={searchTerms}"; }]; # Don't know how to do w/ POST but I prefer GET anyways
+ urls = [{
+ template = "https://search.tjkeller.xyz/search";
+ params = [ { name = "q"; value = "{searchTerms}"; } ];
+ }];
iconURI = "https://search.tjkeller.xyz/static/themes/simple/img/favicon.svg"; # TODO doesn't seem to work
};
"Nix Packages" = {
urls = [{
template = "https://search.nixos.org/packages";
- params = [
- { name = "type"; value = "packages"; }
- { name = "query"; value = "{searchTerms}"; }
- ];
+ params = [ { name = "query"; value = "{searchTerms}"; } ];
}];
-
icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
definedAliases = [ "@np" ];
};
+ "NixOS Options" = {
+ urls = [{
+ template = "https://search.nixos.org/options";
+ params = [ { name = "query"; value = "{searchTerms}"; } ];
+ }];
+ icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
+ definedAliases = [ "@no" ];
+ };
};
default = "Timmy Search";
privateDefault = "Timmy Search";
@@ -46,7 +50,7 @@
"app.normandy.first_run" = false;
"browser.aboutConfig.showWarning" = false; # arkenfox does
- "browser.download.dir" = userDetails.home.downloads; # FF will create this dir if it doesn't exist
+ "browser.download.dir" = userDetails.home.downloads;
"browser.newtabpage.activity-stream.feeds.section.topstories" = false;
"browser.newtabpage.activity-stream.feeds.topsites" = false;
"browser.urlbar.suggest.topsites" = false;
@@ -54,7 +58,6 @@
"dom.push.enabled" = false; #
"extensions.pocket.enabled" = false;
"general.smoothScroll" = false;
- #identity.fxaccounts.account.device.name = "timmy’s Firefox on nixos"; # HOSTNAME
};
workSettings = settings // {
"extensions.activeThemeID" = "firefox-compact-dark@mozilla.org"; # Use builtin dark theme instead of system theme
diff --git a/modules/home/gtk-bookmarks.nix b/modules/home/gtk-bookmarks.nix
index 067543d..e6c1ec7 100644
--- a/modules/home/gtk-bookmarks.nix
+++ b/modules/home/gtk-bookmarks.nix
@@ -8,10 +8,10 @@
};
config = {
- gtk.gtk3.bookmarks = with userDetails; [
- "file://${home.downloads} Downloads"
- "file://${home.documents} Documents"
- "file://${home.pictures} Pictures"
+ gtk.gtk3.bookmarks = with userDetails.home; [
+ "file://${downloads} Downloads"
+ "file://${documents} Documents"
+ "file://${pictures} Pictures"
] ++ config.additional-gtk-bookmarks;
};
}
diff --git a/modules/home/initial-home-setup.nix b/modules/home/initial-home-setup.nix
index 046f5a5..6aa6ac7 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 = lib.hm.dag.entryAfter ["writeBoundary"] ''
- run mkdir -p $VERBOSE_ARG "${userDetails.home.downloads}"
+ createDirs = with userDetails.home; lib.hm.dag.entryAfter ["writeBoundary"] ''
+ run mkdir -p $VERBOSE_ARG "${downloads}" "${documents}" "${pictures}"
'';
};
}
diff --git a/modules/home/resources/activation-scripts/clone-repos.sh b/modules/home/resources/activation-scripts/clone-repos.sh
index 887968b..eaee4dc 100644
--- a/modules/home/resources/activation-scripts/clone-repos.sh
+++ b/modules/home/resources/activation-scripts/clone-repos.sh
@@ -3,8 +3,14 @@
server="https://git.tjkeller.xyz/"
clonemissing() {
+ # pull and return if already existing
+ if [ -d "$2"/.git ]; then
+ run cd $VERBOSE_ARG "$2"
+ run git pull $VERBOSE_ARG || echo "$2: failed to pull from remote"
+ return
+ fi
+
# clone to $2
- [ -d "$2"/.git ] && return
run mkdir -p $VERBOSE_ARG "$2"
run git clone $VERBOSE_ARG "$server$1" "$2"
diff --git a/modules/hosts/T430/configuration.nix b/modules/hosts/T430/configuration.nix
index 282515d..7910275 100644
--- a/modules/hosts/T430/configuration.nix
+++ b/modules/hosts/T430/configuration.nix
@@ -1,6 +1,5 @@
{ config, lib, pkgs, ... }: {
imports = [ ./hardware-configuration.nix ];
- networking.hostName = "T430";
# TODO this does not function
#boot.initrd.systemd.extraBin = {
diff --git a/modules/hosts/T430/home.nix b/modules/hosts/T430/home.nix
index 9885a06..15df79a 100644
--- a/modules/hosts/T430/home.nix
+++ b/modules/hosts/T430/home.nix
@@ -1,6 +1,5 @@
{ ... }: {
imports = [ ../../home ];
- alacritty.font.size = 9;
wallpapers.enable = true;
}
diff --git a/modules/hosts/T495/configuration.nix b/modules/hosts/T495/configuration.nix
index 526b7bb..6ee62e9 100644
--- a/modules/hosts/T495/configuration.nix
+++ b/modules/hosts/T495/configuration.nix
@@ -2,11 +2,9 @@
imports = [
./hardware-configuration.nix
./games.nix
- ./input-leap.nix
+ #./input-leap.nix
./wg.nix
];
- networking.hostName = "T495";
-
bootloader.mode = "efi";
# Enable extra software pkgs
@@ -27,10 +25,6 @@
nas.office.enable = true;
nas.office.automount = false;
- networking.hosts = {
- "192.168.77.3" = [ "devel" ];
- };
-
# Use amdgpu driver for x11
services.xserver.videoDrivers = [ "amdgpu" ];
diff --git a/modules/hosts/hp-envy-office/configuration.nix b/modules/hosts/hp-envy-office/configuration.nix
index 9a7a43a..fdff4f0 100644
--- a/modules/hosts/hp-envy-office/configuration.nix
+++ b/modules/hosts/hp-envy-office/configuration.nix
@@ -1,8 +1,5 @@
{ config, lib, pkgs, ... }: {
- imports = [
- ./hardware-configuration.nix
- ];
- networking.hostName = "hp-envy-office";
+ imports = [ ./hardware-configuration.nix ];
# Enable extra software pkgs
software.desktop = {
diff --git a/modules/hosts/libreX60/configuration.nix b/modules/hosts/libreX60/configuration.nix
index 942793d..38500a6 100644
--- a/modules/hosts/libreX60/configuration.nix
+++ b/modules/hosts/libreX60/configuration.nix
@@ -1,6 +1,5 @@
{ config, lib, pkgs, ... }: {
imports = [ ./hardware-configuration.nix ];
- networking.hostName = "libreX60";
# Enable extra software pkgs
software.desktop = {
diff --git a/modules/hosts/optiplex/configuration.nix b/modules/hosts/optiplex/configuration.nix
index cbde612..d018c02 100644
--- a/modules/hosts/optiplex/configuration.nix
+++ b/modules/hosts/optiplex/configuration.nix
@@ -1,9 +1,5 @@
{ config, lib, pkgs, ... }: {
- imports = [
- ./hardware-configuration.nix
- ];
- networking.hostName = "optiplex";
-
+ imports = [ ./hardware-configuration.nix ];
bootloader.mode = "efi";
# Allow unfree for nvidia + others
@@ -32,10 +28,6 @@
# Disable wifi
wifi.enable = false;
- networking.hosts = {
- "192.168.77.3" = [ "devel" ];
- };
-
# Use nvidia driver
services.xserver.videoDrivers = [ "nvidia" ];
hardware.nvidia = {
@@ -46,5 +38,8 @@
package = config.boot.kernelPackages.nvidiaPackages.stable; # Still good for 1050
};
+ # Disable suspend
+ suspend.enable = false;
+
system.stateVersion = "24.11";
}
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/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"]);
+ };
+}