From 70efa84ed6f988b9d19a919e746cb3a931d97d87 Mon Sep 17 00:00:00 2001 From: Benedikt Peetz Date: Tue, 4 Feb 2025 11:12:51 +0100 Subject: refactor(flake/nixosModules/common.nix): Move to `modules/common` This file is commonly edited, when a module is changed. As such moving it to the `modules` directory, is an obvious decision. --- flake/nixosConfigurations/abstract-nord.png | Bin 140219 -> 0 bytes flake/nixosConfigurations/common.nix | 197 ---------------------------- flake/nixosConfigurations/default.nix | 2 +- modules/common/abstract-nord.png | Bin 0 -> 140219 bytes modules/common/default.nix | 197 ++++++++++++++++++++++++++++ 5 files changed, 198 insertions(+), 198 deletions(-) delete mode 100644 flake/nixosConfigurations/abstract-nord.png delete mode 100644 flake/nixosConfigurations/common.nix create mode 100644 modules/common/abstract-nord.png create mode 100644 modules/common/default.nix diff --git a/flake/nixosConfigurations/abstract-nord.png b/flake/nixosConfigurations/abstract-nord.png deleted file mode 100644 index 5ef498bf..00000000 Binary files a/flake/nixosConfigurations/abstract-nord.png and /dev/null differ diff --git a/flake/nixosConfigurations/common.nix b/flake/nixosConfigurations/common.nix deleted file mode 100644 index 232c329d..00000000 --- a/flake/nixosConfigurations/common.nix +++ /dev/null @@ -1,197 +0,0 @@ -# This file contains common configuration applied to every host. -# It should only `enable` options defined in the `modules/by-name` directory. -{ - config, - pkgs, - lib, - ... -}: { - soispha = { - boot.enable = true; - cleanup.enable = true; - documentation.enable = true; - - fonts = { - enable = true; - enableEmoji = true; - }; - - home-manager.enable = true; - impermanence = { - enable = true; - - directories = [ - "/etc/nixos" - "/var/log" - "/var/lib/systemd" - "/var/lib/nixos" - ]; - }; - polkit.enable = true; - power.enable = true; - - services = { - adb = { - enable = true; - user = "soispha"; - }; - fwupd.enable = true; - mpd = { - enable = true; - directories = let - data = "${config.home-manager.users.soispha.xdg.dataHome}/mpd"; - in { - inherit data; - playlists = "${data}/playlists"; - runtime = "/run/user/${builtins.toString config.users.users.soispha.uid}/mpd"; - music = config.home-manager.users.soispha.programs.beets.settings.directory; - }; - mpc = { - enable = true; - beetsPkg = config.home-manager.users.soispha.programs.beets.package; - }; - }; - ollama.enable = false; - postgresql.enable = false; - printing.enable = true; - scanning.enable = true; - snapper.enable = true; - steam.enable = false; - systemDiff.enable = true; - unison = { - enable = true; - - foreign.userName = "soispha"; - dataDir = "${config.home-manager.users.soispha.xdg.dataHome}/unison"; - userSourceDir = "/srv/home/soispha"; - pathsToIgnore = let - extractTarget = attr: "~/${attr.target}"; - homeManagerSymlinks = - builtins.map extractTarget - (builtins.attrValues - config.home-manager.users.soispha.home.file); - in - [ - # already synchronized by the taskserver - "~/.local/share/task" - - # Should not be synchronized - "~/.local/share/unison" - - # Is just to big to be synchronized (# TODO: Work around that <2024-08-31> ) - "~/media/music" - ] - ++ homeManagerSymlinks; - - pathsToSync = [ - "~/.local/state/mpv" - "~/.local/state/nvim" - "~/.local/share" - "~/.local/.Trash-1000" - - "~/.mozilla/firefox" - - "~/media" - "~/school" - "~/repos" - ]; - }; - }; - - programs = { - nvim = { - enable = true; - shell = pkgs.zsh; - }; - atuin.enable = true; - direnv.enable = true; - git.enable = true; - imv.enable = true; - less.enable = true; - lf.enable = true; - river = { - enable = true; - init = { - rules = [ - { - app-id = "float"; - title = "*"; - action = "float"; - } - { - app-id = "mpv"; - title = "*"; - action = "float"; - } - { - app-id = "ModernGL"; - title = "*"; - action = "float"; - } - { - app-id = "*"; - title = "Manim Slides"; - action = "float"; - } - { - app-id = "*"; - title = "floating please"; - action = "float"; - } - - { - app-id = "*"; - title = "*"; - action = "ssd"; - } - # This remove the focus border around Firefox (which is useful because the Firefox is nearly always in its own tag.) - { - app-id = "firefox"; - title = "*"; - action = "csd"; - } - ]; - generalSettings = { - # background - background-color = "0x002b36"; - border-color-focused = "0x93a1a1"; - border-color-unfocused = "0x586e75"; - - # keyboard repeat rate - set-repeat = ["50" "300"]; - - # Cursor - focus-follows-cursor = "normal"; - # hide-cursor = ["timeout" "2000"]; - hide-cursor = ["when-typing" "enabled"]; - set-cursor-warp = "on-output-change"; - xcursor-theme = ["Nordzy-cursors" "24"]; - }; - inputs = { - pointer-1133-49970-Logitech_Gaming_Mouse_G502 = [["pointer-accel" "0"] ["accel-profile" "none"]]; - pointer-12951-6505-ZSA_Technology_Labs_Moonlander_Mark_I = [["pointer-accel" "0"] ["accel-profile" "none"]]; - }; - backgroundStart = [ - pkgs.gammastep - pkgs.yambar - - pkgs.mako - ["${lib.getExe pkgs.swaybg}" "--image" "${./abstract-nord.png}"] - pkgs.swayidle - pkgs.alacritty - ]; - }; - }; - mpv.enable = true; - swaylock.enable = true; - taskwarrior.enable = true; - yambar.enable = true; - yt.enable = true; - zathura.enable = true; - zsh.enable = true; - }; - - sound.enable = true; - version.enable = true; - }; -} diff --git a/flake/nixosConfigurations/default.nix b/flake/nixosConfigurations/default.nix index 59720c76..0c2f8c90 100644 --- a/flake/nixosConfigurations/default.nix +++ b/flake/nixosConfigurations/default.nix @@ -39,7 +39,7 @@ serverphone.nixosModules.default ../../modules - ./common.nix + ../../modules/common ]; specialArgs = { diff --git a/modules/common/abstract-nord.png b/modules/common/abstract-nord.png new file mode 100644 index 00000000..5ef498bf Binary files /dev/null and b/modules/common/abstract-nord.png differ diff --git a/modules/common/default.nix b/modules/common/default.nix new file mode 100644 index 00000000..232c329d --- /dev/null +++ b/modules/common/default.nix @@ -0,0 +1,197 @@ +# This file contains common configuration applied to every host. +# It should only `enable` options defined in the `modules/by-name` directory. +{ + config, + pkgs, + lib, + ... +}: { + soispha = { + boot.enable = true; + cleanup.enable = true; + documentation.enable = true; + + fonts = { + enable = true; + enableEmoji = true; + }; + + home-manager.enable = true; + impermanence = { + enable = true; + + directories = [ + "/etc/nixos" + "/var/log" + "/var/lib/systemd" + "/var/lib/nixos" + ]; + }; + polkit.enable = true; + power.enable = true; + + services = { + adb = { + enable = true; + user = "soispha"; + }; + fwupd.enable = true; + mpd = { + enable = true; + directories = let + data = "${config.home-manager.users.soispha.xdg.dataHome}/mpd"; + in { + inherit data; + playlists = "${data}/playlists"; + runtime = "/run/user/${builtins.toString config.users.users.soispha.uid}/mpd"; + music = config.home-manager.users.soispha.programs.beets.settings.directory; + }; + mpc = { + enable = true; + beetsPkg = config.home-manager.users.soispha.programs.beets.package; + }; + }; + ollama.enable = false; + postgresql.enable = false; + printing.enable = true; + scanning.enable = true; + snapper.enable = true; + steam.enable = false; + systemDiff.enable = true; + unison = { + enable = true; + + foreign.userName = "soispha"; + dataDir = "${config.home-manager.users.soispha.xdg.dataHome}/unison"; + userSourceDir = "/srv/home/soispha"; + pathsToIgnore = let + extractTarget = attr: "~/${attr.target}"; + homeManagerSymlinks = + builtins.map extractTarget + (builtins.attrValues + config.home-manager.users.soispha.home.file); + in + [ + # already synchronized by the taskserver + "~/.local/share/task" + + # Should not be synchronized + "~/.local/share/unison" + + # Is just to big to be synchronized (# TODO: Work around that <2024-08-31> ) + "~/media/music" + ] + ++ homeManagerSymlinks; + + pathsToSync = [ + "~/.local/state/mpv" + "~/.local/state/nvim" + "~/.local/share" + "~/.local/.Trash-1000" + + "~/.mozilla/firefox" + + "~/media" + "~/school" + "~/repos" + ]; + }; + }; + + programs = { + nvim = { + enable = true; + shell = pkgs.zsh; + }; + atuin.enable = true; + direnv.enable = true; + git.enable = true; + imv.enable = true; + less.enable = true; + lf.enable = true; + river = { + enable = true; + init = { + rules = [ + { + app-id = "float"; + title = "*"; + action = "float"; + } + { + app-id = "mpv"; + title = "*"; + action = "float"; + } + { + app-id = "ModernGL"; + title = "*"; + action = "float"; + } + { + app-id = "*"; + title = "Manim Slides"; + action = "float"; + } + { + app-id = "*"; + title = "floating please"; + action = "float"; + } + + { + app-id = "*"; + title = "*"; + action = "ssd"; + } + # This remove the focus border around Firefox (which is useful because the Firefox is nearly always in its own tag.) + { + app-id = "firefox"; + title = "*"; + action = "csd"; + } + ]; + generalSettings = { + # background + background-color = "0x002b36"; + border-color-focused = "0x93a1a1"; + border-color-unfocused = "0x586e75"; + + # keyboard repeat rate + set-repeat = ["50" "300"]; + + # Cursor + focus-follows-cursor = "normal"; + # hide-cursor = ["timeout" "2000"]; + hide-cursor = ["when-typing" "enabled"]; + set-cursor-warp = "on-output-change"; + xcursor-theme = ["Nordzy-cursors" "24"]; + }; + inputs = { + pointer-1133-49970-Logitech_Gaming_Mouse_G502 = [["pointer-accel" "0"] ["accel-profile" "none"]]; + pointer-12951-6505-ZSA_Technology_Labs_Moonlander_Mark_I = [["pointer-accel" "0"] ["accel-profile" "none"]]; + }; + backgroundStart = [ + pkgs.gammastep + pkgs.yambar + + pkgs.mako + ["${lib.getExe pkgs.swaybg}" "--image" "${./abstract-nord.png}"] + pkgs.swayidle + pkgs.alacritty + ]; + }; + }; + mpv.enable = true; + swaylock.enable = true; + taskwarrior.enable = true; + yambar.enable = true; + yt.enable = true; + zathura.enable = true; + zsh.enable = true; + }; + + sound.enable = true; + version.enable = true; + }; +} -- cgit 1.4.1