summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSkullheadx <andrew.montgomery@warpengine.ai>2026-06-29 15:27:25 -0400
committerSkullheadx <andrew.montgomery@warpengine.ai>2026-06-29 15:27:25 -0400
commit3c6ebd9f6cc68733a5c473b4eb1dffcc0d425004 (patch)
treef19308568b0ac7a282448c9ec260852dd2874df2
parentswitch to name - system pattern (diff)
downloadnixos-3c6ebd9f6cc68733a5c473b4eb1dffcc0d425004.tar.gz
nixos-3c6ebd9f6cc68733a5c473b4eb1dffcc0d425004.tar.bz2
nixos-3c6ebd9f6cc68733a5c473b4eb1dffcc0d425004.zip
try modules
-rw-r--r--flake.nix6
-rw-r--r--hosts/nepsis/configuration.nix5
-rw-r--r--lockscreen.nix26
-rw-r--r--modules/linux/default.nix6
-rw-r--r--modules/linux/lockscreen.nix31
-rw-r--r--modules/linux/x11.nix138
-rw-r--r--x11.nix131
7 files changed, 184 insertions, 159 deletions
diff --git a/flake.nix b/flake.nix
index cf4607e..8ba8193 100644
--- a/flake.nix
+++ b/flake.nix
@@ -71,6 +71,10 @@
packages.${system}.nvim = nvim.neovim;
packages.${system-darwin}.nvim = nvim-darwin.neovim;
+ nixosModules = {
+ linux = ./modules/linux;
+ };
+
nixosConfigurations = {
nepsis = nixpkgs.lib.nixosSystem {
specialArgs = {
@@ -79,6 +83,7 @@
};
modules = [
hjem.nixosModules.default
+ self.nixosModules.linux
./common-linux.nix
./hosts/nepsis/configuration.nix
./overlays.nix
@@ -91,6 +96,7 @@
};
modules = [
hjem.nixosModules.default
+ self.nixosModules.linux
./common-linux.nix
./hosts/icon/configuration.nix
./overlays.nix
diff --git a/hosts/nepsis/configuration.nix b/hosts/nepsis/configuration.nix
index c7ef1f0..3c59824 100644
--- a/hosts/nepsis/configuration.nix
+++ b/hosts/nepsis/configuration.nix
@@ -6,13 +6,14 @@
}: {
imports = [
./hardware-configuration.nix
- ./../../lockscreen.nix
- ./../../x11.nix
./../../hjem-linux.nix
./../../audio.nix
./../../vim.nix
];
+ my.lockscreen.enable = true;
+ my.x11.enable = true;
+
networking.hostName = "nepsis";
# networking.extraHosts = ''
# 0.0.0.0 youtube.com
diff --git a/lockscreen.nix b/lockscreen.nix
deleted file mode 100644
index d5b395a..0000000
--- a/lockscreen.nix
+++ /dev/null
@@ -1,26 +0,0 @@
-{
- config,
- pkgs,
- ...
-}: {
- # List packages installed in system profile. To search, run:
- # $ nix search wget
- environment.systemPackages = with pkgs; [
- betterlockscreen
- lock-screen
- ];
-
- programs.i3lock = {
- enable = true;
- package = pkgs.i3lock-color;
- };
- security.pam.services.betterlockscreen = {};
- services.xserver = {
- xautolock = {
- enable = true;
- enableNotifier = true;
- notifier = "${pkgs.dunst}/bin/notify-send 'Locking in 10 seconds'";
- locker = "${pkgs.betterlockscreen}/bin/betterlockscreen -l dimblur";
- };
- };
-}
diff --git a/modules/linux/default.nix b/modules/linux/default.nix
new file mode 100644
index 0000000..8fbdb2f
--- /dev/null
+++ b/modules/linux/default.nix
@@ -0,0 +1,6 @@
+{
+ imports = [
+ ./lockscreen.nix
+ ./x11.nix
+ ];
+}
diff --git a/modules/linux/lockscreen.nix b/modules/linux/lockscreen.nix
new file mode 100644
index 0000000..d3ddbd4
--- /dev/null
+++ b/modules/linux/lockscreen.nix
@@ -0,0 +1,31 @@
+{
+ config,
+ lib,
+ pkgs,
+ ...
+}: let
+ cfg = config.my.lockscreen;
+in {
+ options.my.lockscreen.enable = lib.mkEnableOption "betterlockscreen with xautolock";
+
+ config = lib.mkIf cfg.enable {
+ environment.systemPackages = with pkgs; [
+ betterlockscreen
+ lock-screen
+ ];
+
+ programs.i3lock = {
+ enable = true;
+ package = pkgs.i3lock-color;
+ };
+
+ security.pam.services.betterlockscreen = {};
+
+ services.xserver.xautolock = {
+ enable = true;
+ enableNotifier = true;
+ notifier = "${pkgs.dunst}/bin/notify-send 'Locking in 10 seconds'";
+ locker = "${pkgs.betterlockscreen}/bin/betterlockscreen -l dimblur";
+ };
+ };
+}
diff --git a/modules/linux/x11.nix b/modules/linux/x11.nix
new file mode 100644
index 0000000..22076ec
--- /dev/null
+++ b/modules/linux/x11.nix
@@ -0,0 +1,138 @@
+{
+ config,
+ lib,
+ pkgs,
+ username,
+ ...
+}: let
+ cfg = config.my.x11;
+in {
+ options.my.x11.enable = lib.mkEnableOption "X11 + dwm + sxhkd + slstatus";
+
+ config = lib.mkIf cfg.enable {
+ services.displayManager.ly = {
+ enable = true;
+ settings = {
+ animation = "gameoflife";
+ clock = "%c";
+ vi_mode = true;
+ vi_default_mode = "insert";
+ numlock = true;
+ bigclock = "en";
+ bigclock_seconds = true;
+ };
+ };
+
+ services.dunst = {
+ enable = true;
+ };
+
+ services.xserver = {
+ enable = true;
+ autorun = true;
+ enableTearFree = true;
+ windowManager.dwm.enable = true;
+ desktopManager.runXdgAutostartIfNone = false;
+ displayManager = {
+ setupCommands = "";
+ sessionCommands = ''
+ #!/bin/sh
+ ${pkgs.xrandr}/bin/xrandr --output DP-3 --primary --mode 2560x1440 --rate 180 --pos 0x0 --output DP-2 --mode 1920x1080 --rate 160 --pos 2560x360
+ ${pkgs.feh}/bin/feh --no-fehbg --bg-fill '/home/${username}/Wallpapers/Daniel_in_the_Lions_Den_by_Briton_Riviere.jpg'
+ '';
+ };
+ xkb = {
+ layout = "us";
+ options = "caps:escape";
+ };
+ config = ''
+ Section "InputClass"
+ Identifier "Kinesis Advantage 360"
+ MatchIsKeyboard "on"
+ MatchVendor "Kinesis"
+ Option "XkbModel" "kinesis"
+ Option "XkbLayout" "us"
+ EndSection
+ '';
+ };
+
+ services.picom = {
+ enable = true;
+ };
+
+ hjem.users.${username} = {
+ files = {
+ ".config/sxhkd/sxhkdrc".text = builtins.readFile (
+ pkgs.replaceVars ../../dotfiles/sxhkd/sxhkdrc {
+ dmenu = pkgs.dmenu;
+ st = pkgs.st;
+ surf = pkgs.surf;
+ pamixer = pkgs.pamixer;
+ maim = pkgs.maim;
+ xdotool = pkgs.xdotool;
+ xclip = pkgs.xclip;
+ lockscreen = pkgs.lock-screen;
+ sfeed = pkgs.sfeed;
+ rmpc = pkgs.rmpc;
+ mpc = pkgs.mpc;
+ librewolf = pkgs.librewolf;
+ }
+ );
+ };
+ };
+
+ systemd.user.services.sxhkd = {
+ description = "Simple X Hot Key Daemon (sxhkd)";
+
+ path = with pkgs; [
+ dmenu
+ st
+
+ pamixer
+
+ maim
+ xdotool
+ xclip
+
+ lock-screen
+
+ sfeed
+
+ rmpc
+ mpc
+
+ surf
+ librewolf
+ surf_search
+ ];
+
+ environment = {
+ SFEED_PLUMBER = "surf";
+ SFEED_URL_FILE = "/home/${username}/.local/share/sfeed/sfeed_read_url_file";
+ };
+
+ serviceConfig = {
+ ExecStart = "${pkgs.sxhkd}/bin/sxhkd";
+ Restart = "on-failure";
+ };
+ wantedBy = ["graphical-session.target"];
+ };
+
+ systemd.user.services.slstatus = {
+ description = "slstatus bar";
+ wantedBy = ["graphical-session.target"];
+
+ path = with pkgs; [
+ pamixer
+ scrolling-title
+ ];
+
+ serviceConfig = {
+ ExecStart = "${pkgs.slstatus}/bin/slstatus";
+
+ Restart = "always";
+ RestartSec = "1s";
+ };
+ };
+ };
+}
diff --git a/x11.nix b/x11.nix
deleted file mode 100644
index b1483e9..0000000
--- a/x11.nix
+++ /dev/null
@@ -1,131 +0,0 @@
-{
- config,
- pkgs,
- username,
- ...
-}: {
- services.displayManager.ly = {
- enable = true;
- settings = {
- animation = "gameoflife";
- clock = "%c";
- vi_mode = true;
- vi_default_mode = "insert";
- numlock = true;
- bigclock = "en";
- bigclock_seconds = true;
- };
- };
-
- services.dunst = {
- enable = true;
- };
-
- services.xserver = {
- enable = true;
- autorun = true;
- enableTearFree = true;
- windowManager.dwm.enable = true;
- desktopManager.runXdgAutostartIfNone = false;
- displayManager = {
- setupCommands = "";
- sessionCommands = ''
- #!/bin/sh
- ${pkgs.xrandr}/bin/xrandr --output DP-3 --primary --mode 2560x1440 --rate 180 --pos 0x0 --output DP-2 --mode 1920x1080 --rate 160 --pos 2560x360
- ${pkgs.feh}/bin/feh --no-fehbg --bg-fill '/home/${username}/Wallpapers/Daniel_in_the_Lions_Den_by_Briton_Riviere.jpg'
- '';
- };
- xkb = {
- layout = "us";
- options = "caps:escape";
- };
- config = ''
- Section "InputClass"
- Identifier "Kinesis Advantage 360"
- MatchIsKeyboard "on"
- MatchVendor "Kinesis"
- Option "XkbModel" "kinesis"
- Option "XkbLayout" "us"
- EndSection
- '';
- };
-
- services.picom = {
- enable = true;
- };
-
- hjem.users.${username} = {
- files = {
- ".config/sxhkd/sxhkdrc".text = builtins.readFile (
- pkgs.replaceVars ./dotfiles/sxhkd/sxhkdrc {
- dmenu = pkgs.dmenu;
- st = pkgs.st;
- surf = pkgs.surf;
- pamixer = pkgs.pamixer;
- maim = pkgs.maim;
- xdotool = pkgs.xdotool;
- xclip = pkgs.xclip;
- lockscreen = pkgs.lock-screen;
- sfeed = pkgs.sfeed;
- rmpc = pkgs.rmpc;
- mpc = pkgs.mpc;
- librewolf = pkgs.librewolf;
- }
- );
- };
- };
-
- systemd.user.services.sxhkd = {
- description = "Simple X Hot Key Daemon (sxhkd)";
-
- path = with pkgs; [
- dmenu
- st
-
- pamixer
-
- maim
- xdotool
- xclip
-
- lock-screen
-
- sfeed
-
- rmpc
- mpc
-
- surf
- librewolf
- surf_search
- ];
-
- environment = {
- SFEED_PLUMBER = "surf";
- SFEED_URL_FILE = "/home/${username}/.local/share/sfeed/sfeed_read_url_file";
- };
-
- serviceConfig = {
- ExecStart = "${pkgs.sxhkd}/bin/sxhkd";
- Restart = "on-failure";
- };
- wantedBy = ["graphical-session.target"];
- };
-
- systemd.user.services.slstatus = {
- description = "slstatus bar";
- wantedBy = ["graphical-session.target"];
-
- path = with pkgs; [
- pamixer
- scrolling-title
- ];
-
- serviceConfig = {
- ExecStart = "${pkgs.slstatus}/bin/slstatus";
-
- Restart = "always";
- RestartSec = "1s";
- };
- };
-}