diff --git a/flake.lock b/flake.lock index ac30145..2c7164f 100644 --- a/flake.lock +++ b/flake.lock @@ -5,11 +5,11 @@ "nixpkgs": "nixpkgs" }, "locked": { - "lastModified": 1725392458, - "narHash": "sha256-sp1Ps5XBrIwDE0e2QOm2dJRRJ12aEWtJBhzohFwn+K4=", + "lastModified": 1730687397, + "narHash": "sha256-xluSdua/nB7BVpSx7C3PY5XJOsr9x0IsUwuVHJFpJ+Y=", "ref": "refs/heads/main", - "rev": "4cc6a8289f809ec4470eb01429aa6ed548349a56", - "revCount": 14, + "rev": "32894dcff264ee50e56f58130ac59bd86a7afb45", + "revCount": 17, "type": "git", "url": "https://git.xeno.science/xenofem/actual-nix.git" }, @@ -23,11 +23,11 @@ "fromYaml": "fromYaml" }, "locked": { - "lastModified": 1708890466, - "narHash": "sha256-LlrC09LoPi8OPYOGPXegD72v+//VapgAqhbOFS3i8sc=", + "lastModified": 1732200724, + "narHash": "sha256-+R1BH5wHhfnycySb7Sy5KbYEaTJZWm1h+LW1OtyhiTs=", "owner": "SenchoPens", "repo": "base16.nix", - "rev": "665b3c6748534eb766c777298721cece9453fdae", + "rev": "153d52373b0fb2d343592871009a286ec8837aec", "type": "github" }, "original": { @@ -52,30 +52,14 @@ "type": "github" } }, - "base16-foot": { - "flake": false, - "locked": { - "lastModified": 1696725948, - "narHash": "sha256-65bz2bUL/yzZ1c8/GQASnoiGwaF8DczlxJtzik1c0AU=", - "owner": "tinted-theming", - "repo": "base16-foot", - "rev": "eedbcfa30de0a4baa03e99f5e3ceb5535c2755ce", - "type": "github" - }, - "original": { - "owner": "tinted-theming", - "repo": "base16-foot", - "type": "github" - } - }, "base16-helix": { "flake": false, "locked": { - "lastModified": 1720809814, - "narHash": "sha256-numb3xigRGnr/deF7wdjBwVg7fpbTH7reFDkJ75AJkY=", + "lastModified": 1725860795, + "narHash": "sha256-Z2o8VBPW3I+KKTSfe25kskz0EUj7MpUh8u355Z1nVsU=", "owner": "tinted-theming", "repo": "base16-helix", - "rev": "34f41987bec14c0f3f6b2155c19787b1f6489625", + "rev": "7f795bf75d38e0eea9fed287264067ca187b88a9", "type": "github" }, "original": { @@ -84,38 +68,6 @@ "type": "github" } }, - "base16-kitty": { - "flake": false, - "locked": { - "lastModified": 1665001328, - "narHash": "sha256-aRaizTYPpuWEcvoYE9U+YRX+Wsc8+iG0guQJbvxEdJY=", - "owner": "kdrag0n", - "repo": "base16-kitty", - "rev": "06bb401fa9a0ffb84365905ffbb959ae5bf40805", - "type": "github" - }, - "original": { - "owner": "kdrag0n", - "repo": "base16-kitty", - "type": "github" - } - }, - "base16-tmux": { - "flake": false, - "locked": { - "lastModified": 1696725902, - "narHash": "sha256-wDPg5elZPcQpu7Df0lI5O8Jv4A3T6jUQIVg63KDU+3Q=", - "owner": "tinted-theming", - "repo": "base16-tmux", - "rev": "c02050bebb60dbb20cb433cd4d8ce668ecc11ba7", - "type": "github" - }, - "original": { - "owner": "tinted-theming", - "repo": "base16-tmux", - "type": "github" - } - }, "base16-vim": { "flake": false, "locked": { @@ -184,11 +136,11 @@ "systems": "systems" }, "locked": { - "lastModified": 1710146030, - "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", "owner": "numtide", "repo": "flake-utils", - "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", "type": "github" }, "original": { @@ -257,11 +209,11 @@ "fromYaml": { "flake": false, "locked": { - "lastModified": 1689549921, - "narHash": "sha256-iX0pk/uB019TdBGlaJEWvBCfydT6sRq+eDcGPifVsCM=", + "lastModified": 1731966426, + "narHash": "sha256-lq95WydhbUTWig/JpqiB7oViTcHFP8Lv41IGtayokA8=", "owner": "SenchoPens", "repo": "fromYaml", - "rev": "11fbbbfb32e3289d3c631e0134a23854e7865c84", + "rev": "106af9e2f715e2d828df706c386a685698f3223b", "type": "github" }, "original": { @@ -294,11 +246,11 @@ ] }, "locked": { - "lastModified": 1726440980, - "narHash": "sha256-ChhIrjtdu5d83W+YDRH+Ec5g1MmM0xk6hJnkz15Ot7M=", + "lastModified": 1732025103, + "narHash": "sha256-qjEI64RKvDxRyEarY0jTzrZMa8ebezh2DEZmJJrpVdo=", "owner": "nix-community", "repo": "home-manager", - "rev": "a9c9cc6e50f7cbd2d58ccb1cd46a1e06e9e445ff", + "rev": "a46e702093a5c46e192243edbd977d5749e7f294", "type": "github" }, "original": { @@ -315,11 +267,11 @@ ] }, "locked": { - "lastModified": 1724435763, - "narHash": "sha256-UNky3lJNGQtUEXT2OY8gMxejakSWPTfWKvpFkpFlAfM=", + "lastModified": 1730837930, + "narHash": "sha256-0kZL4m+bKBJUBQse0HanewWO0g8hDdCvBhudzxgehqc=", "owner": "nix-community", "repo": "home-manager", - "rev": "c2cd2a52e02f1dfa1c88f95abeb89298d46023be", + "rev": "2f607e07f3ac7e53541120536708e824acccfaa8", "type": "github" }, "original": { @@ -337,11 +289,11 @@ "nixpkgs": "nixpkgs_2" }, "locked": { - "lastModified": 1726398642, - "narHash": "sha256-tBM92BUtvY3vawqzl50VLY/EFhxw9LjuB/QN6QUC4ls=", + "lastModified": 1731668526, + "narHash": "sha256-ZszfGYOrwol3MGFpttahldT+UOfqXckk6XwZrUyHLxE=", "owner": "thiagokokada", "repo": "nix-alien", - "rev": "399c8e50f10d9bace3a024496e5f4dee28bdfdcd", + "rev": "97fe58a8ac15663b1ecdebd84d2187eb71f8532d", "type": "github" }, "original": { @@ -352,11 +304,11 @@ }, "nix-filter": { "locked": { - "lastModified": 1710156097, - "narHash": "sha256-1Wvk8UP7PXdf8bCCaEoMnOT1qe5/Duqgj+rL8sRQsSM=", + "lastModified": 1731533336, + "narHash": "sha256-oRam5PS1vcrr5UPgALW0eo1m/5/pls27Z/pabHNy2Ms=", "owner": "numtide", "repo": "nix-filter", - "rev": "3342559a24e85fc164b295c3444e8a139924675b", + "rev": "f7653272fd234696ae94229839a99b73c9ab7de0", "type": "github" }, "original": { @@ -373,11 +325,11 @@ ] }, "locked": { - "lastModified": 1726370017, - "narHash": "sha256-CJOV4JiLhd++w9K+h2z00DiB4R1CCuElWzhldrXSq5w=", + "lastModified": 1731593150, + "narHash": "sha256-FvksinoI2Y6kuwH+cKBu1oDA8uPGfoRqgtQV6O8GDc4=", "owner": "nix-community", "repo": "nix-index-database", - "rev": "0a2fba621b6bbf06be0b4edd974236e3d2fcc1a9", + "rev": "40d882b55e89add1ded379cc99edaab24983d6d9", "type": "github" }, "original": { @@ -399,20 +351,20 @@ "rev": "a1ab2a1353a38a6642fbc69f118adc08faf7dbcb", "revCount": 628, "type": "git", - "url": "ssh://git@codeberg.org/nix-astral/nix-minecraft.git" + "url": "https://codeberg.org/nix-astral/nix-minecraft.git" }, "original": { "type": "git", - "url": "ssh://git@codeberg.org/nix-astral/nix-minecraft.git" + "url": "https://codeberg.org/nix-astral/nix-minecraft.git" } }, "nixpkgs": { "locked": { - "lastModified": 1725103162, - "narHash": "sha256-Ym04C5+qovuQDYL/rKWSR+WESseQBbNAe5DsXNx5trY=", + "lastModified": 1728492678, + "narHash": "sha256-9UTxR8eukdg+XZeHgxW5hQA9fIKHsKCdOIUycTryeVw=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "12228ff1752d7b7624a54e9c1af4b222b3c1073b", + "rev": "5633bcff0c6162b9e4b5f1264264611e950c8ec7", "type": "github" }, "original": { @@ -424,11 +376,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1726062873, - "narHash": "sha256-IiA3jfbR7K/B5+9byVi9BZGWTD4VSbWe8VLpp9B/iYk=", + "lastModified": 1731319897, + "narHash": "sha256-PbABj4tnbWFMfBp6OcUK5iGy1QY+/Z96ZcLpooIbuEI=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "4f807e8940284ad7925ebd0a0993d2a1791acb2f", + "rev": "dc460ec76cbff0e66e269457d7b728432263166c", "type": "github" }, "original": { @@ -456,11 +408,11 @@ }, "nixpkgs_4": { "locked": { - "lastModified": 1726463316, - "narHash": "sha256-gI9kkaH0ZjakJOKrdjaI/VbaMEo9qBbSUl93DnU7f4c=", + "lastModified": 1732014248, + "narHash": "sha256-y/MEyuJ5oBWrWAic/14LaIr/u5E0wRVzyYsouYY3W6w=", "owner": "nixos", "repo": "nixpkgs", - "rev": "99dc8785f6a0adac95f5e2ab05cc2e1bf666d172", + "rev": "23e89b7da85c3640bbc2173fe04f4bd114342367", "type": "github" }, "original": { @@ -488,11 +440,11 @@ }, "nixpkgs_6": { "locked": { - "lastModified": 1725194671, - "narHash": "sha256-tLGCFEFTB5TaOKkpfw3iYT9dnk4awTP/q4w+ROpMfuw=", + "lastModified": 1731531548, + "narHash": "sha256-sz8/v17enkYmfpgeeuyzniGJU0QQBfmAjlemAUYhfy8=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "b833ff01a0d694b910daca6e2ff4a3f26dee478c", + "rev": "24f0d4acd634792badd6470134c387a3b039dace", "type": "github" }, "original": { @@ -536,24 +488,24 @@ "inputs": { "base16": "base16", "base16-fish": "base16-fish", - "base16-foot": "base16-foot", "base16-helix": "base16-helix", - "base16-kitty": "base16-kitty", - "base16-tmux": "base16-tmux", "base16-vim": "base16-vim", "flake-compat": "flake-compat_3", "flake-utils": "flake-utils_4", "gnome-shell": "gnome-shell", "home-manager": "home-manager_2", "nixpkgs": "nixpkgs_6", - "systems": "systems_4" + "systems": "systems_4", + "tinted-foot": "tinted-foot", + "tinted-kitty": "tinted-kitty", + "tinted-tmux": "tinted-tmux" }, "locked": { - "lastModified": 1726497442, - "narHash": "sha256-fieyqmLEJQqqnuJcg2CAnQ8kHapXHhg9rL48NNWjnPw=", + "lastModified": 1732261424, + "narHash": "sha256-8uTKUHkaU980J5kRnLYrdwmjZYB88eBGUk1oVgIUHFE=", "owner": "danth", "repo": "stylix", - "rev": "149b313ddf91c3cc94309170498b162cec666675", + "rev": "b667a340730dd3d0596083aa7c949eef01367c62", "type": "github" }, "original": { @@ -621,6 +573,56 @@ "repo": "default", "type": "github" } + }, + "tinted-foot": { + "flake": false, + "locked": { + "lastModified": 1726913040, + "narHash": "sha256-+eDZPkw7efMNUf3/Pv0EmsidqdwNJ1TaOum6k7lngDQ=", + "owner": "tinted-theming", + "repo": "tinted-foot", + "rev": "fd1b924b6c45c3e4465e8a849e67ea82933fcbe4", + "type": "github" + }, + "original": { + "owner": "tinted-theming", + "repo": "tinted-foot", + "rev": "fd1b924b6c45c3e4465e8a849e67ea82933fcbe4", + "type": "github" + } + }, + "tinted-kitty": { + "flake": false, + "locked": { + "lastModified": 1716423189, + "narHash": "sha256-2xF3sH7UIwegn+2gKzMpFi3pk5DlIlM18+vj17Uf82U=", + "owner": "tinted-theming", + "repo": "tinted-kitty", + "rev": "eb39e141db14baef052893285df9f266df041ff8", + "type": "github" + }, + "original": { + "owner": "tinted-theming", + "repo": "tinted-kitty", + "rev": "eb39e141db14baef052893285df9f266df041ff8", + "type": "github" + } + }, + "tinted-tmux": { + "flake": false, + "locked": { + "lastModified": 1696725902, + "narHash": "sha256-wDPg5elZPcQpu7Df0lI5O8Jv4A3T6jUQIVg63KDU+3Q=", + "owner": "tinted-theming", + "repo": "tinted-tmux", + "rev": "c02050bebb60dbb20cb433cd4d8ce668ecc11ba7", + "type": "github" + }, + "original": { + "owner": "tinted-theming", + "repo": "tinted-tmux", + "type": "github" + } } }, "root": "root", diff --git a/flake.nix b/flake.nix index 05532d2..c57197a 100644 --- a/flake.nix +++ b/flake.nix @@ -2,11 +2,12 @@ inputs = { nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; - home-manager.url = "github:nix-community/home-manager"; + home-manager.url = "github:nix-community/home-manager"; home-manager.inputs.nixpkgs.follows = "nixpkgs"; stylix.url = "github:danth/stylix"; - nix-minecraft.url = "git+ssh://git@codeberg.org/nix-astral/nix-minecraft.git"; + # nix-minecraft.url = "git+ssh://git@codeberg.org/nix-astral/nix-minecraft.git"; + nix-minecraft.url = "git+https://codeberg.org/nix-astral/nix-minecraft.git"; shabitica.url = "github:lomenzel/shabitica"; actual.url = "git+https://git.xeno.science/xenofem/actual-nix.git"; nix-alien.url = "github:thiagokokada/nix-alien"; @@ -16,9 +17,7 @@ let system = "x86_64-linux"; - pkgs = import inputs.nixpkgs { - inherit system; - }; + pkgs = import inputs.nixpkgs { inherit system; }; utils = import ./utils.nix { inherit inputs system; }; in { @@ -26,6 +25,12 @@ # desktop muon = utils.mkHost ./hosts/muon/configuration.nix; + # laptop + muop = utils.mkHost ./hosts/muop/configuration.nix; + + # vps + muho = utils.mkHost ./hosts/muho/configuration.nix; + # vps mups = utils.mkHost ./hosts/mups/configuration.nix; diff --git a/hosts/muho/configuration.nix b/hosts/muho/configuration.nix new file mode 100644 index 0000000..a3154cf --- /dev/null +++ b/hosts/muho/configuration.nix @@ -0,0 +1,92 @@ +{ config, lib, pkgs, inputs, system, ... }: +let cfg = config.mods; + +in { + # Hardware + imports = [ ./hardware-configuration.nix ]; + + environment.systemPackages = with inputs.nix-alien.packages.${system}; + [ nix-alien ]; + + # System + mods.user.name = "muon"; + networking.hostName = "muho"; + networking.hostId = "56e55e83"; + mods.home.file = ./home.nix; + + # Modules + mods.desktop.enable = true; + mods.desktop.gaming.enable = true; + mods.boot.enable = true; + + mods.theme.enable = true; + mods.theme.scheme = "woodland"; + + mods.server.media.enable = true; + + mods.server.search.enable = true; + + mods.tailscale.enable = true; + mods.wireguard.id = 3; + + services.xserver.windowManager.i3.enable = true; + + # Proprietary .useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.enp4s0.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.amd.updateMicrocode = + lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/hosts/muho/home.nix b/hosts/muho/home.nix new file mode 100644 index 0000000..72a9f7d --- /dev/null +++ b/hosts/muho/home.nix @@ -0,0 +1,62 @@ +{ pkgs, lib, osConfig, ... }: +let cfg = osConfig.mods; +in { + # Modules + mods.xdg.enable = true; + mods.social.enable = true; + mods.i3.enable = true; + mods.terminal.zsh.enable = true; + mods.terminal.emulator.enable = true; + mods.terminal.development.enable = true; + mods.terminal.tools.enable = true; + mods.desktop.development.enable = true; + mods.desktop.productivity.enable = true; + mods.desktop.media.enable = true; + + # Hardware preferences + + ## Monitors + xsession.windowManager.i3.config.workspaceOutputAssign = [ + { + workspace = "1"; + output = "${cfg.monitors.primary.name}"; + } + { + workspace = "2"; + output = "${cfg.monitors.secondary.name}"; + } + ]; + services.autorandr.enable = true; + programs.autorandr = { + enable = true; + hooks.postswitch = { + "notify-i3" = "${pkgs.i3}/bin/i3-msg restart"; + "set-wallpaper" = '' + ${lib.getExe pkgs.feh} --bg-fill --nofehbg ${./wallpaper.png} + ''; + }; + profiles.default = { + fingerprint = { + "${cfg.monitors.primary.name}" = + "00ffffffffffff004c2d850433324d431a120103803420782aee91a3544c99260f5054bfef80714f8100814081809500a940b30001011a3680a070381f403020350006202000001a000000fd00384b1e5111000a202020202020000000fc0053796e634d61737465720a2020000000ff004831414b3530303030300a202000e9"; + "${cfg.monitors.secondary.name}" = + "00ffffffffffff00410cca140101010134100103804728788a288e9e5548972416484badce0031594559615981800101010101010101a91a00a05000163030203700c48e21000018662150b051001b3040703600c48e21000018000000fc005068696c697073545620283529000000fd002f551f500e000a2020202020200156020323714f930414051f10121103020116150706230907078301000066030c00100080011d00bc52d01e20b8285540c48e2100001a011d007251d01e206e285500c48e2100001e011d80d0721c1620102c2580c48e2100009e011d8018711c1620582c2500c48e2100009ef33980d072382d40102c4580c48e2100001e0000f2"; + }; + config = { + "${cfg.monitors.primary.name}" = cfg.monitors.primary.config; + "${cfg.monitors.secondary.name}" = cfg.monitors.secondary.config; + }; + }; + }; + + # wayland.windowManager.hyprland.settings = { + # monitor = [ + # "DP-2,2560x1440@144,0x480,1" + # "HDMI-A-2,1920x1080,2560x0,1,transform,3" + # ]; + # input.sensitivity = -0.4; + # }; + + # Version of first install + home.stateVersion = "23.05"; +} diff --git a/hosts/muho/wallpaper.png b/hosts/muho/wallpaper.png new file mode 100644 index 0000000..9832948 Binary files /dev/null and b/hosts/muho/wallpaper.png differ diff --git a/hosts/muop/configuration.nix b/hosts/muop/configuration.nix new file mode 100644 index 0000000..a02553d --- /dev/null +++ b/hosts/muop/configuration.nix @@ -0,0 +1,124 @@ +{ config, lib, pkgs, inputs, system, ... }: +let cfg = config.mods; + +in { + # Hardware + imports = [ ./hardware-configuration.nix ]; + + environment.systemPackages = with inputs.nix-alien.packages.${system}; + [ nix-alien ]; + + # System + mods.user.name = "muon"; + networking.hostName = "muop"; + mods.home.file = ./home.nix; + + # Modules + mods.desktop.enable = true; + mods.desktop.wayland.enable = false; + mods.desktop.gaming.enable = true; + mods.boot.enable = false; + + mods.theme.enable = true; + mods.theme.scheme = "woodland"; + mods.theme.wallpaper = ./wallpaper.png; + + mods.containers.steam.enable = false; + mods.server.media.enable = false; + mods.server.astral.enable = false; + mods.server.astral.autoStart = false; + + mods.docker.media.enable = false; + + mods.server.sync.enable = true; + mods.tailscale.enable = false; + mods.openvpn.enable = false; + mods.wireguard.enable = false; + + services.xserver.windowManager.i3.enable = true; + + # Proprietary .useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.eno1.useDHCP = lib.mkDefault true; + # networking.interfaces.wlo1.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; + hardware.cpu.intel.updateMicrocode = + lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/hosts/muop/home.nix b/hosts/muop/home.nix new file mode 100644 index 0000000..b0a6b4e --- /dev/null +++ b/hosts/muop/home.nix @@ -0,0 +1,52 @@ +{ pkgs, lib, osConfig,... }: +let cfg = osConfig.mods; in { + # Modules + mods.xdg.enable = true; + mods.social.enable = true; + mods.i3.enable = true; + mods.terminal.zsh.enable = true; + mods.terminal.emulator.enable = true; + mods.terminal.development.enable = true; + mods.terminal.tools.enable = true; + mods.desktop.development.enable = true; + mods.desktop.productivity.enable = true; + mods.desktop.media.enable = true; + + # Hardware preferences + + ## Monitors + xsession.windowManager.i3.config.workspaceOutputAssign = [{ + workspace = "1"; + output = "${cfg.monitors.primary.name}"; + }]; + services.autorandr.enable = true; + programs.autorandr = { + enable = true; + hooks.postswitch = { + "notify-i3" = "${pkgs.i3}/bin/i3-msg restart"; + "set-wallpaper" = '' + ${lib.getExe pkgs.feh} --bg-fill --nofehbg ${./wallpaper.png} + ''; + }; + profiles.default = { + fingerprint = { + "${cfg.monitors.primary.name}" = "00ffffffffffff0030e4190500000000001a01049522137803a1c59459578f27205054000000010101010101010101010101010101012e3680a070381f403020350058c210000019222480a070381f403020350058c210000019000000fd00283c43430e010a20202020202000000002000c47ff0a3c6e1f182b6e000000001c"; + }; + config = { + "${cfg.monitors.primary.name}" = + cfg.monitors.primary.config; + }; + }; + }; + + # wayland.windowManager.hyprland.settings = { + # monitor = [ + # "DP-2,2560x1440@144,0x480,1" + # "HDMI-A-2,1920x1080,2560x0,1,transform,3" + # ]; + # input.sensitivity = -0.4; + # }; + + # Version of first install + home.stateVersion = "23.05"; +} diff --git a/hosts/muop/wallpaper.png b/hosts/muop/wallpaper.png new file mode 100644 index 0000000..9832948 Binary files /dev/null and b/hosts/muop/wallpaper.png differ diff --git a/modules/home/default.nix b/modules/home/default.nix index 3d56c0d..75a140b 100644 --- a/modules/home/default.nix +++ b/modules/home/default.nix @@ -13,4 +13,6 @@ in { programs.home-manager.enable = true; home.username = cfg.user.name; home.homeDirectory = "/home/${cfg.user.name}"; + # home.profileDirectory = + # "${config.home.homeDirectory}/.local/state/nix/profile/"; } diff --git a/modules/home/desktop/i3.nix b/modules/home/desktop/i3.nix index 9722e60..2807fb6 100644 --- a/modules/home/desktop/i3.nix +++ b/modules/home/desktop/i3.nix @@ -14,29 +14,30 @@ separator = ""; }; icons = "awesome5"; - blocks = [{ - block = "sound"; - format = " $icon $volume "; - click = [{ - button = "left"; - cmd = "pavucontrol"; - }]; - } { + blocks = [ + { + block = "sound"; + format = " $icon $volume "; + click = [{ + button = "left"; + cmd = "pavucontrol"; + }]; + } + { block = "time"; format = "$icon $timestamp.datetime(f:'%Y-%m-%d %a %H:%M:%S') "; interval = 1; - }]; + } + ]; }; }; xsession.windowManager.i3 = let modifier = "Mod4"; wsAmount = 10; - genSpaces = f: map builtins.toString ( - builtins.genList f wsAmount - ); - workspaces = genSpaces (x: x+1); - + genSpaces = f: map builtins.toString (builtins.genList f wsAmount); + workspaces = genSpaces (x: x + 1); + in { enable = true; config = { @@ -53,38 +54,43 @@ workspaceAutoBackAndForth = true; focus.wrapping = "yes"; + startup = [ ] ++ lib.optionals config.mods.social.enable [{ + command = "exec vesktop"; + }]; + + assigns = { + "2" = [{ class = "^electron$"; }]; + "3" = [{ class = "^Steam$"; }]; + }; + keybindings = let # modKeyComb: string -> valueAction: string # -> keys: [string] -> values: [string] # -> keybindings: attrSet { string -> string } - zipBinds = comb: action: keys: values: ( - builtins.listToAttrs (lib.zipListsWith (k: v: { + zipBinds = comb: action: keys: values: + (builtins.listToAttrs (lib.zipListsWith (k: v: { name = "${modifier}${comb}${k}"; value = "${action} ${v}"; - }) keys values) - ); + }) keys values)); - moveKeys = ["h" "j" "k" "l"]; - moveDirs = ["left" "down" "up" "right"]; + moveKeys = [ "h" "j" "k" "l" ]; + moveDirs = [ "left" "down" "up" "right" ]; - workspKeys = genSpaces (x: lib.mod (x+1) wsAmount); + workspKeys = genSpaces (x: lib.mod (x + 1) wsAmount); - in lib.mkOptionDefault ( - (zipBinds "+" "focus" moveKeys moveDirs) // - (zipBinds "+Shift+" "move" moveKeys moveDirs) // - (zipBinds "+" "workspace number" workspKeys workspaces) // - (zipBinds "+Shift+" "move container to workspace number" - workspKeys workspaces) // - { - "XF86AudioRaiseVolume" = - "exec --no-startup-id pactl set-sink-volume 0 +2%"; - "XF86AudioLowerVolume" = - "exec --no-startup-id pactl set-sink-volume 0 -2%"; - } - ); + in lib.mkOptionDefault ((zipBinds "+" "focus" moveKeys moveDirs) + // (zipBinds "+Shift+" "move" moveKeys moveDirs) + // (zipBinds "+" "workspace number" workspKeys workspaces) + // (zipBinds "+Shift+" "move container to workspace number" workspKeys + workspaces) // { + "XF86AudioRaiseVolume" = + "exec --no-startup-id pactl set-sink-volume 0 +2%"; + "XF86AudioLowerVolume" = + "exec --no-startup-id pactl set-sink-volume 0 -2%"; + }); bars = let - status_conf = + status_conf = "${config.xdg.configHome}/i3status-rust/config-default.toml"; stylix_bar = { mode = "dock"; @@ -96,9 +102,7 @@ workspaceNumbers = true; trayOutput = "primary"; } // config.lib.stylix.i3.bar; - in [ - stylix_bar - ]; + in [ stylix_bar ]; }; }; }; diff --git a/modules/home/desktop/media.nix b/modules/home/desktop/media.nix index 8814c39..d68a251 100644 --- a/modules/home/desktop/media.nix +++ b/modules/home/desktop/media.nix @@ -8,6 +8,13 @@ pulseaudio pavucontrol + # Video + stremio + + # Interactive + bottles + mindustry + # Podcasts gpodder ]; diff --git a/modules/home/desktop/productivity.nix b/modules/home/desktop/productivity.nix index ed4c489..2958f27 100644 --- a/modules/home/desktop/productivity.nix +++ b/modules/home/desktop/productivity.nix @@ -19,6 +19,10 @@ # password manager bitwarden-desktop + + # documents + texliveFull + texstudio ]; home.sessionVariables.BROWSER = "librewolf"; diff --git a/modules/home/desktop/social.nix b/modules/home/desktop/social.nix index 3b81f9c..02b8ef2 100644 --- a/modules/home/desktop/social.nix +++ b/modules/home/desktop/social.nix @@ -1,5 +1,5 @@ -{ pkgs, lib, config, ... }: -let +{ pkgs, lib, config, ... }: +let vesktop-nogain = (pkgs.vesktop.overrideAttrs (previousAttrs: { patches = previousAttrs.patches ++ [ (builtins.fetchurl { @@ -15,7 +15,7 @@ in { config = lib.mkIf config.mods.social.enable { home.packages = with pkgs; [ # Communication - kotatogram-desktop + # kotatogram-desktop signal-desktop vesktop-nogain diff --git a/modules/home/terminal/development.nix b/modules/home/terminal/development.nix index 7110b05..160563b 100644 --- a/modules/home/terminal/development.nix +++ b/modules/home/terminal/development.nix @@ -71,6 +71,7 @@ in { programs.direnv = { enable = true; nix-direnv.enable = true; + enableZshIntegration = lib.mkIf config.mods.terminal.zsh.enable true; }; home.sessionVariables.EDITOR = "hx"; diff --git a/modules/home/terminal/tools.nix b/modules/home/terminal/tools.nix index 28902b4..4daf57c 100644 --- a/modules/home/terminal/tools.nix +++ b/modules/home/terminal/tools.nix @@ -1,36 +1,35 @@ { pkgs, lib, config, ... }: -let - cfg = config.mods.terminal; +let cfg = config.mods.terminal; in with lib; { options.mods.terminal.tools.enable = mkEnableOption "enables cli tools"; config = mkIf cfg.tools.enable { - programs.zellij = { - enable = true; - # enableZshIntegration = mkIf cfg.zsh.enable true; - }; - programs.fzf = { - enable = true; - enableZshIntegration = mkIf cfg.zsh.enable true; - }; + programs = builtins.listToAttrs (map (name: { + name = name; + value = { + enable = true; + } // optionalAttrs + (builtins.hasAttr "enableZshIntegration" config.programs.${name}) { + enableZshIntegration = mkIf cfg.zsh.enable true; + }; + }) [ + "zellij" + "fzf" + "eza" + "bat" + "zoxide" + "dircolors" + "yazi" + "nix-index" + "thefuck" - programs.zoxide = { - enable = true; - enableZshIntegration = mkIf cfg.zsh.enable true; - }; - - programs.dircolors = { - enable = true; - enableZshIntegration = mkIf cfg.zsh.enable true; - }; - - programs.yazi = { - enable = true; - enableZshIntegration = mkIf cfg.zsh.enable true; - }; - - programs.lazygit.enable = true; + "lazygit" + "fd" + "ripgrep" + "bottom" + "htop" + ]); home.packages = with pkgs; [ # libraries @@ -38,13 +37,11 @@ in with lib; { ueberzugpp # file managing - fd - ripgrep trash-cli # programs - bottom fend + unzip ]; }; } diff --git a/modules/home/xdg.nix b/modules/home/xdg.nix index fd84ae0..9296122 100644 --- a/modules/home/xdg.nix +++ b/modules/home/xdg.nix @@ -1,10 +1,11 @@ { pkgs, lib, config, ... }: { - options.mods.xdg.enable = - lib.mkEnableOption "enables xdg settings"; + options.mods.xdg.enable = lib.mkEnableOption "enables xdg settings"; config = lib.mkIf config.mods.xdg.enable { - xdg = let - browser = ["librewolf.desktop"]; + nix.settings.use-xdg-base-directories = true; + + xdg = let + browser = [ "librewolf.desktop" ]; associations = { "text/html" = browser; "x-scheme-handler/http" = browser; @@ -19,13 +20,13 @@ "application/x-extension-xhtml" = browser; "application/x-extension-xht" = browser; - "audio/*" = ["mpv.desktop"]; - "video/*" = ["mpv.dekstop"]; - "image/*" = ["imv.desktop"]; + "audio/*" = [ "mpv.desktop" ]; + "video/*" = [ "mpv.dekstop" ]; + "image/*" = [ "imv.desktop" ]; "application/json" = browser; # "application/pdf" = ["org.pwmt.zathura.desktop.desktop"]; - "x-scheme-handler/tg" = ["kotatogram-desktop.desktop"]; - "x-scheme-handler/discord" = ["vesktop.desktop"]; + "x-scheme-handler/tg" = [ "kotatogram-desktop.desktop" ]; + "x-scheme-handler/discord" = [ "vesktop.desktop" ]; }; in { enable = true; diff --git a/modules/nixos/core/boot.nix b/modules/nixos/core/boot.nix index cadc2c8..051e0d0 100644 --- a/modules/nixos/core/boot.nix +++ b/modules/nixos/core/boot.nix @@ -1,17 +1,18 @@ { pkgs, lib, config, ... }: { options.mods = { boot.enable = lib.mkEnableOption { - description = "enables grub"; + description = "enables grub"; default = true; }; }; config = lib.mkIf config.mods.boot.enable { boot.loader = lib.mkIf config.mods.xorg.enable { - timeout = 0; + timeout = 2; efi.canTouchEfiVariables = true; grub = { enable = true; + zfsSupport = true; efiSupport = true; device = "nodev"; gfxmodeEfi = config.mods.monitors.primary.config.mode; diff --git a/modules/nixos/core/network.nix b/modules/nixos/core/network.nix index 2d3c923..fc2badf 100644 --- a/modules/nixos/core/network.nix +++ b/modules/nixos/core/network.nix @@ -1,14 +1,24 @@ -{ pkgs, lib, config, ... }: { +{ pkgs, lib, config, ... }: + +let + cfg = config.mods; + wg = cfg.wireguard; + +in with lib; { options.mods = { - i2p.enable = lib.mkEnableOption "enables i2p network"; - tailscale.enable = lib.mkEnableOption "enables tailscale"; - wireguard.enable = lib.mkEnableOption "enables wireguard client"; - openvpn.enable = lib.mkEnableOption "enables openvpn config"; + i2p.enable = mkEnableOption "enables i2p network"; + tailscale.enable = mkEnableOption "enables tailscale"; + wireguard.enable = mkEnableOption "enables wireguard client"; + wireguard.id = mkOption { + type = with types; nullOr ints.u8; + default = null; + }; + openvpn.enable = mkEnableOption "enables openvpn config"; openvpn.config = let username = "${config.mods.user.name}"; folder = "${config.users.users.${username}.home}/documents/openvpn/"; file = "${config.mods.user.name}.ovpn"; - in lib.mkOption { + in mkOption { description = "the config location"; default = "${folder}${file}"; }; @@ -18,10 +28,10 @@ networking.networkmanager.enable = true; services.resolved.enable = true; - services.tailscale.enable = config.mods.tailscale.enable; + services.tailscale.enable = cfg.tailscale.enable; - services.openvpn.servers = lib.mkIf config.mods.openvpn.enable { - remote.config = "config ${config.mods.openvpn.config}"; + services.openvpn.servers = mkIf cfg.openvpn.enable { + remote.config = "config ${cfg.openvpn.config}"; }; networking.firewall.allowedTCPPorts = [ @@ -30,7 +40,7 @@ 4447 # default socks proxy port 4444 # default http proxy port ]; - services.i2pd = lib.mkIf config.mods.i2p.enable { + services.i2pd = lib.mkIf cfg.i2p.enable { enable = true; proto.sam.enable = true; address = "127.0.0.1"; @@ -42,17 +52,21 @@ }; networking.firewall.allowedUDPPorts = [ 51820 ]; - networking.wg-quick.interfaces = lib.mkIf config.mods.wireguard.enable { + networking.wg-quick.interfaces = lib.mkIf (wg.id != null) { wg0 = { - address = [ "10.0.0.2/24" "fdc9:281f:04d7:9ee9::2/64" ]; + address = [ + "10.0.0.${toString wg.id}/24" + "fdc9:281f:04d7:9ee9::${toString wg.id}/64" + ]; dns = [ "10.0.0.1" "fdc9:281f:04d7:9ee9::1" ]; mtu = 1500; privateKeyFile = "/home/muon/wireguard-keys/private"; peers = [{ publicKey = "2RF8GmTZwQdzVm2l2piYy6U0qiMU3wSxC7Lt8urAjwA="; - presharedKeyFile = "/home/muon/wireguard-keys/psk-muon"; - allowedIPs = [ "0.0.0.0/0" "::/0" ]; + presharedKeyFile = + "/home/muon/wireguard-keys/psk-${config.networking.hostName}"; + allowedIPs = [ "10.0.0.${toString wg.id}/24" ]; # ip route add 93.95.230.11 via 192.168.0.1 endpoint = "93.95.230.11:51820"; persistentKeepalive = 25; @@ -60,24 +74,5 @@ }; }; - # networking.wireguard.interfaces = lib.mkIf config.mods.wireguard.enable { - # wg0 = { - # ips = [ "10.100.0.2/24" ]; - # listenPort = 51820; - - # privateKeyFile = "/home/muon/wireguard-keys/private"; - - # peers = [ - # { - # publicKey = "2RF8GmTZwQdzVm2l2piYy6U0qiMU3wSxC7Lt8urAjwA="; - # allowedIPs = [ "0.0.0.0/0" ]; - # # ip route add 93.95.230.11 via 192.168.0.1 - # endpoint = "93.95.230.11:51820"; - # persistentKeepalive = 25; - # } - # ]; - # }; - # }; - }; } diff --git a/modules/nixos/desktop/xorg.nix b/modules/nixos/desktop/xorg.nix index 2caef36..96b18bb 100644 --- a/modules/nixos/desktop/xorg.nix +++ b/modules/nixos/desktop/xorg.nix @@ -1,4 +1,5 @@ -{ pkgs, lib, config, ... }: let +{ pkgs, lib, config, ... }: +let monitorModule = lib.types.submodule { options = { name = lib.mkOption { @@ -21,22 +22,24 @@ in { }; }; - config = let + config = let startupTargets = [ "systemd-user-sessions.service" "multi-user.target" "network-online.target" ]; - + in lib.mkIf config.mods.xorg.enable { services.xserver.enable = true; services.xserver.xkb.layout = "us"; services.xserver.xkb.options = "caps:escape"; + services.xserver.dpi = 96; - services.xserver.displayManager.gdm.enable = true; + # services.xserver.displayManager.gdm.enable = true; + services.displayManager.sddm.enable = true; + services.displayManager.sddm.enableHidpi = false; services.displayManager.autoLogin.enable = true; - services.displayManager.autoLogin.user = - config.mods.user.name; + services.displayManager.autoLogin.user = config.mods.user.name; systemd.services.display-manager.wants = startupTargets; systemd.services.display-manager.after = startupTargets; diff --git a/modules/nixos/server/default.nix b/modules/nixos/server/default.nix index b480da3..73dd6eb 100644 --- a/modules/nixos/server/default.nix +++ b/modules/nixos/server/default.nix @@ -9,6 +9,7 @@ ./wireguard.nix ./headscale.nix ./photoprism.nix + ./search.nix ./nginx.nix ]; } diff --git a/modules/nixos/server/media.nix b/modules/nixos/server/media.nix index cf77205..f49aa02 100644 --- a/modules/nixos/server/media.nix +++ b/modules/nixos/server/media.nix @@ -6,12 +6,20 @@ }; }; - config = lib.mkIf config.mods.server.media.enable { services.jellyfin = { enable = true; openFirewall = true; - user="${config.mods.user.name}"; + user = "${config.mods.user.name}"; }; + + services.immich = { + enable = true; + openFirewall = true; + host = "0.0.0.0"; + # user = "${config.mods.user.name}"; + }; + + users.users.immich.extraGroups = [ "video" "render" ]; }; } diff --git a/modules/nixos/server/search.nix b/modules/nixos/server/search.nix new file mode 100644 index 0000000..a08507c --- /dev/null +++ b/modules/nixos/server/search.nix @@ -0,0 +1,48 @@ +{ pkgs, lib, config, ... }: +let + inherit (lib) types mkOption mkEnableOption; + cfg = config.mods.server.search; +in { + options.mods.server.search = { + enable = mkEnableOption { + default = false; + description = "enables search engine server"; + }; + + port = mkOption { + type = types.port; + default = 8081; + }; + + nginx = mkOption { + type = types.nullOr types.str; + default = "search"; + }; + }; + + config = { + services.searx = lib.mkIf cfg.enable { + enable = true; + + runInUwsgi = true; + uwsgiConfig = { + disable-logging = true; + http = ":${toString cfg.port}"; + }; + + settings = { + server.port = cfg.port; + server.bind_address = "0.0.0.0"; + server.secret_key = "temporary-before-sops"; + + enabled_plugins = [ "Hostnames plugin" "Tracker URL remover" ]; + hostnames.remove = [ "(.*.)?facebook.com$" ]; + hostnames.replace = { + "(.*.)?reddit.com$" = "redlib.northboot.xyz"; + "(.*.)?youtube.com$" = "invidious.example.com"; + }; + }; + }; + + }; +} diff --git a/modules/nixos/unfree/nvidia.nix b/modules/nixos/unfree/nvidia.nix index aaf96a7..e990289 100644 --- a/modules/nixos/unfree/nvidia.nix +++ b/modules/nixos/unfree/nvidia.nix @@ -1,6 +1,5 @@ { pkgs, lib, config, ... }: -let - cfg = config.mods.unfree.nvidia; +let cfg = config.mods.unfree.nvidia; in { options.mods.unfree.nvidia = { enable = lib.mkEnableOption { @@ -8,7 +7,7 @@ in { description = "enables proprietary nvidia drivers"; }; packages = lib.mkOption { - default = [ "nvidia-x11" ]; + default = [ "nvidia-x11" "nvidia-settings" ]; description = "unfree packages"; }; driver = lib.mkOption { @@ -19,22 +18,24 @@ in { config = lib.mkIf cfg.enable { # nixos.wiki/wiki/Nvidia - hardware.graphics = { - enable = true; - enable32Bit = true; - }; + # hardware.graphics = { + # enable = true; + # enable32Bit = true; + # }; services.xserver.videoDrivers = [ "nvidia" "nvidia-dkms" ]; hardware.nvidia = { modesetting.enable = true; - powerManagement.enable = false; + # Set in configuration.nix + # powerManagement.enable = false; + powerManagement.finegrained = false; - open = false; - nvidiaSettings = false; - + open = lib.mkDefault false; + nvidiaSettings = lib.mkDefault false; + package = config.boot.kernelPackages.nvidiaPackages."${cfg.driver}"; }; }; diff --git a/modules/nixos/unfree/steam.nix b/modules/nixos/unfree/steam.nix index 7a1fa3f..bcebad9 100644 --- a/modules/nixos/unfree/steam.nix +++ b/modules/nixos/unfree/steam.nix @@ -5,11 +5,7 @@ description = "enables proprietary steam software"; }; packages = lib.mkOption { - default = [ - "steam" - "steam-original" - "steam-run" - ]; + default = [ "steam" "steam-original" "steam-run" "steam-unwrapped" ]; description = "unfree packages"; }; };