diff --git a/README.md b/README.md new file mode 100644 index 0000000..6a0fc96 --- /dev/null +++ b/README.md @@ -0,0 +1,11 @@ +# Eclypse's Nix Config + +My personal nixos configuration. Utilizes the dendritic pattern to manage my devices: + +- Vanta: Framework 13 (12th Gen Intel) +- Onyx: Desktop Workstation +- Umbra: Mackbook (2015) + +## TODO + +- Look into Kitty terminal as replacement for Foot & Zellij diff --git a/flake.lock b/flake.lock index d6cdbad..949b4e2 100644 --- a/flake.lock +++ b/flake.lock @@ -10,11 +10,11 @@ "systems": "systems" }, "locked": { - "lastModified": 1762618334, - "narHash": "sha256-wyT7Pl6tMFbFrs8Lk/TlEs81N6L+VSybPfiIgzU8lbQ=", + "lastModified": 1770165109, + "narHash": "sha256-9VnK6Oqai65puVJ4WYtCTvlJeXxMzAp/69HhQuTdl/I=", "owner": "ryantm", "repo": "agenix", - "rev": "fcdea223397448d35d9b31f798479227e80183f6", + "rev": "b027ee29d959fda4b60b57566d64c98a202e0feb", "type": "github" }, "original": { @@ -34,11 +34,11 @@ "treefmt-nix": "treefmt-nix" }, "locked": { - "lastModified": 1759699908, - "narHash": "sha256-kYVGY8sAfqwpNch706Fy2+/b+xbtfidhXSnzvthAhIQ=", + "lastModified": 1774522439, + "narHash": "sha256-GvINrdGznE7mGlDNjW0/PMgOJlC+Nl9MkfxALB4QvWs=", "owner": "oddlama", "repo": "agenix-rekey", - "rev": "42362b12f59978aabf3ec3334834ce2f3662013d", + "rev": "8b9c179bc1300ab130c90f2d25426bf0e7a2b58d", "type": "github" }, "original": { @@ -190,22 +190,6 @@ "type": "github" } }, - "flake-compat_2": { - "flake": false, - "locked": { - "lastModified": 1751685974, - "narHash": "sha256-NKw96t+BgHIYzHUjkTK95FqYRVKB8DHpVhefWSz/kTw=", - "ref": "refs/heads/main", - "rev": "549f2762aebeff29a2e5ece7a7dc0f955281a1d1", - "revCount": 92, - "type": "git", - "url": "https://git.lix.systems/lix-project/flake-compat.git" - }, - "original": { - "type": "git", - "url": "https://git.lix.systems/lix-project/flake-compat.git" - } - }, "flake-parts": { "inputs": { "nixpkgs-lib": [ @@ -229,17 +213,14 @@ }, "flake-parts_2": { "inputs": { - "nixpkgs-lib": [ - "nur", - "nixpkgs" - ] + "nixpkgs-lib": "nixpkgs-lib" }, "locked": { - "lastModified": 1733312601, - "narHash": "sha256-4pDvzqnegAfRkPwO3wmwBhVi/Sye1mzps0zHWYnP88c=", + "lastModified": 1772408722, + "narHash": "sha256-rHuJtdcOjK7rAHpHphUb1iCvgkU3GpfvicLMwwnfMT0=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "205b12d8b7cd4802fbcb8e8ef6a0f1408781a4f9", + "rev": "f20dc5d9b8027381c474144ecabc9034d6a839a3", "type": "github" }, "original": { @@ -251,16 +232,16 @@ "flake-parts_3": { "inputs": { "nixpkgs-lib": [ - "nvf", + "nur", "nixpkgs" ] }, "locked": { - "lastModified": 1768135262, - "narHash": "sha256-PVvu7OqHBGWN16zSi6tEmPwwHQ4rLPU9Plvs8/1TUBY=", + "lastModified": 1733312601, + "narHash": "sha256-4pDvzqnegAfRkPwO3wmwBhVi/Sye1mzps0zHWYnP88c=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "80daad04eddbbf5a4d883996a73f3f542fa437ac", + "rev": "205b12d8b7cd4802fbcb8e8ef6a0f1408781a4f9", "type": "github" }, "original": { @@ -375,11 +356,11 @@ ] }, "locked": { - "lastModified": 1773422513, - "narHash": "sha256-MPjR48roW7CUMU6lu0+qQGqj92Kuh3paIulMWFZy+NQ=", + "lastModified": 1774738535, + "narHash": "sha256-2jfBEZUC67IlnxO5KItFCAd7Oc+1TvyV/jQlR+2ykGQ=", "owner": "nix-community", "repo": "home-manager", - "rev": "ef12a9a2b0f77c8fa3dda1e7e494fca668909056", + "rev": "769e07ef8f4cf7b1ec3b96ef015abec9bc6b1e2a", "type": "github" }, "original": { @@ -388,40 +369,18 @@ "type": "github" } }, - "mnw": { + "import-tree": { "locked": { - "lastModified": 1768701608, - "narHash": "sha256-kSvWF3Xt2HW9hmV5V7i8PqeWJIBUKmuKoHhOgj3Znzs=", - "owner": "Gerg-L", - "repo": "mnw", - "rev": "20d63a8a1ae400557c770052a46a9840e768926b", + "lastModified": 1773693634, + "narHash": "sha256-BtZ2dtkBdSUnFPPFc+n0kcMbgaTxzFNPv2iaO326Ffg=", + "owner": "vic", + "repo": "import-tree", + "rev": "c41e7d58045f9057880b0d85e1152d6a4430dbf1", "type": "github" }, "original": { - "owner": "Gerg-L", - "repo": "mnw", - "type": "github" - } - }, - "ndg": { - "inputs": { - "nixpkgs": [ - "nvf", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1768214250, - "narHash": "sha256-hnBZDQWUxJV3KbtvyGW5BKLO/fAwydrxm5WHCWMQTbw=", - "owner": "feel-co", - "repo": "ndg", - "rev": "a6bd3c1ce2668d096e4fdaaa03ad7f03ba1fbca8", - "type": "github" - }, - "original": { - "owner": "feel-co", - "ref": "refs/tags/v2.6.0", - "repo": "ndg", + "owner": "vic", + "repo": "import-tree", "type": "github" } }, @@ -437,11 +396,11 @@ "xwayland-satellite-unstable": "xwayland-satellite-unstable" }, "locked": { - "lastModified": 1773501701, - "narHash": "sha256-+0LBAEm8F5h9Nm+hdS07aoS1W4oTtW6c8lltb66oOYQ=", + "lastModified": 1775042939, + "narHash": "sha256-qcCBdnnKj8g/TiYmfDl3LmTdLYVPxr08yht9JaTXW00=", "owner": "sodiboo", "repo": "niri-flake", - "rev": "39ac039250a4a32bf8691405cac04864fc66a70d", + "rev": "0e4df2c05361ed0f5e8738335369b304a0962b02", "type": "github" }, "original": { @@ -470,11 +429,11 @@ "niri-unstable": { "flake": false, "locked": { - "lastModified": 1773130184, - "narHash": "sha256-3bwx4WqCB06yfQIGB+OgIckOkEDyKxiTD5pOo4Xz2rI=", + "lastModified": 1774616418, + "narHash": "sha256-z+dLkAS4bqytIlOI4h2MnjBJrSP4d1Awx0n+IV5YA3Y=", "owner": "YaLTeR", "repo": "niri", - "rev": "b07bde3ee82dd73115e6b949e4f3f63695da35ea", + "rev": "8f48f56fe19918b5cfa02e5d68a47ebaf7bf3dee", "type": "github" }, "original": { @@ -500,11 +459,11 @@ }, "nixos-hardware": { "locked": { - "lastModified": 1769302137, - "narHash": "sha256-QEDtctEkOsbx8nlFh4yqPEOtr4tif6KTqWwJ37IM2ds=", + "lastModified": 1774777275, + "narHash": "sha256-qogBiYFq8hZusDPeeKRqzelBAhZvREc7Cl+qlewGUCg=", "owner": "NixOS", "repo": "nixos-hardware", - "rev": "a351494b0e35fd7c0b7a1aae82f0afddf4907aa8", + "rev": "b8f81636927f1af0cca812d22c876bad0a883ccd", "type": "github" }, "original": { @@ -529,13 +488,28 @@ "type": "github" } }, + "nixpkgs-lib": { + "locked": { + "lastModified": 1772328832, + "narHash": "sha256-e+/T/pmEkLP6BHhYjx6GmwP5ivonQQn0bJdH9YrRB+Q=", + "owner": "nix-community", + "repo": "nixpkgs.lib", + "rev": "c185c7a5e5dd8f9add5b2f8ebeff00888b070742", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixpkgs.lib", + "type": "github" + } + }, "nixpkgs-stable": { "locked": { - "lastModified": 1773375660, - "narHash": "sha256-SEzUWw2Rf5Ki3bcM26nSKgbeoqi2uYy8IHVBqOKjX3w=", + "lastModified": 1775002709, + "narHash": "sha256-d3Yx83vSrN+2z/loBh4mJpyRqr9aAJqlke4TkpFmRJA=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "3e20095fe3c6cbb1ddcef89b26969a69a1570776", + "rev": "bcd464ccd2a1a7cd09aa2f8d4ffba83b761b1d0e", "type": "github" }, "original": { @@ -545,22 +519,6 @@ "type": "github" } }, - "nixpkgs_2": { - "locked": { - "lastModified": 1770107345, - "narHash": "sha256-tbS0Ebx2PiA1FRW8mt8oejR0qMXmziJmPaU1d4kYY9g=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "4533d9293756b63904b7238acb84ac8fe4c8c2c4", - "type": "github" - }, - "original": { - "owner": "nixos", - "ref": "nixpkgs-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, "noctalia": { "inputs": { "nixpkgs": [ @@ -569,11 +527,11 @@ "noctalia-qs": "noctalia-qs" }, "locked": { - "lastModified": 1773968294, - "narHash": "sha256-u/e+7u2NW4bUac2Uvfrp1fmklpgV1rmXsm7pH5fmk9k=", + "lastModified": 1775039613, + "narHash": "sha256-5VzBe0SOXamABAbtjNF5Y7jaMbSeVtGQRhbICoJ6izo=", "owner": "noctalia-dev", "repo": "noctalia-shell", - "rev": "6c57717595468d3e0a259a703dbb90aea29e7e64", + "rev": "7b29c11d7aaf476723af14865665cf04750f8d20", "type": "github" }, "original": { @@ -592,11 +550,11 @@ "treefmt-nix": "treefmt-nix_2" }, "locked": { - "lastModified": 1773842483, - "narHash": "sha256-oRqz+5AbNKfUWWwN5c83CsSOsUWVGITh0HZg+wX5Q/8=", + "lastModified": 1774994931, + "narHash": "sha256-WmXA8kyqvDA226DRPrXyR6bLO9VsRr4SUAYCVH6H6Ns=", "owner": "noctalia-dev", "repo": "noctalia-qs", - "rev": "3962ff1e0b59ef067c57199d31271ddbf23b29cd", + "rev": "b053facf8421df220d0bf2496a543b23dee3ca85", "type": "github" }, "original": { @@ -607,17 +565,17 @@ }, "nur": { "inputs": { - "flake-parts": "flake-parts_2", + "flake-parts": "flake-parts_3", "nixpkgs": [ "nixpkgs" ] }, "locked": { - "lastModified": 1765129370, - "narHash": "sha256-oECOMG9TqJfAym8EbcopfvA2+UZQEAnYB/wWEV09OvE=", + "lastModified": 1774965252, + "narHash": "sha256-wmrXM9Q8zgx2DEUjBqgPorjn1YSrwy89Ixo92uVnTQ0=", "owner": "nix-community", "repo": "NUR", - "rev": "09e1d5968ffd4984068413c39e1803e74d436ce7", + "rev": "2662849d18110617a22243480a9b474c8f8602c6", "type": "github" }, "original": { @@ -651,30 +609,17 @@ "type": "github" } }, - "nvf": { - "inputs": { - "flake-compat": "flake-compat_2", - "flake-parts": "flake-parts_3", - "mnw": "mnw", - "ndg": "ndg", - "nixpkgs": [ - "nixpkgs" - ], - "systems": "systems_3" - }, + "packages": { + "flake": false, "locked": { - "lastModified": 1769173871, - "narHash": "sha256-vtcVJ/nlUVadTLoNsCb6HAYpwE/zOrlXljTnB5AyCsY=", - "owner": "notashelf", - "repo": "nvf", - "rev": "464a6f2641eecaf2a23b35a391b404b8efdcdb6a", - "type": "github" + "path": "./packages", + "type": "path" }, "original": { - "owner": "notashelf", - "repo": "nvf", - "type": "github" - } + "path": "./packages", + "type": "path" + }, + "parent": [] }, "pre-commit-hooks": { "inputs": { @@ -703,18 +648,32 @@ "inputs": { "agenix": "agenix", "agenix-rekey": "agenix-rekey", + "flake-parts": "flake-parts_2", "home-manager": "home-manager_2", + "import-tree": "import-tree", "niri": "niri", "nix-jmu-cs345": "nix-jmu-cs345", "nixos-hardware": "nixos-hardware", "nixpkgs": "nixpkgs", "noctalia": "noctalia", "nur": "nur", - "nvf": "nvf", - "stylix": "stylix", - "zen-browser": "zen-browser" + "packages": "packages", + "secrets": "secrets", + "stylix": "stylix" } }, + "secrets": { + "flake": false, + "locked": { + "path": "./secrets", + "type": "path" + }, + "original": { + "path": "./secrets", + "type": "path" + }, + "parent": [] + }, "stylix": { "inputs": { "base16": "base16", @@ -728,7 +687,7 @@ "nixpkgs" ], "nur": "nur_2", - "systems": "systems_4", + "systems": "systems_3", "tinted-foot": "tinted-foot", "tinted-kitty": "tinted-kitty", "tinted-schemes": "tinted-schemes", @@ -736,11 +695,11 @@ "tinted-zed": "tinted-zed" }, "locked": { - "lastModified": 1769471853, - "narHash": "sha256-aqs0HkV2T/7Syf/pYLRVSwfk23PPAyGJmWT43U5ZSF4=", + "lastModified": 1774897726, + "narHash": "sha256-k/H2/oyex6GEC6uYXYetrboFQeTmX1Ouwv/zaW7b/Z0=", "owner": "nix-community", "repo": "stylix", - "rev": "805fa4262a21ada28cc918fa014359b9b35caea7", + "rev": "9b4a5eb409ceac2dd6ad495c7988e189a418cd30", "type": "github" }, "original": { @@ -794,21 +753,6 @@ "type": "github" } }, - "systems_4": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } - }, "tinted-foot": { "flake": false, "locked": { @@ -913,14 +857,18 @@ }, "treefmt-nix_2": { "inputs": { - "nixpkgs": "nixpkgs_2" + "nixpkgs": [ + "noctalia", + "noctalia-qs", + "nixpkgs" + ] }, "locked": { - "lastModified": 1772660329, - "narHash": "sha256-IjU1FxYqm+VDe5qIOxoW+pISBlGvVApRjiw/Y/ttJzY=", + "lastModified": 1773297127, + "narHash": "sha256-6E/yhXP7Oy/NbXtf1ktzmU8SdVqJQ09HC/48ebEGBpk=", "owner": "numtide", "repo": "treefmt-nix", - "rev": "3710e0e1218041bbad640352a0440114b1e10428", + "rev": "71b125cd05fbfd78cab3e070b73544abe24c5016", "type": "github" }, "original": { @@ -949,11 +897,11 @@ "xwayland-satellite-unstable": { "flake": false, "locked": { - "lastModified": 1773499041, - "narHash": "sha256-XZ4/tVdLeAYDgKe4JD4C7yYUKydMxwt8c2j6APFWcIc=", + "lastModified": 1773622265, + "narHash": "sha256-wToKwH7IgWdGLMSIWksEDs4eumR6UbbsuPQ42r0oTXQ=", "owner": "Supreeeme", "repo": "xwayland-satellite", - "rev": "309d8e2a29953f7465dc14c939e2afe4682c0aa9", + "rev": "a879e5e0896a326adc79c474bf457b8b99011027", "type": "github" }, "original": { @@ -961,29 +909,6 @@ "repo": "xwayland-satellite", "type": "github" } - }, - "zen-browser": { - "inputs": { - "home-manager": [ - "home-manager" - ], - "nixpkgs": [ - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1769491693, - "narHash": "sha256-bbqeCDML1yXI6kpy8q8BshKRV1szk3xV0StAbzw4Z+o=", - "owner": "0xc000022070", - "repo": "zen-browser-flake", - "rev": "708e0f10aba5de7d0f55883d06fa08aa6a7cd462", - "type": "github" - }, - "original": { - "owner": "0xc000022070", - "repo": "zen-browser-flake", - "type": "github" - } } }, "root": "root", diff --git a/flake.nix b/flake.nix index aee4d8e..e5fd43f 100644 --- a/flake.nix +++ b/flake.nix @@ -4,6 +4,9 @@ inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + flake-parts.url = "github:hercules-ci/flake-parts"; + import-tree.url = "github:vic/import-tree"; + nixos-hardware.url = "github:NixOS/nixos-hardware"; home-manager = { @@ -11,11 +14,6 @@ inputs.nixpkgs.follows = "nixpkgs"; }; - nur = { - url = "github:nix-community/NUR"; - inputs.nixpkgs.follows = "nixpkgs"; - }; - agenix = { url = "github:ryantm/agenix"; inputs.nixpkgs.follows = "nixpkgs"; @@ -26,11 +24,16 @@ inputs.nixpkgs.follows = "nixpkgs"; }; - nvf = { - url = "github:notashelf/nvf"; + nur = { + url = "github:nix-community/NUR"; inputs.nixpkgs.follows = "nixpkgs"; }; + # nvf = { + # url = "github:notashelf/nvf"; + # inputs.nixpkgs.follows = "nixpkgs"; + # }; + stylix = { url = "github:nix-community/stylix"; inputs.nixpkgs.follows = "nixpkgs"; @@ -46,38 +49,27 @@ inputs.nixpkgs.follows = "nixpkgs"; }; - zen-browser = { - url = "github:0xc000022070/zen-browser-flake"; - inputs = { - # IMPORTANT: To ensure compatibility with the latest Firefox version, use nixpkgs-unstable. - nixpkgs.follows = "nixpkgs"; - home-manager.follows = "home-manager"; - }; - }; + # zen-browser = { + # url = "github:0xc000022070/zen-browser-flake"; + # inputs = { + # # IMPORTANT: To ensure compatibility with the latest Firefox version, use nixpkgs-unstable. + # nixpkgs.follows = "nixpkgs"; + # home-manager.follows = "home-manager"; + # }; + # }; nix-jmu-cs345.url = "github:Eclypsed/nix-jmu-cs345"; + + packages = { + flake = false; + url = "path:./packages"; + }; + + secrets = { + flake = false; + url = "path:./secrets"; + }; }; - outputs = - { - self, - nixpkgs, - agenix-rekey, - ... - }@inputs: - { - nixosConfigurations.vanta = nixpkgs.lib.nixosSystem { - system = "x86_64-linux"; - specialArgs = { inherit inputs; }; - modules = [ - ./modules/system - ./hosts/vanta - ]; - }; - - agenix-rekey = agenix-rekey.configure { - userFlake = self; - nixosConfigurations = self.nixosConfigurations; - }; - }; + outputs = inputs: inputs.flake-parts.lib.mkFlake { inherit inputs; } (inputs.import-tree ./modules); } diff --git a/hosts/hosts.nix b/hosts/hosts.nix deleted file mode 100644 index d4923b2..0000000 --- a/hosts/hosts.nix +++ /dev/null @@ -1,21 +0,0 @@ -{ - lib, - ... -}: -{ - options.host = { - name = lib.mkOption { - type = lib.types.str; - description = "Logical host name"; - }; - - # Host public SSH key (e.g. /etc/ssh/ssh_host_ed25519_key.pub). - # We only set the hostPubkey if one is supplied. For new hosts the pub key will not - # exist until it is generated after the first rebuild. - pubKey = lib.mkOption { - type = lib.types.nullOr lib.types.str; - default = null; - description = "The public key of the host. Will be null until generated on first rebuild"; - }; - }; -} diff --git a/hosts/vanta/default.nix b/hosts/vanta/default.nix deleted file mode 100644 index a76f075..0000000 --- a/hosts/vanta/default.nix +++ /dev/null @@ -1,17 +0,0 @@ -{ - inputs, - ... -}: -{ - imports = [ - inputs.nixos-hardware.nixosModules.framework-12th-gen-intel - ./hardware-configuration.nix - ../../profiles/intel.nix - ../hosts.nix - ]; - - host = { - name = "vanta"; - pubKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAaDVBJdMDFL8r9NQCbaLe+DPHGhGzRv2N7+7m1/U8DP"; - }; -} diff --git a/hosts/vanta/hardware-configuration.nix b/hosts/vanta/hardware-configuration.nix deleted file mode 100644 index f2ccdd8..0000000 --- a/hosts/vanta/hardware-configuration.nix +++ /dev/null @@ -1,40 +0,0 @@ -# Do not modify this file! It was generated by ‘nixos-generate-config’ -# and may be overwritten by future invocations. Please make changes -# to /etc/nixos/configuration.nix instead. -{ config, lib, pkgs, modulesPath, ... }: - -{ - imports = - [ (modulesPath + "/installer/scan/not-detected.nix") - ]; - - boot.initrd.availableKernelModules = [ "xhci_pci" "thunderbolt" "nvme" "usbhid" "usb_storage" "sd_mod" ]; - boot.initrd.kernelModules = [ ]; - boot.kernelModules = [ "kvm-intel" ]; - boot.extraModulePackages = [ ]; - - fileSystems."/" = - { device = "/dev/disk/by-uuid/1df00fd1-f531-49b9-9dc6-6d17ca39b67a"; - fsType = "ext4"; - }; - - fileSystems."/boot" = - { device = "/dev/disk/by-uuid/EE0E-CAE4"; - fsType = "vfat"; - options = [ "fmask=0077" "dmask=0077" ]; - }; - - swapDevices = - [ { device = "/dev/disk/by-uuid/fbacd982-b161-447c-a34a-7b44bc063a08"; } - ]; - - # Enables DHCP on each ethernet and wireless interface. In case of scripted networking - # (the default) this is the recommended approach. When using systemd-networkd it's - # still possible to use this option, but it's recommended to use it in conjunction - # with explicit per-interface declarations with `networking.interfaces..useDHCP`. - networking.useDHCP = lib.mkDefault true; - # networking.interfaces.wlp166s0.useDHCP = lib.mkDefault true; - - nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; - hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; -} diff --git a/modules/unused/fonts.nix b/modules/_unused/fonts.nix similarity index 100% rename from modules/unused/fonts.nix rename to modules/_unused/fonts.nix diff --git a/modules/unused/hypr/default.nix b/modules/_unused/hypr/default.nix similarity index 100% rename from modules/unused/hypr/default.nix rename to modules/_unused/hypr/default.nix diff --git a/modules/unused/hypr/hyprland.nix b/modules/_unused/hypr/hyprland.nix similarity index 100% rename from modules/unused/hypr/hyprland.nix rename to modules/_unused/hypr/hyprland.nix diff --git a/modules/unused/hypr/keybinds.nix b/modules/_unused/hypr/keybinds.nix similarity index 100% rename from modules/unused/hypr/keybinds.nix rename to modules/_unused/hypr/keybinds.nix diff --git a/modules/unused/hypr/monitors.nix b/modules/_unused/hypr/monitors.nix similarity index 100% rename from modules/unused/hypr/monitors.nix rename to modules/_unused/hypr/monitors.nix diff --git a/modules/unused/hypr/pyprland.nix b/modules/_unused/hypr/pyprland.nix similarity index 100% rename from modules/unused/hypr/pyprland.nix rename to modules/_unused/hypr/pyprland.nix diff --git a/modules/unused/hypridle.nix b/modules/_unused/hypridle.nix similarity index 100% rename from modules/unused/hypridle.nix rename to modules/_unused/hypridle.nix diff --git a/modules/unused/hyprlock.nix b/modules/_unused/hyprlock.nix similarity index 100% rename from modules/unused/hyprlock.nix rename to modules/_unused/hyprlock.nix diff --git a/modules/unused/mango.nix b/modules/_unused/mango.nix similarity index 100% rename from modules/unused/mango.nix rename to modules/_unused/mango.nix diff --git a/modules/home/nvf.nix b/modules/_unused/nvf.nix similarity index 100% rename from modules/home/nvf.nix rename to modules/_unused/nvf.nix diff --git a/modules/unused/plasma.nix b/modules/_unused/plasma.nix similarity index 100% rename from modules/unused/plasma.nix rename to modules/_unused/plasma.nix diff --git a/modules/unused/swaync.nix b/modules/_unused/swaync.nix similarity index 100% rename from modules/unused/swaync.nix rename to modules/_unused/swaync.nix diff --git a/modules/unused/vscode.nix b/modules/_unused/vscode.nix similarity index 100% rename from modules/unused/vscode.nix rename to modules/_unused/vscode.nix diff --git a/modules/unused/waybar/default.nix b/modules/_unused/waybar/default.nix similarity index 100% rename from modules/unused/waybar/default.nix rename to modules/_unused/waybar/default.nix diff --git a/modules/unused/waybar/modules/backlight.nix b/modules/_unused/waybar/modules/backlight.nix similarity index 100% rename from modules/unused/waybar/modules/backlight.nix rename to modules/_unused/waybar/modules/backlight.nix diff --git a/modules/unused/waybar/modules/battery.nix b/modules/_unused/waybar/modules/battery.nix similarity index 100% rename from modules/unused/waybar/modules/battery.nix rename to modules/_unused/waybar/modules/battery.nix diff --git a/modules/unused/waybar/modules/bluetooth.nix b/modules/_unused/waybar/modules/bluetooth.nix similarity index 100% rename from modules/unused/waybar/modules/bluetooth.nix rename to modules/_unused/waybar/modules/bluetooth.nix diff --git a/modules/unused/waybar/modules/clock.nix b/modules/_unused/waybar/modules/clock.nix similarity index 100% rename from modules/unused/waybar/modules/clock.nix rename to modules/_unused/waybar/modules/clock.nix diff --git a/modules/unused/waybar/modules/cpu.nix b/modules/_unused/waybar/modules/cpu.nix similarity index 100% rename from modules/unused/waybar/modules/cpu.nix rename to modules/_unused/waybar/modules/cpu.nix diff --git a/modules/unused/waybar/modules/disk.nix b/modules/_unused/waybar/modules/disk.nix similarity index 100% rename from modules/unused/waybar/modules/disk.nix rename to modules/_unused/waybar/modules/disk.nix diff --git a/modules/unused/waybar/modules/hyprland-window.nix b/modules/_unused/waybar/modules/hyprland-window.nix similarity index 100% rename from modules/unused/waybar/modules/hyprland-window.nix rename to modules/_unused/waybar/modules/hyprland-window.nix diff --git a/modules/unused/waybar/modules/hyprland-workspaces.nix b/modules/_unused/waybar/modules/hyprland-workspaces.nix similarity index 100% rename from modules/unused/waybar/modules/hyprland-workspaces.nix rename to modules/_unused/waybar/modules/hyprland-workspaces.nix diff --git a/modules/unused/waybar/modules/hyprpicker.nix b/modules/_unused/waybar/modules/hyprpicker.nix similarity index 100% rename from modules/unused/waybar/modules/hyprpicker.nix rename to modules/_unused/waybar/modules/hyprpicker.nix diff --git a/modules/unused/waybar/modules/idle-inhibitor.nix b/modules/_unused/waybar/modules/idle-inhibitor.nix similarity index 100% rename from modules/unused/waybar/modules/idle-inhibitor.nix rename to modules/_unused/waybar/modules/idle-inhibitor.nix diff --git a/modules/unused/waybar/modules/memory.nix b/modules/_unused/waybar/modules/memory.nix similarity index 100% rename from modules/unused/waybar/modules/memory.nix rename to modules/_unused/waybar/modules/memory.nix diff --git a/modules/unused/waybar/modules/menu.nix b/modules/_unused/waybar/modules/menu.nix similarity index 100% rename from modules/unused/waybar/modules/menu.nix rename to modules/_unused/waybar/modules/menu.nix diff --git a/modules/unused/waybar/modules/mpris.nix b/modules/_unused/waybar/modules/mpris.nix similarity index 100% rename from modules/unused/waybar/modules/mpris.nix rename to modules/_unused/waybar/modules/mpris.nix diff --git a/modules/unused/waybar/modules/network.nix b/modules/_unused/waybar/modules/network.nix similarity index 100% rename from modules/unused/waybar/modules/network.nix rename to modules/_unused/waybar/modules/network.nix diff --git a/modules/unused/waybar/modules/power.nix b/modules/_unused/waybar/modules/power.nix similarity index 100% rename from modules/unused/waybar/modules/power.nix rename to modules/_unused/waybar/modules/power.nix diff --git a/modules/unused/waybar/modules/temperature.nix b/modules/_unused/waybar/modules/temperature.nix similarity index 100% rename from modules/unused/waybar/modules/temperature.nix rename to modules/_unused/waybar/modules/temperature.nix diff --git a/modules/unused/waybar/modules/tray.nix b/modules/_unused/waybar/modules/tray.nix similarity index 100% rename from modules/unused/waybar/modules/tray.nix rename to modules/_unused/waybar/modules/tray.nix diff --git a/modules/unused/waybar/modules/wireplumber.nix b/modules/_unused/waybar/modules/wireplumber.nix similarity index 100% rename from modules/unused/waybar/modules/wireplumber.nix rename to modules/_unused/waybar/modules/wireplumber.nix diff --git a/modules/unused/wlogout.nix b/modules/_unused/wlogout.nix similarity index 100% rename from modules/unused/wlogout.nix rename to modules/_unused/wlogout.nix diff --git a/modules/home/zen-browser.nix b/modules/_unused/zen-browser.nix similarity index 100% rename from modules/home/zen-browser.nix rename to modules/_unused/zen-browser.nix diff --git a/modules/features/agenix.nix b/modules/features/agenix.nix new file mode 100644 index 0000000..8f9214f --- /dev/null +++ b/modules/features/agenix.nix @@ -0,0 +1,51 @@ +{ + inputs, + ... +}: +{ + imports = [ + inputs.agenix-rekey.flakeModule + ]; + + perSystem = + { config, pkgs, ... }: + { + devShells.nix = pkgs.mkShell { + nativeBuildInputs = [ config.agenix-rekey.package ]; + }; + + agenix-rekey.nixosConfigurations = inputs.self.nixosConfigurations; + }; + + flake.modules.nixos.agenix = + { + config, + lib, + ... + }: + { + imports = [ + inputs.agenix.nixosModules.default + inputs.agenix-rekey.nixosModules.default + ]; + + services.openssh.generateHostKeys = true; + + age = { + # Need to explicitly set identity paths because OpenSSH daemon is disabled + # but the host keys are still generated via services.openssh.generateHostKeys = true + identityPaths = map (key: key.path) config.services.openssh.hostKeys; + rekey = { + masterIdentities = [ (inputs.secrets + "/age-yubikey-identity-d9ed335b.pub") ]; + storageMode = "local"; + localStorageDir = inputs.secrets + "/rekeyed/${config.networking.hostName}"; + } + # We only set the hostPubkey if one is supplied. For new hosts the pub key will not + # exist until it is generated after the first rebuild. Runtime decryption will fail + # but then the ssh host key will be generated in /etc/ssh and can be supplied + // lib.optionalAttrs (config.hostPubkey != null) { + hostPubkey = config.hostPubkey; + }; + }; + }; +} diff --git a/modules/features/bluetooth.nix b/modules/features/bluetooth.nix new file mode 100644 index 0000000..1cd9696 --- /dev/null +++ b/modules/features/bluetooth.nix @@ -0,0 +1,10 @@ +{ + flake.modules.nixos.bluetooth = { + hardware = { + bluetooth = { + enable = true; + powerOnBoot = false; + }; + }; + }; +} diff --git a/modules/features/boot.nix b/modules/features/boot.nix new file mode 100644 index 0000000..1d14012 --- /dev/null +++ b/modules/features/boot.nix @@ -0,0 +1,13 @@ +{ + flake.modules.nixos.boot = { + boot = { + loader = { + systemd-boot = { + enable = true; + configurationLimit = 10; + }; + efi.canTouchEfiVariables = true; + }; + }; + }; +} diff --git a/modules/features/direnv.nix b/modules/features/direnv.nix new file mode 100644 index 0000000..f9ce48c --- /dev/null +++ b/modules/features/direnv.nix @@ -0,0 +1,8 @@ +{ + flake.modules.homeManager.direnv = { + programs.direnv = { + enable = true; + enableZshIntegration = true; + }; + }; +} diff --git a/modules/features/fastfetch.nix b/modules/features/fastfetch.nix new file mode 100644 index 0000000..e921012 --- /dev/null +++ b/modules/features/fastfetch.nix @@ -0,0 +1,7 @@ +{ + flake.modules.homeManager.fastfetch = { + programs.fastfetch = { + enable = true; + }; + }; +} diff --git a/modules/features/firefox.nix b/modules/features/firefox.nix new file mode 100644 index 0000000..0365bd2 --- /dev/null +++ b/modules/features/firefox.nix @@ -0,0 +1,161 @@ +{ + flake.modules.homeManager.firefox = + { + config, + pkgs, + lib, + ... + }: + { + # This gets around having to run `pywalfox install` manually, which just creates this manifest + home.file.".mozilla/native-messaging-hosts/pywalfox.json".text = builtins.toJSON { + name = "pywalfox"; + description = "Automatically theme your browser using the colors generated by Pywal"; + path = lib.getExe' pkgs.pywalfox-native "pywalfox"; + # path = "${pkgs.pywalfox-native}/bin/pywalfox"; + type = "stdio"; + allowed_extensions = [ "pywalfox@frewacom.org" ]; + }; + + programs.firefox = { + enable = true; + languagePacks = [ "en-US" ]; + nativeMessagingHosts = with pkgs; [ + pywalfox-native + ]; + policies = { + DefaultDownloadDirectory = config.xdg.userDirs.download; + DisableFirefoxAccounts = true; + DisableFirefoxStudies = true; + DisablePocket = true; + DisableProfileImport = true; + DisableProfileRefresh = true; + DisableTelemetry = true; + DisplayBookmarksToolbar = "never"; + DontCheckDefaultBrowser = true; + EnableTrackingProtection = { + Value = true; # Tracking protection is enabled by default in both the regular browser and private browsing + Locked = true; # Whether or not a user can change tracking protection + Cryptomining = true; # Block cryptomining scripts + Fingerprinting = true; # Block fingerprinting scripts + EmailTracking = true; # Block email tracking pixels and scripts + }; + FirefoxHome = { + Search = true; + TopSites = true; + SponsoredTopSites = false; + Highlights = false; + Pocket = false; + Stories = false; + SponsoredPocket = false; + SponsoredStories = false; + Snippets = true; + Locked = true; + }; + FirefoxSuggest = { + WebSuggestions = true; + SponsoredSuggestions = false; + ImproveSuggest = false; + Locked = true; + }; + Homepage = { + URL = "http://100.78.212.35:30054"; + Locked = true; + StartPage = "homepage"; + }; + OfferToSaveLogins = false; + OverrideFirstRunPage = ""; + PasswordManagerEnabled = false; + PopupBlocking = { + Default = false; + Locked = true; + }; + PrimaryPassword = false; + SearchBar = "unified"; + ShowHomeButton = true; + SkipTermsOfUse = true; + }; + profiles.eclypse = { + name = "Eclypse"; + isDefault = true; + extensions = { + force = true; + # For a list of available packaged extensions, see: + # https://github.com/nix-community/nur-combined/blob/main/repos/rycee/pkgs/firefox-addons/addons.json + packages = with pkgs.nur.repos.rycee.firefox-addons; [ + ublock-origin + bitwarden + pywalfox + ]; + settings = { + "uBlock0@raymondhill.net".settings = { + selectedFilterLists = [ + "ublock-filters" + "ublock-badware" + "ublock-privacy" + "ublock-unbreak" + "ublock-quick-fixes" + ]; + }; + }; + }; + search = { + default = "google"; + force = true; + engines = { + nix-packages = { + name = "Nix Packages"; + urls = [ + { + template = "https://search.nixos.org/packages"; + params = [ + { + name = "channel"; + value = "unstable"; + } + { + name = "query"; + value = "{searchTerms}"; + } + ]; + } + ]; + icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; + definedAliases = [ "@np" ]; + }; + home-manager = { + name = "Home Manager"; + urls = [ + { + template = "https://home-manager-options.extranix.com"; + params = [ + { + name = "query"; + value = "{searchTerms}"; + } + ]; + } + ]; + icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; + definedAliases = [ "@hm" ]; + }; + surugaya = { + name = "Surugaya"; + urls = [ + { + template = "https://www.suruga-ya.jp/search?search_word={searchTerms}"; + } + ]; + iconMapObj."16" = "https://www.suruga-ya.jp/drupal/themes/surugaya/favicon.ico"; + definedAliases = [ "@suru" ]; + }; + }; + }; + settings = { + # Auto-enable extensions + "extensions.autoDisableScopes" = 0; + }; + }; + }; + }; +} diff --git a/modules/features/firmware.nix b/modules/features/firmware.nix new file mode 100644 index 0000000..7019652 --- /dev/null +++ b/modules/features/firmware.nix @@ -0,0 +1,7 @@ +{ + flake.modules.nixos.firmware = { + services.fwupd = { + enable = true; + }; + }; +} diff --git a/modules/features/foot.nix b/modules/features/foot.nix new file mode 100644 index 0000000..5ed9a7e --- /dev/null +++ b/modules/features/foot.nix @@ -0,0 +1,21 @@ +{ + flake.modules.homeManager.foot = + { config, ... }: + { + programs.foot = { + enable = true; + server.enable = false; + settings = { + main = { + term = "xterm-256color"; + include = "${config.xdg.configHome}/foot/themes/noctalia"; + dpi-aware = "no"; + font = "${config.stylix.fonts.monospace.name}:size=${toString config.stylix.fonts.sizes.terminal}"; + }; + mouse = { + hide-when-typing = "yes"; + }; + }; + }; + }; +} diff --git a/modules/features/fprintd.nix b/modules/features/fprintd.nix new file mode 100644 index 0000000..c7f125e --- /dev/null +++ b/modules/features/fprintd.nix @@ -0,0 +1,5 @@ +{ + flake.modules.nixos.fprintd = { + services.fprintd.enable = true; + }; +} diff --git a/modules/features/fzf.nix b/modules/features/fzf.nix new file mode 100644 index 0000000..b8bbe9e --- /dev/null +++ b/modules/features/fzf.nix @@ -0,0 +1,8 @@ +{ + flake.modules.homeManager.fzf = { + programs.fzf = { + enable = true; + enableZshIntegration = true; + }; + }; +} diff --git a/modules/features/gdm.nix b/modules/features/gdm.nix new file mode 100644 index 0000000..5d6923c --- /dev/null +++ b/modules/features/gdm.nix @@ -0,0 +1,10 @@ +{ + flake.modules.nixos.gdm = { + services.displayManager = { + gdm = { + enable = true; + wayland = true; + }; + }; + }; +} diff --git a/modules/features/git.nix b/modules/features/git.nix new file mode 100644 index 0000000..e338c46 --- /dev/null +++ b/modules/features/git.nix @@ -0,0 +1,43 @@ +{ + flake.modules.homeManager.git = + { + pkgs, + config, + ... + }: + let + name = "Eclypsed"; + email = "Ec1ypsed@proton.me"; + signingKey = "sk-ssh-ed25519@openssh.com AAAAGnNrLXNzaC1lZDI1NTE5QG9wZW5zc2guY29tAAAAIB2h6y1Al2OVotYIpwPZMjiBLAncAI2pAPgES2+gVbJqAAAABHNzaDo= ssh:"; + in + { + home.packages = with pkgs; [ git-ignore ]; + + xdg.configFile."git/allowed_signers".text = '' + ${email} namespaces="git" ${signingKey} + ''; + + programs = { + git = { + enable = true; + settings = { + user = { inherit name email; }; + init = { + defaultBranch = "main"; + }; + gpg.ssh.allowedSignersFile = "${config.xdg.configHome}/git/allowed_signers"; + }; + signing = { + format = "ssh"; + key = "${config.home.homeDirectory}/.ssh/id_ed25519_sk_rk.pub"; + signByDefault = true; + }; + }; + lazygit = { + enable = true; + enableZshIntegration = true; + shellWrapperName = "lg"; + }; + }; + }; +} diff --git a/modules/features/helix.nix b/modules/features/helix.nix new file mode 100644 index 0000000..9ba4732 --- /dev/null +++ b/modules/features/helix.nix @@ -0,0 +1,362 @@ +{ + flake.modules.homeManager.helix = + { + pkgs, + ... + }: + let + yazi-picker = pkgs.writeShellApplication { + name = "yazi-picker"; + text = '' + paths=$(yazi --chooser-file=/dev/stdout) + + if [[ -n "$paths" ]]; then + zellij action toggle-floating-panes + zellij action write 27 # send key + zellij action write-chars ":$1 $paths" + zellij action write 13 # send key + else + zellij action toggle-floating-panes + fi + ''; + }; + in + { + home.packages = [ yazi-picker ]; + + programs.helix = { + enable = true; + defaultEditor = true; + extraPackages = with pkgs; [ + basedpyright # Python static type checker + ruff # Pyhton linter and formatter + nixd # Nix language server + nixfmt # Nix formatter + rust-analyzer # Rust language server + rustfmt # Rust formmater + clippy # Rust linter + lldb # Debugger for llvm languages + marksman # Markdown language server + markdown-oxide # Markdown PKM language server + rumdl # Markdown linter and formatter + libclang # C language family frontend for LLVM + typescript-language-server # Typescript language server + vscode-langservers-extracted # HTML/CSS/JSON/ESLint language servers extracted from vscode + emmet-language-server # Emmet support based on LSP + prettier # Formatter for HTML/CSS/JSON/ESLint languages + superhtml # HTML Language server and Templating Language Library + ruby-lsp # Ruby language server + solargraph # Alternative ruby language server + rubocop # Ruby linter and formatter + jdt-language-server # Java language server + ]; + settings = { + editor = { + line-number = "relative"; + cursorline = true; + auto-format = true; + completion-timeout = 5; + completion-trigger-len = 1; + bufferline = "always"; + color-modes = true; + end-of-line-diagnostics = "hint"; + lsp = { + display-inlay-hints = true; + }; + cursor-shape = { + insert = "bar"; + normal = "block"; + select = "underline"; + }; + indent-guides = { + render = true; + skip-levels = 1; + }; + soft-wrap = { + enable = true; + max-indent-retain = 80; + }; + inline-diagnostics = { + cursor-line = "warning"; + }; + }; + keys = + let + arrow_keys = { + "up" = "jump_view_up"; + "down" = "jump_view_down"; + "left" = "jump_view_left"; + "right" = "jump_view_right"; + }; + in + { + normal = { + "C-y" = + ":sh zellij run -n Yazi -c -f -x 10%% -y 10%% --width 80%% --height 80%% -- yazi-picker open %{buffer_name}"; + } + // arrow_keys; + insert = { + "C-k" = "move_visual_line_up"; + "C-j" = "move_visual_line_down"; + "C-h" = "move_char_left"; + "C-l" = "move_char_right"; + } + // arrow_keys; + select = { } // arrow_keys; + }; + theme = "catppuccin_mocha"; + }; + # Check https://github.com/helix-editor/helix/blob/master/languages.toml for default language configuration + # Only explictly set options you want to override / make explicit + languages = { + language = [ + { + name = "python"; + language-servers = [ + "basedpyright" + "ruff" + ]; + auto-format = true; + formatter = { + command = "ruff"; + args = [ + "format" + "-" + ]; + }; + } + { + name = "nix"; + language-servers = [ "nixd" ]; + auto-format = true; + formatter = { + command = "nixfmt"; + }; + } + { + name = "rust"; + auto-format = true; + formatter = { + command = "rustfmt"; + }; + } + { + name = "markdown"; + auto-format = true; + formatter = { + command = "rumdl"; + args = [ + "fmt" + "-" + ]; + }; + } + { + name = "c"; + file-types = [ + "c" + "h" + ]; # "h" is currently missing from the default config + auto-format = true; + formatter = { + command = "clang-format"; + args = [ + "--style=WebKit" + ]; + }; + } + { + name = "typescript"; + language-servers = [ + "typescript-language-server" + "vscode-eslint-language-server" + "emmet-language-server" + ]; + auto-format = true; + formatter = { + command = "prettier"; + args = [ + "--parser" + "typescript" + ]; + }; + } + { + name = "tsx"; + language-servers = [ + "typescript-language-server" + "vscode-eslint-language-server" + "emmet-language-server" + ]; + auto-format = true; + formatter = { + command = "prettier"; + args = [ + "--parser" + "typescript" + ]; + }; + } + { + name = "javascript"; + language-servers = [ + "typescript-language-server" + "vscode-eslint-language-server" + "emmet-language-server" + ]; + auto-format = true; + formatter = { + command = "prettier"; + args = [ + "--parser" + "typescript" + ]; + }; + } + { + name = "jsx"; + language-servers = [ + "typescript-language-server" + "vscode-eslint-language-server" + "emmet-language-server" + ]; + auto-format = true; + formatter = { + command = "prettier"; + args = [ + "--parser" + "typescript" + ]; + }; + } + { + name = "json"; + auto-format = true; + formatter = { + command = "prettier"; + args = [ + "--parser" + "json" + ]; + }; + } + { + name = "jsonc"; + auto-format = true; + formatter = { + command = "prettier"; + args = [ + "--parser" + "jsonc" + ]; + }; + } + { + name = "html"; + language-servers = [ + "vscode-html-language-server" + { + name = "superhtml"; + except-features = [ "format" ]; + } + "emmet-language-server" + ]; + auto-format = true; + formatter = { + command = "prettier"; + args = [ + "--parser" + "html" + ]; + }; + } + { + name = "css"; + language-servers = [ + "vscode-css-language-server" + "emmet-language-server" + ]; + auto-format = true; + formatter = { + command = "prettier"; + args = [ + "--parser" + "css" + ]; + }; + } + { + name = "scss"; + language-servers = [ + "vscode-css-language-server" + "emmet-language-server" + ]; + auto-format = true; + formatter = { + command = "prettier"; + args = [ + "--parser" + "scss" + ]; + }; + } + { + name = "ruby"; + language-servers = [ + "ruby-lsp" + "solargraph" + ]; + auto-format = true; + formatter = { + command = "rubocop"; + args = [ + "--stdin" + "placeholder.rb" + "-a" + "--stderr" + "--fail-level" + "fatal" + ]; + }; + } + ]; + language-server = { + basedpyright.config.python.analysis.typeCheckingMode = "strict"; + rust-analyzer.config.check.command = "clippy"; + emmet-language-server = { + command = "emmet-language-server"; + args = [ "--stdio" ]; + }; + vscode-eslint-language-server = { + config = { + # Automatically fix ESLint errors + codeActionsOnSave = { + mode = "all"; + "source.fixAll.eslint" = true; + }; + quiet = false; + experimental = { + # Support for the modern ESLint configuration format + useFlatConfig = true; + }; + }; + }; + ruby-lsp = { + command = "ruby-lsp"; + config = { + diagnostics = true; + formatting = true; + }; + }; + solargraph = { + command = "solargraph"; + config = { + diagnostics = true; + formatting = false; + }; + }; + }; + }; + }; + }; +} diff --git a/modules/features/kanshi.nix b/modules/features/kanshi.nix new file mode 100644 index 0000000..295960a --- /dev/null +++ b/modules/features/kanshi.nix @@ -0,0 +1,38 @@ +{ + flake.modules.homeManager.kanshi = { + services.kanshi = { + enable = true; + settings = [ + { + profile = { + name = "laptop"; + outputs = [ + { + criteria = "eDP-1"; + status = "enable"; + scale = 1.0; + } + ]; + }; + } + { + profile = { + name = "docked"; + outputs = [ + { + criteria = "eDP-1"; + status = "disable"; + } + { + criteria = "LG Electronics LG TV SSCR2 *"; + mode = "3840x2160@120Hz"; + scale = 1.0; + status = "enable"; + } + ]; + }; + } + ]; + }; + }; +} diff --git a/modules/features/network.nix b/modules/features/network.nix new file mode 100644 index 0000000..de5f499 --- /dev/null +++ b/modules/features/network.nix @@ -0,0 +1,19 @@ +{ + flake.modules.nixos.network = { + networking = { + # Pick only one of the below networking options. + # wireless.enable = true; # Enables wireless support via wpa_supplicant. + networkmanager.enable = true; # Easiest to use and most distros use this by default. + + # Configure network proxy if necessary + # proxy.default = "http://user:password@proxy:port/"; + # proxy.noProxy = "127.0.0.1,localhost,internal.domain"; + + # Open ports in the firewall. + # firewall.allowedTCPPorts = [ ... ]; + # firewall.allowedUDPPorts = [ ... ]; + # Or disable the firewall altogether. + # firewall.enable = false; + }; + }; +} diff --git a/modules/features/niri.nix b/modules/features/niri.nix new file mode 100644 index 0000000..5c2bf6f --- /dev/null +++ b/modules/features/niri.nix @@ -0,0 +1,509 @@ +{ + inputs, + ... +}: +{ + flake.modules.nixos.niri = + { pkgs, ... }: + { + imports = [ + inputs.niri.nixosModules.niri + ]; + + nixpkgs.overlays = [ inputs.niri.overlays.niri ]; + + programs = { + niri = { + enable = true; + package = pkgs.niri-unstable; + }; + uwsm = { + waylandCompositors.niri = { + prettyName = "Niri"; + binPath = "/run/current-system/sw/bin/niri-session"; + }; + }; + }; + + environment.systemPackages = [ pkgs.xwayland-satellite-unstable ]; + }; + + flake.modules.homeManager.niri = + { + pkgs, + lib, + config, + ... + }: + let + # Executables + foot = lib.getExe' config.programs.foot.package "foot"; + vicinae = lib.getExe' config.programs.vicinae.package "vicinae"; + yazi = lib.getExe' config.programs.yazi.package "yazi"; + noctalia-shell = lib.getExe' config.programs.noctalia-shell.package "noctalia-shell"; + playerctl = lib.getExe' pkgs.playerctl "playerctl"; + wpctl = lib.getExe' pkgs.wireplumber "wpctl"; + brightnessctl = lib.getExe' pkgs.brightnessctl "brightnessctl"; + in + { + programs.niri = { + # Niri is enabled by niri.nixosModules.niri + settings = { + input = { + keyboard = { + xkb = { + layout = "us"; + options = "compose:ralt"; + }; + }; + touchpad = { + enable = true; + click-method = "clickfinger"; + drag = true; + drag-lock = true; + dwt = true; + natural-scroll = false; + scroll-method = "two-finger"; + tap = true; + tap-button-map = "left-right-middle"; # Mouse button click to register when tapping with 1, 2, or 3 fingers + }; + warp-mouse-to-focus = { + enable = true; + mode = "center-xy-always"; + }; + focus-follows-mouse = { + enable = true; + }; + mod-key = "Super"; + }; + binds = { + # General + "Mod+Slash" = { + action.show-hotkey-overlay = { }; + repeat = false; + hotkey-overlay.title = "Show hotkeys"; + }; + "Mod+Q" = { + action.close-window = { }; + repeat = false; + hotkey-overlay.title = "Close window"; + }; + "Mod+W" = { + action.spawn = foot; + repeat = false; + hotkey-overlay.title = "Terminal"; + }; + "Mod+A" = { + action.spawn = [ + vicinae + "toggle" + ]; + repeat = false; + hotkey-overlay.title = "Launcher"; + }; + "Mod+E" = { + action.spawn = [ + foot + "-e" + yazi + ]; + repeat = false; + hotkey-overlay.title = "File Explorer"; + }; + "Mod+Escape" = { + action.spawn = [ + noctalia-shell + "ipc" + "call" + "sessionMenu" + "toggle" + ]; + repeat = false; + hotkey-overlay.title = "Session menu"; + }; + + # Notifications + "Mod+N" = { + action.spawn = [ + noctalia-shell + "ipc" + "call" + "notifications" + "toggleHistory" + ]; + repeat = false; + hotkey-overlay.title = "Show notifications"; + }; + "Mod+Ctrl+N" = { + action.spawn = [ + noctalia-shell + "ipc" + "call" + "notifications" + "clear" + ]; + repeat = false; + hotkey-overlay.title = "Clear notifications"; + }; + + # Media keys + "XF86AudioPrev" = { + action.spawn = [ + playerctl + "previous" + ]; + repeat = false; + hotkey-overlay.title = "Previous track"; + }; + "XF86AudioPlay" = { + action.spawn = [ + playerctl + "play-pause" + ]; + repeat = false; + hotkey-overlay.title = "Play / pause track"; + }; + "XF86AudioNext" = { + action.spawn = [ + playerctl + "next" + ]; + repeat = false; + hotkey-overlay.title = "Next track"; + }; + "XF86AudioRaiseVolume" = { + action.spawn = [ + wpctl + "set-volume" + "@DEFAULT_AUDIO_SINK@" + "0.05+" + ]; + repeat = true; + allow-when-locked = true; + hotkey-overlay.title = "Raise volume"; + }; + "XF86AudioLowerVolume" = { + action.spawn = [ + wpctl + "set-volume" + "@DEFAULT_AUDIO_SINK@" + "0.05-" + ]; + repeat = true; + allow-when-locked = true; + hotkey-overlay.title = "Lower volume"; + }; + "XF86AudioMute" = { + action.spawn = [ + wpctl + "set-mute" + "@DEFAULT_AUDIO_SINK@" + "toggle" + ]; + repeat = false; + allow-when-locked = true; + hotkey-overlay.title = "Mute playback"; + }; + "Alt+XF86AudioRaiseVolume" = { + action.spawn = [ + wpctl + "set-volume" + "@DEFAULT_AUDIO_SOURCE@" + "0.05+" + ]; + repeat = true; + allow-when-locked = true; + hotkey-overlay.title = "Raise microphone volume"; + }; + "Alt+XF86AudioLowerVolume" = { + action.spawn = [ + wpctl + "set-volume" + "@DEFAULT_AUDIO_SOURCE@" + "0.05-" + ]; + repeat = true; + allow-when-locked = true; + hotkey-overlay.title = "Lower microphone volume"; + }; + "Alt+XF86AudioMute" = { + action.spawn = [ + wpctl + "set-mute" + "@DEFAULT_AUDIO_SOURCE@" + "toggle" + ]; + repeat = false; + allow-when-locked = true; + hotkey-overlay.title = "Mute microphone"; + }; + + # Brightness + "XF86MonBrightnessUp" = { + action.spawn = [ + brightnessctl + "set" + "5%+" + ]; + repeat = true; + allow-when-locked = true; + hotkey-overlay.title = "Increase brightness"; + }; + "XF86MonBrightnessDown" = { + action.spawn = [ + brightnessctl + "set" + "5%-" + ]; + repeat = true; + allow-when-locked = true; + hotkey-overlay.title = "Decrease brightness"; + }; + + # Screen capture + "Print" = { + action.screenshot = { + show-pointer = false; + }; + repeat = false; + hotkey-overlay.title = "Screenshot"; + }; + "Mod+Print" = { + action.screenshot-window = { + # show-pointer = false; + }; + repeat = false; + hotkey-overlay.title = "Screenshot window"; + }; + "Shift+Print" = { + action.screenshot-screen = { + show-pointer = false; + }; + repeat = false; + hotkey-overlay.title = "Screenshot screen"; + }; + + # Display scaling + "Mod+Ctrl+Equal" = { + action.spawn = [ + "output-scale" + "+0.1" + ]; + repeat = true; + hotkey-overlay.title = "Increase display scale"; + }; + "Mod+Ctrl+Minus" = { + action.spawn = [ + "output-scale" + "-0.1" + ]; + repeat = true; + hotkey-overlay.title = "Decrease display scale"; + }; + "Mod+Ctrl+0" = { + action.spawn = [ + "output-scale" + "1.0" + ]; + repeat = true; + hotkey-overlay.title = "Reset display scale"; + }; + + # Window and column size + "Mod+F" = { + action.maximize-column = { }; + repeat = false; + hotkey-overlay.title = "Maximize Column"; + }; + "Mod+Shift+F" = { + action.fullscreen-window = { }; + repeat = false; + hotkey-overlay.title = "Fullscreen"; + }; + "Mod+Ctrl+F" = { + action.expand-column-to-available-width = { }; + repeat = false; + hotkey-overlay.title = "Fill empty column space"; + }; + "Mod+Equal" = { + action.set-column-width = "+10%"; + repeat = true; + hotkey-overlay.title = "Increase column width"; + }; + "Mod+Minus" = { + action.set-column-width = "-10%"; + repeat = true; + hotkey-overlay.title = "Decrease column width"; + }; + "Mod+Shift+Equal" = { + action.set-window-height = "+10%"; + repeat = true; + hotkey-overlay.title = "Increase window height"; + }; + "Mod+Shift+Minus" = { + action.set-window-height = "-10%"; + repeat = true; + hotkey-overlay.title = "Decrease window height"; + }; + "Mod+Z" = { + action.toggle-window-floating = { }; + repeat = false; + hotkey-overlay.title = "Toggle floating"; + }; + "Mod+T" = { + action.toggle-column-tabbed-display = { }; + repeat = false; + hotkey-overlay.title = "Toggle tabbed column"; + }; + + # Window and column movement + "Mod+K" = { + action.focus-window-or-monitor-up = { }; + repeat = false; + hotkey-overlay.title = "Focus window up"; + }; + "Mod+J" = { + action.focus-window-or-monitor-down = { }; + repeat = false; + hotkey-overlay.title = "Focus window down"; + }; + "Mod+H" = { + action.focus-column-or-monitor-left = { }; + repeat = false; + hotkey-overlay.title = "Focus window left"; + }; + "Mod+L" = { + action.focus-column-or-monitor-right = { }; + repeat = false; + hotkey-overlay.title = "Focus window right"; + }; + "Mod+BracketLeft" = { + action.consume-or-expel-window-left = { }; + repeat = false; + hotkey-overlay.title = "Move window left"; + }; + "Mod+BracketRight" = { + action.consume-or-expel-window-right = { }; + repeat = false; + hotkey-overlay.title = "Move window right"; + }; + "Mod+Shift+K" = { + action.move-column-to-monitor-up = { }; + repeat = false; + hotkey-overlay.title = "Move column up"; + }; + "Mod+Shift+J" = { + action.move-column-to-monitor-down = { }; + repeat = false; + hotkey-overlay.title = "Move column down"; + }; + "Mod+Shift+H" = { + action.move-column-left-or-to-monitor-left = { }; + repeat = false; + hotkey-overlay.title = "Move column left"; + }; + "Mod+Shift+L" = { + action.move-column-right-or-to-monitor-right = { }; + repeat = false; + hotkey-overlay.title = "Move column right"; + }; + + # Workspaces + "Mod+Ctrl+K" = { + action.focus-workspace-up = { }; + repeat = false; + hotkey-overlay.title = "Focus workspace up"; + }; + "Mod+Ctrl+J" = { + action.focus-workspace-down = { }; + repeat = false; + hotkey-overlay.title = "Focus workspace down"; + }; + "Mod+Ctrl+Shift+K" = { + action.move-column-to-workspace-up = { }; + repeat = false; + hotkey-overlay.title = "Move column to workspace up"; + }; + "Mod+Ctrl+Shift+J" = { + action.move-column-to-workspace-down = { }; + repeat = false; + hotkey-overlay.title = "Move column to workspace down"; + }; + + # Overview + "Mod+Tab" = { + action.toggle-overview = { }; + repeat = false; + hotkey-overlay.title = "Toggle overview"; + }; + }; + window-rules = [ + { + geometry-corner-radius = { + bottom-left = 10.0; + bottom-right = 10.0; + top-left = 10.0; + top-right = 10.0; + }; + clip-to-geometry = true; + } + # Unfortunately windows like firefox extensions set their titles after spawning preventing + # the window rules from being applied. There is a script to fix this but it is pretty hacky. + # { + # matches = [ + # { + # title = "^Extension:.*"; + # app-id = "firefox"; + # } + # ]; + # open-floating = true; + # } + { + matches = [ + { app-id = "foot"; } + { app-id = "Alacritty"; } + ]; + opacity = 0.90; + default-column-width.proportion = 0.4; + } + ]; + layer-rules = [ + { + # Use noctalia wallpaper as overview backdrop + matches = [ { namespace = "^noctalia-overview*"; } ]; + place-within-backdrop = true; + } + ]; + prefer-no-csd = true; + screenshot-path = "${config.xdg.userDirs.extraConfig.SCREENSHOTS}/%Y%m%d-%H%M%S.png"; + hotkey-overlay = { + skip-at-startup = true; + }; + spawn-at-startup = [ + { argv = [ "noctalia-shell" ]; } + ]; + cursor = { + size = config.stylix.cursor.size; + theme = config.stylix.cursor.name; + hide-when-typing = true; + }; + gestures = { + hot-corners.enable = false; + }; + xwayland-satellite = { + enable = true; + path = lib.getExe pkgs.xwayland-satellite-unstable; + }; + environment = { + "NIXOS_OZONE_WL" = "1"; + }; + debug = { + # Allows notification actions and window activation from Noctalia. + honor-xdg-activation-with-invalid-serial = { }; + }; + # Support for external 'includes' sounds like it is in the works. + # Will just have to wait until then for noctalia color scheme integration. + }; + }; + }; +} diff --git a/modules/features/nix.nix b/modules/features/nix.nix new file mode 100644 index 0000000..f27412f --- /dev/null +++ b/modules/features/nix.nix @@ -0,0 +1,45 @@ +{ + inputs, + self, + ... +}: +{ + flake.modules.nixos.nix = { + imports = [ + inputs.nur.modules.nixos.default + ]; + + nix = { + nixPath = [ "nixpkgs=${inputs.nixpkgs}" ]; + settings = { + experimental-features = [ + "nix-command" + "flakes" + ]; + substituters = [ + "https://cache.nixos.org" + "https://nix-community.cachix.org" + "https://devenv.cachix.org" + "https://hyprland.cachix.org" + "https://vicinae.cachix.org" + ]; + trusted-public-keys = [ + "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" + "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" + "devenv.cachix.org-1:w1cLUi8dv3hnoSPGAuibQv+f9TZLr6cv/Hm9XgU50cw=" + "hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc=" + "vicinae.cachix.org-1:1kDrfienkGHPYbkpNj1mWTr7Fm1+zcenzgTizIcI3oc=" + ]; + }; + }; + + nixpkgs = { + config.allowUnfree = true; + overlays = [ + self.overlays.default + ]; + }; + + programs.nix-ld.enable = true; + }; +} diff --git a/modules/features/noctalia.nix b/modules/features/noctalia.nix new file mode 100644 index 0000000..7faca03 --- /dev/null +++ b/modules/features/noctalia.nix @@ -0,0 +1,142 @@ +{ + inputs, + ... +}: +{ + flake.modules.homeManager.noctalia = + { + config, + ... + }: + { + imports = [ + inputs.noctalia.homeModules.default + ]; + + programs.noctalia-shell = { + enable = true; + settings = { + general = { + avatarImage = "~/.face"; + autoStartAuth = true; + allowPasswordWithFprintd = true; + }; + location.name = "Washington DC"; + bar = { + widgets = { + right = [ + { + id = "plugin:tailscale"; + } + { + id = "Tray"; + } + { + id = "NotificationHistory"; + } + { + id = "Battery"; + } + { + id = "Volume"; + } + { + id = "Brightness"; + } + { + id = "ControlCenter"; + } + ]; + }; + }; + templates = { + activeTemplates = [ + { + enabled = true; + id = "alacritty"; + } + { + enabled = true; + id = "discord"; + } + { + enabled = true; + id = "foot"; + } + { + enabled = true; + id = "gtk"; + } + { + enabled = true; + id = "helix"; + } + { + enabled = true; + id = "niri"; + } + { + enabled = true; + id = "pywalfox"; + } + { + enabled = true; + id = "qt"; + } + { + enabled = true; + id = "vicinae"; + } + { + enabled = true; + id = "yazi"; + } + { + enabled = true; + id = "zed"; + } + ]; + enableUserTheming = true; + }; + wallpaper = { + enabled = true; + overviewEnabled = true; + directory = "${config.xdg.userDirs.extraConfig.WALLPAPERS}"; + }; + colorSchemes.predefinedScheme = "Catppuccin"; + }; + plugins = { + sources = [ + { + enabled = true; + name = "Noctalia Plugins"; + url = "https://github.com/noctalia-dev/noctalia-plugins"; + } + ]; + states = { + tailscale = { + enabled = true; + sourceUrl = "https://github.com/noctalia-dev/noctalia-plugins"; + }; + activate-linux = { + enabled = true; + sourceUrl = "https://github.com/noctalia-dev/noctalia-plugins"; + }; + }; + version = 1; + }; + pluginSettings = { + tailscale = { + refreshInterval = 5000; + compactMode = true; + showIpAddress = false; + showPeerCount = false; + hideDisconnected = false; + terminalCommand = "foot"; + pingCount = 5; + defaultPeerAction = "copy-ip"; + }; + }; + }; + }; +} diff --git a/modules/features/pipewire.nix b/modules/features/pipewire.nix new file mode 100644 index 0000000..5f0a9f2 --- /dev/null +++ b/modules/features/pipewire.nix @@ -0,0 +1,19 @@ +{ + flake.modules.nixos.pipewire = { + # Enable sound with pipewire. + services.pipewire = { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + # If you want to use JACK applications, uncomment this + # jack.enable = true; + + # use the example session manager (no others are packaged yet so this is enabled by default, + # no need to redefine it in your config for now) + # media-session.enable = true; + }; + + security.rtkit.enable = true; + }; +} diff --git a/modules/features/power-management.nix b/modules/features/power-management.nix new file mode 100644 index 0000000..f3c1abb --- /dev/null +++ b/modules/features/power-management.nix @@ -0,0 +1,34 @@ +{ + flake.modules.nixos.power-management = { + services = { + upower.enable = true; + + system76-scheduler.settings.cfsProfiles.enable = true; + + tlp = { + enable = true; + settings = { + CPU_BOOST_ON_AC = 1; + CPU_BOOST_ON_BAT = 0; + CPU_SCALING_GOVERNOR_ON_AC = "performance"; + CPU_SCALING_GOVERNOR_ON_BAT = "powersave"; + PLATFORM_PROFILE_ON_AC = "performance"; + PLATFORM_PROFILE_ON_BAT = "balanced"; + START_CHARGE_THRESH_BAT1 = 65; # Only STOP_CHARGE_THRESH available on Framework + STOP_CHARGE_THRESH_BAT1 = 80; + # Fixes stuttering Hyprland animations on Intel iGPU (https://wiki.hypr.land/Configuring/Performance/) + INTEL_GPU_MIN_FREQ_ON_AC = 300; + INTEL_GPU_MIN_FREQ_ON_BAT = 300; + }; + }; + + # Disable GNOME's power management (conflicts with TLP) + power-profiles-daemon.enable = false; + }; + + powerManagement = { + enable = true; + powertop.enable = true; + }; + }; +} diff --git a/modules/features/printing.nix b/modules/features/printing.nix new file mode 100644 index 0000000..190884c --- /dev/null +++ b/modules/features/printing.nix @@ -0,0 +1,24 @@ +{ + flake.modules.nixos.printing = + { pkgs, ... }: + { + services = { + # Enable CUPS to print documents. + printing = { + enable = true; + drivers = with pkgs; [ + gutenprint + cnijfilter2 + ]; + }; + + avahi = { + enable = true; + nssmdns4 = true; + openFirewall = true; + }; + }; + + hardware.sane.enable = true; + }; +} diff --git a/modules/features/ssh.nix b/modules/features/ssh.nix new file mode 100644 index 0000000..3423231 --- /dev/null +++ b/modules/features/ssh.nix @@ -0,0 +1,34 @@ +{ + flake.modules.homeManager.ssh = { + programs.ssh = { + enable = true; + enableDefaultConfig = false; + matchBlocks = { + "*" = { + addKeysToAgent = "yes"; + identityFile = [ "~/.ssh/id_ed25519_sk_rk" ]; + }; + "stu" = { + hostname = "stu.cs.jmu.edu"; + user = "tamassno"; + localForwards = [ + { + bind.port = 5432; + host = { + address = "data.cs.jmu.edu"; + port = 5432; + }; + } + ]; + serverAliveCountMax = 5; + serverAliveInterval = 60; + }; + "cluster" = { + hostname = "login02.cluster.cs.jmu.edu"; + user = "tamassno"; + proxyJump = "stu"; + }; + }; + }; + }; +} diff --git a/modules/features/starship.nix b/modules/features/starship.nix new file mode 100644 index 0000000..fc65bad --- /dev/null +++ b/modules/features/starship.nix @@ -0,0 +1,46 @@ +{ + flake.modules.homeManager.starship = + { lib, ... }: + { + programs.starship = { + enable = true; + enableZshIntegration = true; + settings = { + add_newline = true; + format = lib.strings.concatStrings [ + "[ ╭─[\\[](1)$username([@](bold 2)$hostname)[\\]:](1) $directory( $git_branch)](5)" + "$line_break" + "[ ╰─$character](5)" + ]; + username = { + style_root = "white"; + format = "[$user](3)"; + disabled = false; + show_always = true; + }; + hostname = { + format = "[$hostname](bold 4)"; + disabled = false; + ssh_only = false; + }; + character = { + success_symbol = "[❯](bold 5)"; + error_symbol = "[✘](bold 5)"; + vimcmd_symbol = "[❮](bold 5)"; + }; + directory = { + read_only = ""; + format = "[ $path](5)"; + read_only_style = "bold white"; + truncation_length = 5; + }; + git_branch = { + symbol = ""; + style = "bright-black"; + format = "[$symbol $branch]($style)"; + }; + scan_timeout = 100; + }; + }; + }; +} diff --git a/modules/features/stylix.nix b/modules/features/stylix.nix new file mode 100644 index 0000000..8776945 --- /dev/null +++ b/modules/features/stylix.nix @@ -0,0 +1,105 @@ +{ + inputs, + ... +}: +{ + flake.modules.homeManager.stylix = + { + config, + pkgs, + ... + }: + { + imports = [ + inputs.stylix.homeModules.stylix + ]; + + # Not really using stylix as it was intended because IMO it sets too many defaults for some + # programs and not enought for others, meaning I wind up setting a lot myself anyway. That + # being said it provides a nice structure for setting fonts, cursors, icons, etc. + stylix = { + enable = true; + autoEnable = false; + polarity = "dark"; + base16Scheme = "${pkgs.base16-schemes}/share/themes/catppuccin-mocha.yaml"; + cursor = { + name = "catppuccin-mocha-dark-cursors"; + package = pkgs.catppuccin-cursors.mochaDark; + size = 16; + }; + # For some reason setting the fonts' package option doesn't work. + # Just use home.packages instead + fonts = { + monospace.name = "JetBrainsMono Nerd Font"; + sansSerif.name = "Noto Sans"; + emoji.name = "Noto Color Emoji"; + sizes = { + applications = 12; + terminal = 12; + }; + }; + icons = { + enable = true; + package = pkgs.morewaita-icon-theme; + light = "MoreWaita"; + dark = "MoreWaita"; + }; + }; + + # Fonts + home.packages = with pkgs; [ + nerd-fonts.jetbrains-mono + noto-fonts + noto-fonts-cjk-sans + noto-fonts-color-emoji + ]; + + fonts.fontconfig = { + enable = true; + defaultFonts = { + sansSerif = [ "Noto Sans" ]; + monospace = [ "JetBrainsMono Nerd Font" ]; + emoji = [ "Noto Color Emoji" ]; + }; + }; + + gtk = { + enable = true; + colorScheme = config.stylix.polarity; + # iconTheme is set by default by stylix.icons.enable + theme = { + name = "adw-gtk3-${config.stylix.polarity}"; + package = pkgs.adw-gtk3; + }; + gtk4.theme = config.gtk.theme; + }; + + qt = + let + qt_settings = ver: { + Appearance = { + color_scheme_path = "${config.xdg.configHome}/${ver}/colors/noctalia.conf"; + custom_palette = true; + icon_theme = config.stylix.icons.${config.stylix.polarity}; + standard_dialogs = "xdgdesktopportal"; + style = "Breeze"; + }; + Fonts = { + fixed = "\"${config.stylix.fonts.monospace.name},${toString config.stylix.fonts.sizes.applications}\""; + general = "\"${config.stylix.fonts.sansSerif.name},${toString config.stylix.fonts.sizes.applications}\""; + }; + }; + in + { + enable = true; + platformTheme.name = "qtct"; + style.name = "breeze"; + qt5ctSettings = qt_settings "qt5ct"; + qt6ctSettings = qt_settings "qt6ct"; + }; + + home.sessionVariables = { + QS_ICON_THEME = config.stylix.icons.${config.stylix.polarity}; + }; + }; +} diff --git a/modules/features/swappy.nix b/modules/features/swappy.nix new file mode 100644 index 0000000..b7f0dea --- /dev/null +++ b/modules/features/swappy.nix @@ -0,0 +1,22 @@ +{ + flake.modules.homeManager.swappy = + { + config, + ... + }: + { + programs.swappy = { + enable = true; + # Configuration options: https://github.com/jtheoof/swappy?tab=readme-ov-file#config + settings = { + Default = { + save_dir = config.xdg.userDirs.extraConfig.SCREENSHOTS; + save_filename_format = "%Y%m%d-%H%M%S.png"; + show_panel = false; + auto_save = false; + early_exit = true; + }; + }; + }; + }; +} diff --git a/modules/features/tailscale.nix b/modules/features/tailscale.nix new file mode 100644 index 0000000..0037c02 --- /dev/null +++ b/modules/features/tailscale.nix @@ -0,0 +1,36 @@ +{ + inputs, + ... +}: +{ + flake.modules.nixos.tailscale = + { config, lib, ... }: + { + services.tailscale = { + enable = true; + useRoutingFeatures = "client"; + authKeyFile = config.age.secrets.tailscale-auth.path; + + # * Only applied if `authKeyFile` is specified + extraUpFlags = [ + "--ssh" + "--accept-routes=true" + ]; + extraSetFlags = [ + "--operator=eclypse" + ]; + }; + + age.secrets.tailscale-auth.rekeyFile = "${inputs.secrets}/tailscale-auth.age"; + + # Taildrop + systemd.user.services.taildrop = { + description = "Taildrop File Receiver Service"; + wantedBy = [ "default.target" ]; + serviceConfig = { + Type = "simple"; + ExecStart = "${lib.getExe config.services.tailscale.package} file get --verbose --loop %h/Downloads/"; + }; + }; + }; +} diff --git a/modules/features/vesktop.nix b/modules/features/vesktop.nix new file mode 100644 index 0000000..d17fc34 --- /dev/null +++ b/modules/features/vesktop.nix @@ -0,0 +1,17 @@ +{ + flake.modules.homeManager.vesktop = { + programs.vesktop = { + enable = true; + vencord = { + settings = { + oUpdate = false; + autoUpdateNotification = false; + notifyAboutUpdates = false; + useQuickCss = true; + disableMinSize = true; + enabledThemes = [ "noctalia.theme.css" ]; + }; + }; + }; + }; +} diff --git a/modules/features/vicinae.nix b/modules/features/vicinae.nix new file mode 100644 index 0000000..db6d5b2 --- /dev/null +++ b/modules/features/vicinae.nix @@ -0,0 +1,43 @@ +{ + flake.modules.homeManager.vicinae = + { + config, + ... + }: + { + # Not using Vicinae's flake because the server fucking seg faults immediately + programs.vicinae = { + enable = true; + systemd = { + enable = true; + autoStart = true; + }; + # For configuration option documentation, see: https://github.com/vicinaehq/vicinae/blob/f6222f1e82fe2077ad42f10a6d6837dc61c67fd0/vicinae/assets/config.jsonc + settings = { + escape_key_behavior = "close_window"; + close_on_focus_loss = true; + pop_to_root_on_close = true; + favicon_service = "twenty"; + telemetry = { + system_info = false; + }; + font = { + normal = { + size = config.stylix.fonts.sizes.applications; + family = "${config.stylix.fonts.monospace.name}"; + }; + }; + theme = { + light = { + name = "noctalia"; + icon_theme = "${config.stylix.icons.light}"; + }; + dark = { + name = "noctalia"; + icon_theme = "${config.stylix.icons.dark}"; + }; + }; + }; + }; + }; +} diff --git a/modules/features/virtualization.nix b/modules/features/virtualization.nix new file mode 100644 index 0000000..acafa21 --- /dev/null +++ b/modules/features/virtualization.nix @@ -0,0 +1,20 @@ +{ + flake.modules.nixos.virtualization = + { config, pkgs, ... }: + { + boot = { + extraModulePackages = with config.boot.kernelPackages; [ virtualbox ]; + kernelParams = [ + "kvm.enable_virt_at_load=0" # Fixes some virtuallization issues + ]; + }; + + virtualisation = { + podman.enable = true; + }; + + environment.systemPackages = [ pkgs.distrobox ]; + + users.extraGroups.vboxusers.members = [ "eclypse" ]; + }; +} diff --git a/modules/features/wayland.nix b/modules/features/wayland.nix new file mode 100644 index 0000000..a2f6c13 --- /dev/null +++ b/modules/features/wayland.nix @@ -0,0 +1,8 @@ +{ + flake.modules.nixos.wayland = { + programs = { + uwsm.enable = true; + xwayland.enable = true; + }; + }; +} diff --git a/modules/features/x11.nix b/modules/features/x11.nix new file mode 100644 index 0000000..842e746 --- /dev/null +++ b/modules/features/x11.nix @@ -0,0 +1,15 @@ +{ + flake.modules.nixos.x11 = { + services.xserver = { + # Enable the X11 windowing system. + # You can disable this if you're only using the Wayland session. + enable = true; + + # Configure keymap in X11 + xkb = { + layout = "us"; + variant = ""; + }; + }; + }; +} diff --git a/modules/features/xdg.nix b/modules/features/xdg.nix new file mode 100644 index 0000000..b809c3a --- /dev/null +++ b/modules/features/xdg.nix @@ -0,0 +1,38 @@ +{ + flake.modules.homeManager.xdg = + { + config, + pkgs, + ... + }: + { + xdg = { + enable = true; + portal = { + enable = true; + configPackages = [ pkgs.gnome-session ]; + extraPortals = with pkgs; [ + xdg-desktop-portal-gnome + xdg-desktop-portal-gtk + ]; + }; + userDirs = { + enable = true; + setSessionVariables = true; + createDirectories = true; + extraConfig = { + DEV = "${config.home.homeDirectory}/Dev"; + WALLPAPERS = "${config.xdg.userDirs.pictures}/Wallpapers"; + SCREENSHOTS = "${config.xdg.userDirs.pictures}/Screenshots"; + }; + }; + }; + + home.file.".face".source = ../../assets/profile-picture.jpg; + + home.file."${config.xdg.userDirs.extraConfig.WALLPAPERS}" = { + source = ../../assets/wallpapers; + recursive = true; + }; + }; +} diff --git a/modules/features/yazi.nix b/modules/features/yazi.nix new file mode 100644 index 0000000..a51f7f1 --- /dev/null +++ b/modules/features/yazi.nix @@ -0,0 +1,66 @@ +{ + flake.modules.homeManager.yazi = + { + pkgs, + ... + }: + { + home.packages = with pkgs; [ + dragon-drop + ]; + + programs.yazi = { + enable = true; + enableZshIntegration = true; + shellWrapperName = "y"; + plugins = with pkgs.yaziPlugins; { + inherit git full-border chmod; + }; + initLua = '' + require("git"):setup { + -- Order of status signs showing in the linemode + order = 1500, + } + require("full-border"):setup() + ''; + keymap = { + mgr.prepend_keymap = [ + { + on = ""; + run = "shell -- dragon-drop -x -i -T %s1"; + desc = "Open a prompt to drag and drop a file"; + } + { + on = [ + "c" + "m" + ]; + run = "plugin chmod"; + desc = "Chmod on selected files"; + } + ]; + }; + settings = { + plugin = { + # Disable all preset previewers, preloaders + # This is recommended by yazi when working with network shares + preloaders = [ ]; + previewers = [ ]; + + prepend_fetchers = [ + { + id = "git"; + url = "*"; + run = "git"; + } + { + id = "git"; + url = "*/"; + run = "git"; + } + ]; + }; + }; + }; + }; +} diff --git a/modules/features/yubikey.nix b/modules/features/yubikey.nix new file mode 100644 index 0000000..bb095cb --- /dev/null +++ b/modules/features/yubikey.nix @@ -0,0 +1,16 @@ +{ + flake.modules.nixos.yubikey = + { pkgs, ... }: + { + programs = { + yubikey-manager.enable = true; + yubikey-touch-detector.enable = true; + }; + + environment.systemPackages = [ + pkgs.age-plugin-yubikey + ]; + + services.yubikey-agent.enable = true; + }; +} diff --git a/modules/features/zed.nix b/modules/features/zed.nix new file mode 100644 index 0000000..9fada1e --- /dev/null +++ b/modules/features/zed.nix @@ -0,0 +1,22 @@ +{ + flake.modules.homeManager.zed = + { + pkgs, + ... + }: + { + programs.zed-editor = { + enable = true; + extensions = [ + "nix" + ]; + extraPackages = [ pkgs.nixd ]; + + userSettings = { + features = { + edit_prediction_provider = "copilot"; + }; + }; + }; + }; +} diff --git a/modules/features/zellij.nix b/modules/features/zellij.nix new file mode 100644 index 0000000..297b9b0 --- /dev/null +++ b/modules/features/zellij.nix @@ -0,0 +1,458 @@ +{ + flake.modules.homeManager.zellij = { + programs.zellij = + let + mod = "Alt"; # Can be one of "Ctrl", "Alt", "Shift", "Super" + in + { + enable = true; + enableZshIntegration = true; + settings = { + theme = "catppuccin-mocha"; + show_startup_tips = false; + keybinds = { + _props = { + clear-defaults = true; + }; + + _children = [ + { + locked._children = [ + { + bind = { + _args = [ "${mod} g" ]; + _children = [ { SwitchToMode._args = [ "Normal" ]; } ]; + }; + } + ]; + } + { + resize._children = [ + { + bind = { + _args = [ "${mod} r" ]; + _children = [ { SwitchToMode._args = [ "Normal" ]; } ]; + }; + } + { + bind = { + _args = [ "h" ]; + _children = [ { Resize._args = [ "Increase Left" ]; } ]; + }; + } + { + bind = { + _args = [ "j" ]; + _children = [ { Resize._args = [ "Increase Down" ]; } ]; + }; + } + { + bind = { + _args = [ "k" ]; + _children = [ { Resize._args = [ "Increase Up" ]; } ]; + }; + } + { + bind = { + _args = [ "l" ]; + _children = [ { Resize._args = [ "Increase Right" ]; } ]; + }; + } + ]; + } + + { + pane._children = [ + { + bind = { + _args = [ "${mod} p" ]; + _children = [ { SwitchToMode._args = [ "Normal" ]; } ]; + }; + } + { + bind = { + _args = [ "c" ]; + _children = [ { Clear = { }; } ]; + }; + } + { + bind = { + _args = [ "e" ]; + _children = [ + { TogglePaneEmbedOrFloating = { }; } + { SwitchToMode._args = [ "Normal" ]; } + ]; + }; + } + { + bind = { + _args = [ "f" ]; + _children = [ + { ToggleFocusFullscreen = { }; } + { SwitchToMode._args = [ "Normal" ]; } + ]; + }; + } + { + bind = { + _args = [ "s" ]; + _children = [ + { NewPane._args = [ "stacked" ]; } + { SwitchToMode._args = [ "Normal" ]; } + ]; + }; + } + { + bind = { + _args = [ "j" ]; + _children = [ + { NewPane._args = [ "Down" ]; } + { SwitchToMode._args = [ "Normal" ]; } + ]; + }; + } + { + bind = { + _args = [ "l" ]; + _children = [ + { NewPane._args = [ "Right" ]; } + { SwitchToMode._args = [ "Normal" ]; } + ]; + }; + } + { + bind = { + _args = [ "n" ]; + _children = [ + { NewPane = { }; } + { SwitchToMode._args = [ "Normal" ]; } + ]; + }; + } + { + bind = { + _args = [ "p" ]; + _children = [ + { SwitchFocus = { }; } + { SwitchToMode._args = [ "Normal" ]; } + ]; + }; + } + { + bind = { + _args = [ "r" ]; + _children = [ + { SwitchToMode._args = [ "RenamePane" ]; } + { PaneNameInput._args = [ 0 ]; } + ]; + }; + } + { + bind = { + _args = [ "w" ]; + _children = [ + { ToggleFloatingPanes = { }; } + { SwitchToMode._args = [ "Normal" ]; } + ]; + }; + } + { + bind = { + _args = [ "x" ]; + _children = [ + { CloseFocus = { }; } + { SwitchToMode._args = [ "Normal" ]; } + ]; + }; + } + { + bind = { + _args = [ "z" ]; + _children = [ + { TogglePaneFrames = { }; } + { SwitchToMode._args = [ "Normal" ]; } + ]; + }; + } + ]; + } + { + move._children = [ + { + bind = { + _args = [ "${mod} m" ]; + _children = [ { SwitchToMode._args = [ "Normal" ]; } ]; + }; + } + { + bind = { + _args = [ "h" ]; + _children = [ { MovePane._args = [ "Left" ]; } ]; + }; + } + { + bind = { + _args = [ "j" ]; + _children = [ { MovePane._args = [ "Down" ]; } ]; + }; + } + { + bind = { + _args = [ "k" ]; + _children = [ { MovePane._args = [ "Up" ]; } ]; + }; + } + { + bind = { + _args = [ "l" ]; + _children = [ { MovePane._args = [ "Right" ]; } ]; + }; + } + ]; + } + { + tab._children = [ + { + bind = { + _args = [ "${mod} t" ]; + _children = [ { SwitchToMode._args = [ "Normal" ]; } ]; + }; + } + { + bind = { + _args = [ "b" ]; + _children = [ + { BreakPane = { }; } + { SwitchToMode._args = [ "Normal" ]; } + ]; + }; + } + { + bind = { + _args = [ "h" ]; + _children = [ { MoveTab._args = [ "Left" ]; } ]; + }; + } + { + bind = { + _args = [ "l" ]; + _children = [ { MoveTab._args = [ "Right" ]; } ]; + }; + } + { + bind = { + _args = [ "n" ]; + _children = [ + { NewTab = { }; } + { SwitchToMode._args = [ "Normal" ]; } + ]; + }; + } + { + bind = { + _args = [ "r" ]; + _children = [ + { SwitchToMode._args = [ "RenameTab" ]; } + { TabNameInput._args = [ 0 ]; } + ]; + }; + } + { + bind = { + _args = [ "x" ]; + _children = [ + { CloseTab = { }; } + { SwitchToMode._args = [ "Normal" ]; } + ]; + }; + } + ]; + } + { + renametab._children = [ + { + bind = { + _args = [ "${mod} c" ]; + _children = [ { SwitchToMode._args = [ "Normal" ]; } ]; + }; + } + { + bind = { + _args = [ "Esc" ]; + _children = [ + { UndoRenameTab = { }; } + { SwitchToMode._args = [ "Normal" ]; } + ]; + }; + } + ]; + } + { + renamepane._children = [ + { + bind = { + _args = [ "${mod} c" ]; + _children = [ { SwitchToMode._args = [ "Normal" ]; } ]; + }; + } + { + bind = { + _args = [ "Esc" ]; + _children = [ + { UndoRenamePane = { }; } + { SwitchToMode._args = [ "Normal" ]; } + ]; + }; + } + ]; + } + { + shared_except = { + _args = [ "locked" ]; + _children = [ + { + bind = { + _args = [ "${mod} g" ]; + _children = [ { SwitchToMode._args = [ "Locked" ]; } ]; + }; + } + { + bind = { + _args = [ "${mod} h" ]; + _children = [ { MoveFocusOrTab._args = [ "Left" ]; } ]; + }; + } + { + bind = { + _args = [ "${mod} l" ]; + _children = [ { MoveFocusOrTab._args = [ "Right" ]; } ]; + }; + } + { + bind = { + _args = [ "${mod} j" ]; + _children = [ { MoveFocus._args = [ "Down" ]; } ]; + }; + } + { + bind = { + _args = [ "${mod} k" ]; + _children = [ { MoveFocus._args = [ "Up" ]; } ]; + }; + } + { + bind = { + _args = [ "${mod} [" ]; + _children = [ { PreviousSwapLayout = { }; } ]; + }; + } + { + bind = { + _args = [ "${mod} ]" ]; + _children = [ { NextSwapLayout = { }; } ]; + }; + } + ]; + }; + } + { + shared_except = { + _args = [ + "normal" + "locked" + ]; + _children = [ + { + bind = { + _args = [ + "Enter" + "Esc" + ]; + _children = [ { SwitchToMode = [ "Normal" ]; } ]; + }; + } + ]; + }; + } + { + shared_except = { + _args = [ + "pane" + "locked" + ]; + _children = [ + { + bind = { + _args = [ "${mod} p" ]; + _children = [ { SwitchToMode = [ "Pane" ]; } ]; + }; + } + ]; + }; + } + { + shared_except = { + _args = [ + "resize" + "locked" + ]; + _children = [ + { + bind = { + _args = [ "${mod} r" ]; + _children = [ { SwitchToMode = [ "Resize" ]; } ]; + }; + } + ]; + }; + } + { + shared_except = { + _args = [ + "tab" + "locked" + ]; + _children = [ + { + bind = { + _args = [ "${mod} t" ]; + _children = [ { SwitchToMode = [ "Tab" ]; } ]; + }; + } + ]; + }; + } + { + shared_except = { + _args = [ + "move" + "locked" + ]; + _children = [ + { + bind = { + _args = [ "${mod} m" ]; + _children = [ { SwitchToMode = [ "Move" ]; } ]; + }; + } + ]; + }; + } + ]; + }; + + plugins = { + compact-bar = { + _props = { + location = "zellij:compact-bar"; + }; + }; + }; + + simplified_ui = true; + pane_frames = false; + copy_on_select = true; + }; + }; + }; +} diff --git a/modules/features/zoxide.nix b/modules/features/zoxide.nix new file mode 100644 index 0000000..4fcf2c7 --- /dev/null +++ b/modules/features/zoxide.nix @@ -0,0 +1,8 @@ +{ + flake.modules.homeManager.zoxide = { + programs.zoxide = { + enable = true; + enableZshIntegration = true; + }; + }; +} diff --git a/modules/features/zsh.nix b/modules/features/zsh.nix new file mode 100644 index 0000000..f1c31fa --- /dev/null +++ b/modules/features/zsh.nix @@ -0,0 +1,56 @@ +{ + flake.modules.nixos.zsh = { + programs.zsh.enable = true; + + environment.pathsToLink = [ "/share/zsh" ]; + }; + + flake.modules.homeManager.zsh = + { config, ... }: + { + programs.zsh = { + enable = true; + enableCompletion = false; + antidote = { + enable = true; + plugins = [ + "Aloxaf/fzf-tab" + ]; + }; + autosuggestion.enable = true; + dotDir = "${config.xdg.configHome}/zsh"; + history = { + append = true; + findNoDups = true; + ignoreSpace = true; + ignoreDups = true; + saveNoDups = true; + share = true; + }; + historySubstringSearch = { + enable = true; + searchDownKey = "^p"; + searchUpKey = "^n"; + }; + initContent = '' + # disable sort when completing `git checkout` + zstyle ':completion:*:git-checkout:*' sort false + # set descriptions format to enable group support + # NOTE: don't use escape sequences (like '%F{red}%d%f') here, fzf-tab will ignore them + zstyle ':completion:*:descriptions' format '[%d]' + # preview directory's content when completing cd or zoxide + zstyle ':fzf-tab:complete:cd:*' fzf-preview 'ls --color $realpath' + zstyle ':fzf-tab:complete:__zoxide_z:*' fzf-preview 'ls --color $realpath' + # custom fzf flags + # NOTE: fzf-tab does not follow FZF_DEFAULT_OPTS by default + zstyle ':fzf-tab:*' fzf-flags --color=fg:1,fg+:2 --bind=tab:accept + # switch group using `<` and `>` + zstyle ':fzf-tab:*' switch-group '<' '>' + ''; + syntaxHighlighting.enable = true; + shellAliases = { + ff = "fastfetch"; + }; + }; + }; +} diff --git a/modules/fileSystems/eclypsecloud-shares.nix b/modules/fileSystems/eclypsecloud-shares.nix new file mode 100644 index 0000000..9fb1af7 --- /dev/null +++ b/modules/fileSystems/eclypsecloud-shares.nix @@ -0,0 +1,37 @@ +{ + inputs, + self, + ... +}: +{ + flake.modules.nixos.eclypsecloud-shares = + { + pkgs, + config, + ... + }: + { + imports = with self.factory.nixos; [ + (cifs { + destination = "/mnt/EclypseCloud"; + host = "100.78.212.35"; + resource = "EclypseCloud"; + credentialsPath = config.age.secrets.eclypsecloud-eclypse.path; + uid = config.users.users.eclypse.uid; + }) + (cifs { + destination = "/mnt/Music"; + host = "100.78.212.35"; + resource = "music"; + credentialsPath = config.age.secrets.eclypsecloud-eclypse.path; + uid = config.users.users.eclypse.uid; + }) + ]; + + age.secrets.eclypsecloud-eclypse.rekeyFile = "${inputs.secrets}/eclypsecloud-eclypse.age"; + + environment.systemPackages = with pkgs; [ + cifs-utils + ]; + }; +} diff --git a/modules/fileSystems/factory.nix b/modules/fileSystems/factory.nix new file mode 100644 index 0000000..601e736 --- /dev/null +++ b/modules/fileSystems/factory.nix @@ -0,0 +1,40 @@ +{ + flake.factory.nixos.cifs = + { + destination, + host, + resource, + credentialsPath, + uid, + gid ? null, + }: + { + lib, + ... + }: + { + fileSystems."${destination}" = { + device = "//${host}/${resource}"; + fsType = "cifs"; + options = + let + automount-opts = [ + "x-systemd.automount" + "x-systemd.idle-timeout=60" + "x-systemd.device-timeout=5s" + "x-systemd.mount-timeout=5s" + "noauto" + "nofail" + "soft" + ]; + mount-opts = [ + "rw" + "iocharset=utf8" + ]; + user = [ "uid=${toString uid}" ] ++ (lib.optionals (gid != null) [ "gid=${toString gid}" ]); + credentials = [ "credentials=${credentialsPath}" ]; + in + automount-opts ++ mount-opts ++ user ++ credentials; + }; + }; +} diff --git a/modules/home/default.nix b/modules/home/default.nix deleted file mode 100644 index 7010a48..0000000 --- a/modules/home/default.nix +++ /dev/null @@ -1,23 +0,0 @@ -{ - imports = [ - ./firefox.nix - ./git.nix - ./helix.nix - ./kanshi.nix - ./niri.nix - ./noctalia.nix - ./nvf.nix - ./packages.nix - ./screenshot.nix - ./ssh.nix - ./stylix.nix - ./terminal.nix - ./vesktop.nix - ./vicinae.nix - ./xdg.nix - ./yazi.nix - ./zed.nix - ./zellij.nix - # ./zen-browser.nix - ]; -} diff --git a/modules/home/firefox.nix b/modules/home/firefox.nix deleted file mode 100644 index 3c9b053..0000000 --- a/modules/home/firefox.nix +++ /dev/null @@ -1,156 +0,0 @@ -{ - config, - pkgs, - ... -}: -{ - # This gets around having to run `pywalfox install` manually, which just creates this manifest - home.file.".mozilla/native-messaging-hosts/pywalfox.json".text = builtins.toJSON { - name = "pywalfox"; - description = "Automatically theme your browser using the colors generated by Pywal"; - path = "${pkgs.pywalfox-native}/bin/pywalfox"; - type = "stdio"; - allowed_extensions = [ "pywalfox@frewacom.org" ]; - }; - - programs.firefox = { - enable = true; - languagePacks = [ "en-US" ]; - nativeMessagingHosts = with pkgs; [ - pywalfox-native - ]; - policies = { - DefaultDownloadDirectory = config.xdg.userDirs.download; - DisableFirefoxAccounts = true; - DisableFirefoxStudies = true; - DisablePocket = true; - DisableProfileImport = true; - DisableProfileRefresh = true; - DisableTelemetry = true; - DisplayBookmarksToolbar = "never"; - DontCheckDefaultBrowser = true; - EnableTrackingProtection = { - Value = true; # Tracking protection is enabled by default in both the regular browser and private browsing - Locked = true; # Whether or not a user can change tracking protection - Cryptomining = true; # Block cryptomining scripts - Fingerprinting = true; # Block fingerprinting scripts - EmailTracking = true; # Block email tracking pixels and scripts - }; - FirefoxHome = { - Search = true; - TopSites = true; - SponsoredTopSites = false; - Highlights = false; - Pocket = false; - Stories = false; - SponsoredPocket = false; - SponsoredStories = false; - Snippets = true; - Locked = true; - }; - FirefoxSuggest = { - WebSuggestions = true; - SponsoredSuggestions = false; - ImproveSuggest = false; - Locked = true; - }; - Homepage = { - URL = "http://100.78.212.35:30054"; - Locked = true; - StartPage = "homepage"; - }; - OfferToSaveLogins = false; - OverrideFirstRunPage = ""; - PasswordManagerEnabled = false; - PopupBlocking = { - Default = false; - Locked = true; - }; - PrimaryPassword = false; - SearchBar = "unified"; - ShowHomeButton = true; - SkipTermsOfUse = true; - }; - profiles.eclypse = { - name = "Eclypse"; - isDefault = true; - extensions = { - force = true; - # For a list of available packaged extensions, see: - # https://github.com/nix-community/nur-combined/blob/main/repos/rycee/pkgs/firefox-addons/addons.json - packages = with pkgs.nur.repos.rycee.firefox-addons; [ - ublock-origin - bitwarden - pywalfox - ]; - settings = { - "uBlock0@raymondhill.net".settings = { - selectedFilterLists = [ - "ublock-filters" - "ublock-badware" - "ublock-privacy" - "ublock-unbreak" - "ublock-quick-fixes" - ]; - }; - }; - }; - search = { - default = "google"; - force = true; - engines = { - nix-packages = { - name = "Nix Packages"; - urls = [ - { - template = "https://search.nixos.org/packages"; - params = [ - { - name = "channel"; - value = "unstable"; - } - { - name = "query"; - value = "{searchTerms}"; - } - ]; - } - ]; - icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; - definedAliases = [ "@np" ]; - }; - home-manager = { - name = "Home Manager"; - urls = [ - { - template = "https://home-manager-options.extranix.com"; - params = [ - { - name = "query"; - value = "{searchTerms}"; - } - ]; - } - ]; - icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; - definedAliases = [ "@hm" ]; - }; - surugaya = { - name = "Surugaya"; - urls = [ - { - template = "https://www.suruga-ya.jp/search?search_word={searchTerms}"; - } - ]; - iconMapObj."16" = "https://www.suruga-ya.jp/drupal/themes/surugaya/favicon.ico"; - definedAliases = [ "@suru" ]; - }; - }; - }; - settings = { - # Auto-enable extensions - "extensions.autoDisableScopes" = 0; - }; - }; - }; -} diff --git a/modules/home/git.nix b/modules/home/git.nix deleted file mode 100644 index c5cec13..0000000 --- a/modules/home/git.nix +++ /dev/null @@ -1,40 +0,0 @@ -{ - pkgs, - config, - ... -}: -let - name = "Eclypsed"; - email = "Ec1ypsed@proton.me"; - signingKey = "sk-ssh-ed25519@openssh.com AAAAGnNrLXNzaC1lZDI1NTE5QG9wZW5zc2guY29tAAAAIB2h6y1Al2OVotYIpwPZMjiBLAncAI2pAPgES2+gVbJqAAAABHNzaDo= ssh:"; -in -{ - home.packages = with pkgs; [ git-ignore ]; - - xdg.configFile."git/allowed_signers".text = '' - ${email} namespaces="git" ${signingKey} - ''; - - programs = { - git = { - enable = true; - settings = { - user = { inherit name email; }; - init = { - defaultBranch = "main"; - }; - gpg.ssh.allowedSignersFile = "${config.xdg.configHome}/git/allowed_signers"; - }; - signing = { - format = "ssh"; - key = "${config.home.homeDirectory}/.ssh/id_ed25519_sk_rk.pub"; - signByDefault = true; - }; - }; - lazygit = { - enable = true; - enableZshIntegration = true; - shellWrapperName = "lg"; - }; - }; -} diff --git a/modules/home/helix.nix b/modules/home/helix.nix deleted file mode 100644 index fd6a52c..0000000 --- a/modules/home/helix.nix +++ /dev/null @@ -1,359 +0,0 @@ -{ - pkgs, - ... -}: -let - yazi-picker = pkgs.writeShellApplication { - name = "yazi-picker"; - text = '' - paths=$(yazi --chooser-file=/dev/stdout) - - if [[ -n "$paths" ]]; then - zellij action toggle-floating-panes - zellij action write 27 # send key - zellij action write-chars ":$1 $paths" - zellij action write 13 # send key - else - zellij action toggle-floating-panes - fi - ''; - }; -in -{ - home.packages = [ yazi-picker ]; - - programs.helix = { - enable = true; - defaultEditor = true; - extraPackages = with pkgs; [ - basedpyright # Python static type checker - ruff # Pyhton linter and formatter - nixd # Nix language server - nixfmt # Nix formatter - rust-analyzer # Rust language server - rustfmt # Rust formmater - clippy # Rust linter - lldb # Debugger for llvm languages - marksman # Markdown language server - markdown-oxide # Markdown PKM language server - rumdl # Markdown linter and formatter - libclang # C language family frontend for LLVM - typescript-language-server # Typescript language server - vscode-langservers-extracted # HTML/CSS/JSON/ESLint language servers extracted from vscode - emmet-language-server # Emmet support based on LSP - prettier # Formatter for HTML/CSS/JSON/ESLint languages - superhtml # HTML Language server and Templating Language Library - ruby-lsp # Ruby language server - solargraph # Alternative ruby language server - rubocop # Ruby linter and formatter - jdt-language-server # Java language server - ]; - settings = { - editor = { - line-number = "relative"; - cursorline = true; - auto-format = true; - completion-timeout = 5; - completion-trigger-len = 1; - bufferline = "always"; - color-modes = true; - end-of-line-diagnostics = "hint"; - lsp = { - display-inlay-hints = true; - }; - cursor-shape = { - insert = "bar"; - normal = "block"; - select = "underline"; - }; - indent-guides = { - render = true; - skip-levels = 1; - }; - soft-wrap = { - enable = true; - max-indent-retain = 80; - }; - inline-diagnostics = { - cursor-line = "warning"; - }; - }; - keys = - let - arrow_keys = { - "up" = "jump_view_up"; - "down" = "jump_view_down"; - "left" = "jump_view_left"; - "right" = "jump_view_right"; - }; - in - { - normal = { - "C-y" = - ":sh zellij run -n Yazi -c -f -x 10%% -y 10%% --width 80%% --height 80%% -- yazi-picker open %{buffer_name}"; - } - // arrow_keys; - insert = { - "C-k" = "move_visual_line_up"; - "C-j" = "move_visual_line_down"; - "C-h" = "move_char_left"; - "C-l" = "move_char_right"; - } - // arrow_keys; - select = { } // arrow_keys; - }; - theme = "catppuccin_mocha"; - }; - # Check https://github.com/helix-editor/helix/blob/master/languages.toml for default language configuration - # Only explictly set options you want to override / make explicit - languages = { - language = [ - { - name = "python"; - language-servers = [ - "basedpyright" - "ruff" - ]; - auto-format = true; - formatter = { - command = "ruff"; - args = [ - "format" - "-" - ]; - }; - } - { - name = "nix"; - language-servers = [ "nixd" ]; - auto-format = true; - formatter = { - command = "nixfmt"; - }; - } - { - name = "rust"; - auto-format = true; - formatter = { - command = "rustfmt"; - }; - } - { - name = "markdown"; - auto-format = true; - formatter = { - command = "rumdl"; - args = [ - "fmt" - "-" - ]; - }; - } - { - name = "c"; - file-types = [ - "c" - "h" - ]; # "h" is currently missing from the default config - auto-format = true; - formatter = { - command = "clang-format"; - args = [ - "--style=WebKit" - ]; - }; - } - { - name = "typescript"; - language-servers = [ - "typescript-language-server" - "vscode-eslint-language-server" - "emmet-language-server" - ]; - auto-format = true; - formatter = { - command = "prettier"; - args = [ - "--parser" - "typescript" - ]; - }; - } - { - name = "tsx"; - language-servers = [ - "typescript-language-server" - "vscode-eslint-language-server" - "emmet-language-server" - ]; - auto-format = true; - formatter = { - command = "prettier"; - args = [ - "--parser" - "typescript" - ]; - }; - } - { - name = "javascript"; - language-servers = [ - "typescript-language-server" - "vscode-eslint-language-server" - "emmet-language-server" - ]; - auto-format = true; - formatter = { - command = "prettier"; - args = [ - "--parser" - "typescript" - ]; - }; - } - { - name = "jsx"; - language-servers = [ - "typescript-language-server" - "vscode-eslint-language-server" - "emmet-language-server" - ]; - auto-format = true; - formatter = { - command = "prettier"; - args = [ - "--parser" - "typescript" - ]; - }; - } - { - name = "json"; - auto-format = true; - formatter = { - command = "prettier"; - args = [ - "--parser" - "json" - ]; - }; - } - { - name = "jsonc"; - auto-format = true; - formatter = { - command = "prettier"; - args = [ - "--parser" - "jsonc" - ]; - }; - } - { - name = "html"; - language-servers = [ - "vscode-html-language-server" - { - name = "superhtml"; - except-features = [ "format" ]; - } - "emmet-language-server" - ]; - auto-format = true; - formatter = { - command = "prettier"; - args = [ - "--parser" - "html" - ]; - }; - } - { - name = "css"; - language-servers = [ - "vscode-css-language-server" - "emmet-language-server" - ]; - auto-format = true; - formatter = { - command = "prettier"; - args = [ - "--parser" - "css" - ]; - }; - } - { - name = "scss"; - language-servers = [ - "vscode-css-language-server" - "emmet-language-server" - ]; - auto-format = true; - formatter = { - command = "prettier"; - args = [ - "--parser" - "scss" - ]; - }; - } - { - name = "ruby"; - language-servers = [ - "ruby-lsp" - "solargraph" - ]; - auto-format = true; - formatter = { - command = "rubocop"; - args = [ - "--stdin" - "placeholder.rb" - "-a" - "--stderr" - "--fail-level" - "fatal" - ]; - }; - } - ]; - language-server = { - basedpyright.config.python.analysis.typeCheckingMode = "strict"; - rust-analyzer.config.check.command = "clippy"; - emmet-language-server = { - command = "emmet-language-server"; - args = [ "--stdio" ]; - }; - vscode-eslint-language-server = { - config = { - # Automatically fix ESLint errors - codeActionsOnSave = { - mode = "all"; - "source.fixAll.eslint" = true; - }; - quiet = false; - experimental = { - # Support for the modern ESLint configuration format - useFlatConfig = true; - }; - }; - }; - ruby-lsp = { - command = "ruby-lsp"; - config = { - diagnostics = true; - formatting = true; - }; - }; - solargraph = { - command = "solargraph"; - config = { - diagnostics = true; - formatting = false; - }; - }; - }; - }; - }; -} diff --git a/modules/home/kanshi.nix b/modules/home/kanshi.nix deleted file mode 100644 index d482a94..0000000 --- a/modules/home/kanshi.nix +++ /dev/null @@ -1,36 +0,0 @@ -{ - services.kanshi = { - enable = true; - settings = [ - { - profile = { - name = "laptop"; - outputs = [ - { - criteria = "eDP-1"; - status = "enable"; - scale = 1.0; - } - ]; - }; - } - { - profile = { - name = "docked"; - outputs = [ - { - criteria = "eDP-1"; - status = "disable"; - } - { - criteria = "LG Electronics LG TV SSCR2 *"; - mode = "3840x2160@120Hz"; - scale = 1.0; - status = "enable"; - } - ]; - }; - } - ]; - }; -} diff --git a/modules/home/niri.nix b/modules/home/niri.nix deleted file mode 100644 index 9e30890..0000000 --- a/modules/home/niri.nix +++ /dev/null @@ -1,477 +0,0 @@ -{ - pkgs, - lib, - config, - ... -}: -let - # Executables - foot = lib.getExe' config.programs.foot.package "foot"; - vicinae = lib.getExe' config.programs.vicinae.package "vicinae"; - yazi = lib.getExe' config.programs.yazi.package "yazi"; - noctalia-shell = lib.getExe' config.programs.noctalia-shell.package "noctalia-shell"; - playerctl = lib.getExe' pkgs.playerctl "playerctl"; - wpctl = lib.getExe' pkgs.wireplumber "wpctl"; - brightnessctl = lib.getExe' pkgs.brightnessctl "brightnessctl"; -in -{ - programs.niri = { - # Niri is enabled by niri.nixosModules.nir in desktop.nix - settings = { - input = { - keyboard = { - xkb = { - layout = "us"; - options = "compose:ralt"; - }; - }; - touchpad = { - enable = true; - click-method = "clickfinger"; - drag = true; - drag-lock = true; - dwt = true; - natural-scroll = false; - scroll-method = "two-finger"; - tap = true; - tap-button-map = "left-right-middle"; # Mouse button click to register when tapping with 1, 2, or 3 fingers - }; - warp-mouse-to-focus = { - enable = true; - mode = "center-xy-always"; - }; - focus-follows-mouse = { - enable = true; - }; - mod-key = "Super"; - }; - binds = { - # General - "Mod+Slash" = { - action.show-hotkey-overlay = { }; - repeat = false; - hotkey-overlay.title = "Show hotkeys"; - }; - "Mod+Q" = { - action.close-window = { }; - repeat = false; - hotkey-overlay.title = "Close window"; - }; - "Mod+W" = { - action.spawn = foot; - repeat = false; - hotkey-overlay.title = "Terminal"; - }; - "Mod+A" = { - action.spawn = [ - vicinae - "toggle" - ]; - repeat = false; - hotkey-overlay.title = "Launcher"; - }; - "Mod+E" = { - action.spawn = [ - foot - "-e" - yazi - ]; - repeat = false; - hotkey-overlay.title = "File Explorer"; - }; - "Mod+Escape" = { - action.spawn = [ - noctalia-shell - "ipc" - "call" - "sessionMenu" - "toggle" - ]; - repeat = false; - hotkey-overlay.title = "Session menu"; - }; - - # Notifications - "Mod+N" = { - action.spawn = [ - noctalia-shell - "ipc" - "call" - "notifications" - "toggleHistory" - ]; - repeat = false; - hotkey-overlay.title = "Show notifications"; - }; - "Mod+Ctrl+N" = { - action.spawn = [ - noctalia-shell - "ipc" - "call" - "notifications" - "clear" - ]; - repeat = false; - hotkey-overlay.title = "Clear notifications"; - }; - - # Media keys - "XF86AudioPrev" = { - action.spawn = [ - playerctl - "previous" - ]; - repeat = false; - hotkey-overlay.title = "Previous track"; - }; - "XF86AudioPlay" = { - action.spawn = [ - playerctl - "play-pause" - ]; - repeat = false; - hotkey-overlay.title = "Play / pause track"; - }; - "XF86AudioNext" = { - action.spawn = [ - playerctl - "next" - ]; - repeat = false; - hotkey-overlay.title = "Next track"; - }; - "XF86AudioRaiseVolume" = { - action.spawn = [ - wpctl - "set-volume" - "@DEFAULT_AUDIO_SINK@" - "0.05+" - ]; - repeat = true; - allow-when-locked = true; - hotkey-overlay.title = "Raise volume"; - }; - "XF86AudioLowerVolume" = { - action.spawn = [ - wpctl - "set-volume" - "@DEFAULT_AUDIO_SINK@" - "0.05-" - ]; - repeat = true; - allow-when-locked = true; - hotkey-overlay.title = "Lower volume"; - }; - "XF86AudioMute" = { - action.spawn = [ - wpctl - "set-mute" - "@DEFAULT_AUDIO_SINK@" - "toggle" - ]; - repeat = false; - allow-when-locked = true; - hotkey-overlay.title = "Mute playback"; - }; - "Alt+XF86AudioRaiseVolume" = { - action.spawn = [ - wpctl - "set-volume" - "@DEFAULT_AUDIO_SOURCE@" - "0.05+" - ]; - repeat = true; - allow-when-locked = true; - hotkey-overlay.title = "Raise microphone volume"; - }; - "Alt+XF86AudioLowerVolume" = { - action.spawn = [ - wpctl - "set-volume" - "@DEFAULT_AUDIO_SOURCE@" - "0.05-" - ]; - repeat = true; - allow-when-locked = true; - hotkey-overlay.title = "Lower microphone volume"; - }; - "Alt+XF86AudioMute" = { - action.spawn = [ - wpctl - "set-mute" - "@DEFAULT_AUDIO_SOURCE@" - "toggle" - ]; - repeat = false; - allow-when-locked = true; - hotkey-overlay.title = "Mute microphone"; - }; - - # Brightness - "XF86MonBrightnessUp" = { - action.spawn = [ - brightnessctl - "set" - "5%+" - ]; - repeat = true; - allow-when-locked = true; - hotkey-overlay.title = "Increase brightness"; - }; - "XF86MonBrightnessDown" = { - action.spawn = [ - brightnessctl - "set" - "5%-" - ]; - repeat = true; - allow-when-locked = true; - hotkey-overlay.title = "Decrease brightness"; - }; - - # Screen capture - "Print" = { - action.screenshot = { - show-pointer = false; - }; - repeat = false; - hotkey-overlay.title = "Screenshot"; - }; - "Mod+Print" = { - action.screenshot-window = { - # show-pointer = false; - }; - repeat = false; - hotkey-overlay.title = "Screenshot window"; - }; - "Shift+Print" = { - action.screenshot-screen = { - show-pointer = false; - }; - repeat = false; - hotkey-overlay.title = "Screenshot screen"; - }; - - # Display scaling - "Mod+Ctrl+Equal" = { - action.spawn = [ - "output-scale" - "+0.1" - ]; - repeat = true; - hotkey-overlay.title = "Increase display scale"; - }; - "Mod+Ctrl+Minus" = { - action.spawn = [ - "output-scale" - "-0.1" - ]; - repeat = true; - hotkey-overlay.title = "Decrease display scale"; - }; - "Mod+Ctrl+0" = { - action.spawn = [ - "output-scale" - "1.0" - ]; - repeat = true; - hotkey-overlay.title = "Reset display scale"; - }; - - # Window and column size - "Mod+F" = { - action.maximize-column = { }; - repeat = false; - hotkey-overlay.title = "Maximize Column"; - }; - "Mod+Shift+F" = { - action.fullscreen-window = { }; - repeat = false; - hotkey-overlay.title = "Fullscreen"; - }; - "Mod+Ctrl+F" = { - action.expand-column-to-available-width = { }; - repeat = false; - hotkey-overlay.title = "Fill empty column space"; - }; - "Mod+Equal" = { - action.set-column-width = "+10%"; - repeat = true; - hotkey-overlay.title = "Increase column width"; - }; - "Mod+Minus" = { - action.set-column-width = "-10%"; - repeat = true; - hotkey-overlay.title = "Decrease column width"; - }; - "Mod+Shift+Equal" = { - action.set-window-height = "+10%"; - repeat = true; - hotkey-overlay.title = "Increase window height"; - }; - "Mod+Shift+Minus" = { - action.set-window-height = "-10%"; - repeat = true; - hotkey-overlay.title = "Decrease window height"; - }; - "Mod+Z" = { - action.toggle-window-floating = { }; - repeat = false; - hotkey-overlay.title = "Toggle floating"; - }; - "Mod+T" = { - action.toggle-column-tabbed-display = { }; - repeat = false; - hotkey-overlay.title = "Toggle tabbed column"; - }; - - # Window and column movement - "Mod+K" = { - action.focus-window-or-monitor-up = { }; - repeat = false; - hotkey-overlay.title = "Focus window up"; - }; - "Mod+J" = { - action.focus-window-or-monitor-down = { }; - repeat = false; - hotkey-overlay.title = "Focus window down"; - }; - "Mod+H" = { - action.focus-column-or-monitor-left = { }; - repeat = false; - hotkey-overlay.title = "Focus window left"; - }; - "Mod+L" = { - action.focus-column-or-monitor-right = { }; - repeat = false; - hotkey-overlay.title = "Focus window right"; - }; - "Mod+BracketLeft" = { - action.consume-or-expel-window-left = { }; - repeat = false; - hotkey-overlay.title = "Move window left"; - }; - "Mod+BracketRight" = { - action.consume-or-expel-window-right = { }; - repeat = false; - hotkey-overlay.title = "Move window right"; - }; - "Mod+Shift+K" = { - action.move-column-to-monitor-up = { }; - repeat = false; - hotkey-overlay.title = "Move column up"; - }; - "Mod+Shift+J" = { - action.move-column-to-monitor-down = { }; - repeat = false; - hotkey-overlay.title = "Move column down"; - }; - "Mod+Shift+H" = { - action.move-column-left-or-to-monitor-left = { }; - repeat = false; - hotkey-overlay.title = "Move column left"; - }; - "Mod+Shift+L" = { - action.move-column-right-or-to-monitor-right = { }; - repeat = false; - hotkey-overlay.title = "Move column right"; - }; - - # Workspaces - "Mod+Ctrl+K" = { - action.focus-workspace-up = { }; - repeat = false; - hotkey-overlay.title = "Focus workspace up"; - }; - "Mod+Ctrl+J" = { - action.focus-workspace-down = { }; - repeat = false; - hotkey-overlay.title = "Focus workspace down"; - }; - "Mod+Ctrl+Shift+K" = { - action.move-column-to-workspace-up = { }; - repeat = false; - hotkey-overlay.title = "Move column to workspace up"; - }; - "Mod+Ctrl+Shift+J" = { - action.move-column-to-workspace-down = { }; - repeat = false; - hotkey-overlay.title = "Move column to workspace down"; - }; - - # Overview - "Mod+Tab" = { - action.toggle-overview = { }; - repeat = false; - hotkey-overlay.title = "Toggle overview"; - }; - }; - window-rules = [ - { - geometry-corner-radius = { - bottom-left = 10.0; - bottom-right = 10.0; - top-left = 10.0; - top-right = 10.0; - }; - clip-to-geometry = true; - } - # Unfortunately windows like firefox extensions set their titles after spawning preventing - # the window rules from being applied. There is a script to fix this but it is pretty hacky. - # { - # matches = [ - # { - # title = "^Extension:.*"; - # app-id = "firefox"; - # } - # ]; - # open-floating = true; - # } - { - matches = [ - { app-id = "foot"; } - { app-id = "Alacritty"; } - ]; - opacity = 0.90; - default-column-width.proportion = 0.4; - } - ]; - layer-rules = [ - { - # Use noctalia wallpaper as overview backdrop - matches = [ { namespace = "^noctalia-overview*"; } ]; - place-within-backdrop = true; - } - ]; - prefer-no-csd = true; - screenshot-path = "${config.xdg.userDirs.extraConfig.SCREENSHOTS}/%Y%m%d-%H%M%S.png"; - hotkey-overlay = { - skip-at-startup = true; - }; - spawn-at-startup = [ - { argv = [ "noctalia-shell" ]; } - ]; - cursor = { - size = config.stylix.cursor.size; - theme = config.stylix.cursor.name; - hide-when-typing = true; - }; - gestures = { - hot-corners.enable = false; - }; - xwayland-satellite = { - enable = true; - path = lib.getExe pkgs.xwayland-satellite-unstable; - }; - environment = { - "NIXOS_OZONE_WL" = "1"; - }; - debug = { - # Allows notification actions and window activation from Noctalia. - honor-xdg-activation-with-invalid-serial = { }; - }; - # Support for external 'includes' sounds like it is in the works. - # Will just have to wait until then for noctalia color scheme integration. - }; - }; -} diff --git a/modules/home/noctalia.nix b/modules/home/noctalia.nix deleted file mode 100644 index 4070bd8..0000000 --- a/modules/home/noctalia.nix +++ /dev/null @@ -1,136 +0,0 @@ -{ - inputs, - config, - ... -}: -{ - imports = [ - inputs.noctalia.homeModules.default - ]; - - programs.noctalia-shell = { - enable = true; - settings = { - general = { - avatarImage = "~/.face"; - autoStartAuth = true; - allowPasswordWithFprintd = true; - }; - location.name = "Washington DC"; - bar = { - widgets = { - right = [ - { - id = "plugin:tailscale"; - } - { - id = "Tray"; - } - { - id = "NotificationHistory"; - } - { - id = "Battery"; - } - { - id = "Volume"; - } - { - id = "Brightness"; - } - { - id = "ControlCenter"; - } - ]; - }; - }; - templates = { - activeTemplates = [ - { - enabled = true; - id = "alacritty"; - } - { - enabled = true; - id = "discord"; - } - { - enabled = true; - id = "foot"; - } - { - enabled = true; - id = "gtk"; - } - { - enabled = true; - id = "helix"; - } - { - enabled = true; - id = "niri"; - } - { - enabled = true; - id = "pywalfox"; - } - { - enabled = true; - id = "qt"; - } - { - enabled = true; - id = "vicinae"; - } - { - enabled = true; - id = "yazi"; - } - { - enabled = true; - id = "zed"; - } - ]; - enableUserTheming = true; - }; - wallpaper = { - enabled = true; - overviewEnabled = true; - directory = "${config.xdg.userDirs.extraConfig.WALLPAPERS}"; - }; - colorSchemes.predefinedScheme = "Catppuccin"; - }; - plugins = { - sources = [ - { - enabled = true; - name = "Noctalia Plugins"; - url = "https://github.com/noctalia-dev/noctalia-plugins"; - } - ]; - states = { - tailscale = { - enabled = true; - sourceUrl = "https://github.com/noctalia-dev/noctalia-plugins"; - }; - activate-linux = { - enabled = true; - sourceUrl = "https://github.com/noctalia-dev/noctalia-plugins"; - }; - }; - version = 1; - }; - pluginSettings = { - tailscale = { - refreshInterval = 5000; - compactMode = true; - showIpAddress = false; - showPeerCount = false; - hideDisconnected = false; - terminalCommand = "foot"; - pingCount = 5; - defaultPeerAction = "copy-ip"; - }; - }; - }; -} diff --git a/modules/home/packages.nix b/modules/home/packages.nix deleted file mode 100644 index 7e2009a..0000000 --- a/modules/home/packages.nix +++ /dev/null @@ -1,31 +0,0 @@ -{ - inputs, - pkgs, - ... -}: -{ - imports = [ - inputs.nix-jmu-cs345.homeManagerModules.bernstdh - ]; - - programs.nix-jmu-cs345.enable = true; - - home.packages = with pkgs; [ - devenv - htop - obsidian - upscayl - trayscale - nautilus - - # CD Stuff - picard - heybrochecklog - rsgain - - playerctl - brightnessctl - monique - opencode - ]; -} diff --git a/modules/home/screenshot.nix b/modules/home/screenshot.nix deleted file mode 100644 index b8ff8f2..0000000 --- a/modules/home/screenshot.nix +++ /dev/null @@ -1,26 +0,0 @@ -{ - pkgs, - config, - ... -}: -{ - home.packages = with pkgs; [ - grim - slurp - wl-clipboard-rs - ]; - - programs.swappy = { - enable = true; - # Configuration options: https://github.com/jtheoof/swappy?tab=readme-ov-file#config - settings = { - Default = { - save_dir = config.xdg.userDirs.extraConfig.SCREENSHOTS; - save_filename_format = "%Y%m%d-%H%M%S.png"; - show_panel = false; - auto_save = false; - early_exit = true; - }; - }; - }; -} diff --git a/modules/home/ssh.nix b/modules/home/ssh.nix deleted file mode 100644 index ae4d7f2..0000000 --- a/modules/home/ssh.nix +++ /dev/null @@ -1,32 +0,0 @@ -{ - programs.ssh = { - enable = true; - enableDefaultConfig = false; - matchBlocks = { - "*" = { - addKeysToAgent = "yes"; - identityFile = [ "~/.ssh/id_ed25519_sk_rk" ]; - }; - "stu" = { - hostname = "stu.cs.jmu.edu"; - user = "tamassno"; - localForwards = [ - { - bind.port = 5432; - host = { - address = "data.cs.jmu.edu"; - port = 5432; - }; - } - ]; - serverAliveCountMax = 5; - serverAliveInterval = 60; - }; - "cluster" = { - hostname = "login02.cluster.cs.jmu.edu"; - user = "tamassno"; - proxyJump = "stu"; - }; - }; - }; -} diff --git a/modules/home/stylix.nix b/modules/home/stylix.nix deleted file mode 100644 index c6bafd2..0000000 --- a/modules/home/stylix.nix +++ /dev/null @@ -1,98 +0,0 @@ -{ - inputs, - config, - pkgs, - ... -}: -{ - imports = [ - inputs.stylix.homeModules.stylix - ]; - - # Not really using stylix as it was intended because IMO it sets too many defaults for some - # programs and not enought for others, meaning I wind up setting a lot myself anyway. That - # being said it provides a nice structure for setting fonts, cursors, icons, etc. - stylix = { - enable = true; - autoEnable = false; - polarity = "dark"; - base16Scheme = "${pkgs.base16-schemes}/share/themes/catppuccin-mocha.yaml"; - cursor = { - name = "catppuccin-mocha-dark-cursors"; - package = pkgs.catppuccin-cursors.mochaDark; - size = 16; - }; - # For some reason setting the fonts' package option doesn't work. - # Just use home.packages instead - fonts = { - monospace.name = "JetBrainsMono Nerd Font"; - sansSerif.name = "Noto Sans"; - emoji.name = "Noto Color Emoji"; - sizes = { - applications = 12; - terminal = 12; - }; - }; - icons = { - enable = true; - package = pkgs.morewaita-icon-theme; - light = "MoreWaita"; - dark = "MoreWaita"; - }; - }; - - # Fonts - home.packages = with pkgs; [ - nerd-fonts.jetbrains-mono - noto-fonts - noto-fonts-cjk-sans - noto-fonts-color-emoji - ]; - - fonts.fontconfig = { - enable = true; - defaultFonts = { - sansSerif = [ "Noto Sans" ]; - monospace = [ "JetBrainsMono Nerd Font" ]; - emoji = [ "Noto Color Emoji" ]; - }; - }; - - gtk = { - enable = true; - colorScheme = config.stylix.polarity; - # iconTheme is set by default by stylix.icons.enable - theme = { - name = "adw-gtk3-${config.stylix.polarity}"; - package = pkgs.adw-gtk3; - }; - }; - - qt = - let - qt_settings = ver: { - Appearance = { - color_scheme_path = "${config.xdg.configHome}/${ver}/colors/noctalia.conf"; - custom_palette = true; - icon_theme = config.stylix.icons.${config.stylix.polarity}; - standard_dialogs = "xdgdesktopportal"; - style = "Breeze"; - }; - Fonts = { - fixed = "\"${config.stylix.fonts.monospace.name},${toString config.stylix.fonts.sizes.applications}\""; - general = "\"${config.stylix.fonts.sansSerif.name},${toString config.stylix.fonts.sizes.applications}\""; - }; - }; - in - { - enable = true; - platformTheme.name = "qtct"; - style.name = "breeze"; - qt5ctSettings = qt_settings "qt5ct"; - qt6ctSettings = qt_settings "qt6ct"; - }; - - home.sessionVariables = { - QS_ICON_THEME = config.stylix.icons.${config.stylix.polarity}; - }; -} diff --git a/modules/home/terminal.nix b/modules/home/terminal.nix deleted file mode 100644 index 217eb72..0000000 --- a/modules/home/terminal.nix +++ /dev/null @@ -1,140 +0,0 @@ -{ - config, - lib, - pkgs, - ... -}: -{ - programs = { - alacritty = { - enable = true; - settings = { - general = { - import = [ "${config.xdg.configHome}/alacritty/themes/noctalia.toml" ]; - }; - font = { - normal = { - family = "${config.stylix.fonts.monospace.name}"; - style = "Regular"; - }; - size = config.stylix.fonts.sizes.terminal; - }; - }; - }; - direnv = { - enable = true; - enableZshIntegration = true; - }; - fastfetch = { - enable = true; - }; - foot = { - enable = true; - server.enable = false; - package = pkgs.foot; - settings = { - main = { - term = "xterm-256color"; - include = "${config.xdg.configHome}/foot/themes/noctalia"; - dpi-aware = "no"; - font = "${config.stylix.fonts.monospace.name}:size=${toString config.stylix.fonts.sizes.terminal}"; - }; - mouse = { - hide-when-typing = "yes"; - }; - }; - }; - fzf = { - enable = true; - enableZshIntegration = true; - }; - starship = { - enable = true; - enableZshIntegration = true; - settings = { - add_newline = true; - format = lib.strings.concatStrings [ - "[ ╭─[\\[](1)$username([@](bold 2)$hostname)[\\]:](1) $directory( $git_branch)](5)" - "$line_break" - "[ ╰─$character](5)" - ]; - username = { - style_root = "white"; - format = "[$user](3)"; - disabled = false; - show_always = true; - }; - hostname = { - format = "[$hostname](bold 4)"; - disabled = false; - ssh_only = false; - }; - character = { - success_symbol = "[❯](bold 5)"; - error_symbol = "[✘](bold 5)"; - vimcmd_symbol = "[❮](bold 5)"; - }; - directory = { - read_only = ""; - format = "[ $path](5)"; - read_only_style = "bold white"; - truncation_length = 5; - }; - git_branch = { - symbol = ""; - style = "bright-black"; - format = "[$symbol $branch]($style)"; - }; - scan_timeout = 100; - }; - }; - zoxide = { - enable = true; - enableZshIntegration = true; - }; - zsh = { - enable = true; - enableCompletion = false; - antidote = { - enable = true; - plugins = [ - "Aloxaf/fzf-tab" - ]; - }; - autosuggestion.enable = true; - dotDir = "${config.xdg.configHome}/zsh"; - history = { - append = true; - findNoDups = true; - ignoreSpace = true; - ignoreDups = true; - saveNoDups = true; - share = true; - }; - historySubstringSearch = { - enable = true; - searchDownKey = "^p"; - searchUpKey = "^n"; - }; - initContent = '' - # disable sort when completing `git checkout` - zstyle ':completion:*:git-checkout:*' sort false - # set descriptions format to enable group support - # NOTE: don't use escape sequences (like '%F{red}%d%f') here, fzf-tab will ignore them - zstyle ':completion:*:descriptions' format '[%d]' - # preview directory's content when completing cd or zoxide - zstyle ':fzf-tab:complete:cd:*' fzf-preview 'ls --color $realpath' - zstyle ':fzf-tab:complete:__zoxide_z:*' fzf-preview 'ls --color $realpath' - # custom fzf flags - # NOTE: fzf-tab does not follow FZF_DEFAULT_OPTS by default - zstyle ':fzf-tab:*' fzf-flags --color=fg:1,fg+:2 --bind=tab:accept - # switch group using `<` and `>` - zstyle ':fzf-tab:*' switch-group '<' '>' - ''; - syntaxHighlighting.enable = true; - shellAliases = { - ff = "fastfetch"; - }; - }; - }; -} diff --git a/modules/home/vesktop.nix b/modules/home/vesktop.nix deleted file mode 100644 index dd9d2b3..0000000 --- a/modules/home/vesktop.nix +++ /dev/null @@ -1,15 +0,0 @@ -{ - programs.vesktop = { - enable = true; - vencord = { - settings = { - oUpdate = false; - autoUpdateNotification = false; - notifyAboutUpdates = false; - useQuickCss = true; - disableMinSize = true; - enabledThemes = [ "noctalia.theme.css" ]; - }; - }; - }; -} diff --git a/modules/home/vicinae.nix b/modules/home/vicinae.nix deleted file mode 100644 index 0b84e2e..0000000 --- a/modules/home/vicinae.nix +++ /dev/null @@ -1,40 +0,0 @@ -{ - config, - ... -}: -{ - # Not using Vicinae's flake because the server fucking seg faults immediately - programs.vicinae = { - enable = true; - systemd = { - enable = true; - autoStart = true; - }; - # For configuration option documentation, see: https://github.com/vicinaehq/vicinae/blob/f6222f1e82fe2077ad42f10a6d6837dc61c67fd0/vicinae/assets/config.jsonc - settings = { - escape_key_behavior = "close_window"; - close_on_focus_loss = true; - pop_to_root_on_close = true; - favicon_service = "twenty"; - telemetry = { - system_info = false; - }; - font = { - normal = { - size = config.stylix.fonts.sizes.applications; - family = "${config.stylix.fonts.monospace.name}"; - }; - }; - theme = { - light = { - name = "noctalia"; - icon_theme = "${config.stylix.icons.light}"; - }; - dark = { - name = "noctalia"; - icon_theme = "${config.stylix.icons.dark}"; - }; - }; - }; - }; -} diff --git a/modules/home/xdg.nix b/modules/home/xdg.nix deleted file mode 100644 index adeb581..0000000 --- a/modules/home/xdg.nix +++ /dev/null @@ -1,34 +0,0 @@ -{ - config, - pkgs, - ... -}: -{ - xdg = { - enable = true; - portal = { - enable = true; - configPackages = [ pkgs.gnome-session ]; - extraPortals = with pkgs; [ - xdg-desktop-portal-gnome - xdg-desktop-portal-gtk - ]; - }; - userDirs = { - enable = true; - createDirectories = true; - extraConfig = { - DEV = "${config.home.homeDirectory}/Dev"; - WALLPAPERS = "${config.xdg.userDirs.pictures}/Wallpapers"; - SCREENSHOTS = "${config.xdg.userDirs.pictures}/Screenshots"; - }; - }; - }; - - home.file.".face".source = ../../assets/profile-picture.jpg; - - home.file."${config.xdg.userDirs.extraConfig.WALLPAPERS}" = { - source = ../../assets/wallpapers; - recursive = true; - }; -} diff --git a/modules/home/yazi.nix b/modules/home/yazi.nix deleted file mode 100644 index 8787621..0000000 --- a/modules/home/yazi.nix +++ /dev/null @@ -1,63 +0,0 @@ -{ - pkgs, - ... -}: -{ - home.packages = with pkgs; [ - dragon-drop - ]; - - programs.yazi = { - enable = true; - enableZshIntegration = true; - shellWrapperName = "y"; - plugins = with pkgs.yaziPlugins; { - inherit git full-border chmod; - }; - initLua = '' - require("git"):setup { - -- Order of status signs showing in the linemode - order = 1500, - } - require("full-border"):setup() - ''; - keymap = { - mgr.prepend_keymap = [ - { - on = ""; - run = "shell -- dragon-drop -x -i -T %s1"; - desc = "Open a prompt to drag and drop a file"; - } - { - on = [ - "c" - "m" - ]; - run = "plugin chmod"; - desc = "Chmod on selected files"; - } - ]; - }; - settings = { - plugin = { - # Disable all preset previewers, preloaders - # This is recommended by yazi when working with network shares - preloaders = [ ]; - previewers = [ ]; - - prepend_fetchers = [ - { - id = "git"; - url = "*"; - run = "git"; - } - { - id = "git"; - url = "*/"; - run = "git"; - } - ]; - }; - }; - }; -} diff --git a/modules/home/zed.nix b/modules/home/zed.nix deleted file mode 100644 index 6d082c8..0000000 --- a/modules/home/zed.nix +++ /dev/null @@ -1,20 +0,0 @@ -{ - pkgs, - ... -}: -{ - programs.zed-editor = { - enable = true; - extensions = [ - "nix" - ]; - extraPackages = [ pkgs.nixd ]; - - userSettings = { - theme = "Noctalia Dark"; - features = { - edit_prediction_provider = "copilot"; - }; - }; - }; -} diff --git a/modules/home/zellij.nix b/modules/home/zellij.nix deleted file mode 100644 index 8b36f28..0000000 --- a/modules/home/zellij.nix +++ /dev/null @@ -1,455 +0,0 @@ -let - mod = "Alt"; # Can be one of "Ctrl", "Alt", "Shift", "Super" -in -{ - programs.zellij = { - enable = true; - enableZshIntegration = true; - settings = { - theme = "catppuccin-mocha"; - show_startup_tips = false; - keybinds = { - _props = { - clear-defaults = true; - }; - - _children = [ - { - locked._children = [ - { - bind = { - _args = [ "${mod} g" ]; - _children = [ { SwitchToMode._args = [ "Normal" ]; } ]; - }; - } - ]; - } - { - resize._children = [ - { - bind = { - _args = [ "${mod} r" ]; - _children = [ { SwitchToMode._args = [ "Normal" ]; } ]; - }; - } - { - bind = { - _args = [ "h" ]; - _children = [ { Resize._args = [ "Increase Left" ]; } ]; - }; - } - { - bind = { - _args = [ "j" ]; - _children = [ { Resize._args = [ "Increase Down" ]; } ]; - }; - } - { - bind = { - _args = [ "k" ]; - _children = [ { Resize._args = [ "Increase Up" ]; } ]; - }; - } - { - bind = { - _args = [ "l" ]; - _children = [ { Resize._args = [ "Increase Right" ]; } ]; - }; - } - ]; - } - - { - pane._children = [ - { - bind = { - _args = [ "${mod} p" ]; - _children = [ { SwitchToMode._args = [ "Normal" ]; } ]; - }; - } - { - bind = { - _args = [ "c" ]; - _children = [ { Clear = { }; } ]; - }; - } - { - bind = { - _args = [ "e" ]; - _children = [ - { TogglePaneEmbedOrFloating = { }; } - { SwitchToMode._args = [ "Normal" ]; } - ]; - }; - } - { - bind = { - _args = [ "f" ]; - _children = [ - { ToggleFocusFullscreen = { }; } - { SwitchToMode._args = [ "Normal" ]; } - ]; - }; - } - { - bind = { - _args = [ "s" ]; - _children = [ - { NewPane._args = [ "stacked" ]; } - { SwitchToMode._args = [ "Normal" ]; } - ]; - }; - } - { - bind = { - _args = [ "j" ]; - _children = [ - { NewPane._args = [ "Down" ]; } - { SwitchToMode._args = [ "Normal" ]; } - ]; - }; - } - { - bind = { - _args = [ "l" ]; - _children = [ - { NewPane._args = [ "Right" ]; } - { SwitchToMode._args = [ "Normal" ]; } - ]; - }; - } - { - bind = { - _args = [ "n" ]; - _children = [ - { NewPane = { }; } - { SwitchToMode._args = [ "Normal" ]; } - ]; - }; - } - { - bind = { - _args = [ "p" ]; - _children = [ - { SwitchFocus = { }; } - { SwitchToMode._args = [ "Normal" ]; } - ]; - }; - } - { - bind = { - _args = [ "r" ]; - _children = [ - { SwitchToMode._args = [ "RenamePane" ]; } - { PaneNameInput._args = [ 0 ]; } - ]; - }; - } - { - bind = { - _args = [ "w" ]; - _children = [ - { ToggleFloatingPanes = { }; } - { SwitchToMode._args = [ "Normal" ]; } - ]; - }; - } - { - bind = { - _args = [ "x" ]; - _children = [ - { CloseFocus = { }; } - { SwitchToMode._args = [ "Normal" ]; } - ]; - }; - } - { - bind = { - _args = [ "z" ]; - _children = [ - { TogglePaneFrames = { }; } - { SwitchToMode._args = [ "Normal" ]; } - ]; - }; - } - ]; - } - { - move._children = [ - { - bind = { - _args = [ "${mod} m" ]; - _children = [ { SwitchToMode._args = [ "Normal" ]; } ]; - }; - } - { - bind = { - _args = [ "h" ]; - _children = [ { MovePane._args = [ "Left" ]; } ]; - }; - } - { - bind = { - _args = [ "j" ]; - _children = [ { MovePane._args = [ "Down" ]; } ]; - }; - } - { - bind = { - _args = [ "k" ]; - _children = [ { MovePane._args = [ "Up" ]; } ]; - }; - } - { - bind = { - _args = [ "l" ]; - _children = [ { MovePane._args = [ "Right" ]; } ]; - }; - } - ]; - } - { - tab._children = [ - { - bind = { - _args = [ "${mod} t" ]; - _children = [ { SwitchToMode._args = [ "Normal" ]; } ]; - }; - } - { - bind = { - _args = [ "b" ]; - _children = [ - { BreakPane = { }; } - { SwitchToMode._args = [ "Normal" ]; } - ]; - }; - } - { - bind = { - _args = [ "h" ]; - _children = [ { MoveTab._args = [ "Left" ]; } ]; - }; - } - { - bind = { - _args = [ "l" ]; - _children = [ { MoveTab._args = [ "Right" ]; } ]; - }; - } - { - bind = { - _args = [ "n" ]; - _children = [ - { NewTab = { }; } - { SwitchToMode._args = [ "Normal" ]; } - ]; - }; - } - { - bind = { - _args = [ "r" ]; - _children = [ - { SwitchToMode._args = [ "RenameTab" ]; } - { TabNameInput._args = [ 0 ]; } - ]; - }; - } - { - bind = { - _args = [ "x" ]; - _children = [ - { CloseTab = { }; } - { SwitchToMode._args = [ "Normal" ]; } - ]; - }; - } - ]; - } - { - renametab._children = [ - { - bind = { - _args = [ "${mod} c" ]; - _children = [ { SwitchToMode._args = [ "Normal" ]; } ]; - }; - } - { - bind = { - _args = [ "Esc" ]; - _children = [ - { UndoRenameTab = { }; } - { SwitchToMode._args = [ "Normal" ]; } - ]; - }; - } - ]; - } - { - renamepane._children = [ - { - bind = { - _args = [ "${mod} c" ]; - _children = [ { SwitchToMode._args = [ "Normal" ]; } ]; - }; - } - { - bind = { - _args = [ "Esc" ]; - _children = [ - { UndoRenamePane = { }; } - { SwitchToMode._args = [ "Normal" ]; } - ]; - }; - } - ]; - } - { - shared_except = { - _args = [ "locked" ]; - _children = [ - { - bind = { - _args = [ "${mod} g" ]; - _children = [ { SwitchToMode._args = [ "Locked" ]; } ]; - }; - } - { - bind = { - _args = [ "${mod} h" ]; - _children = [ { MoveFocusOrTab._args = [ "Left" ]; } ]; - }; - } - { - bind = { - _args = [ "${mod} l" ]; - _children = [ { MoveFocusOrTab._args = [ "Right" ]; } ]; - }; - } - { - bind = { - _args = [ "${mod} j" ]; - _children = [ { MoveFocus._args = [ "Down" ]; } ]; - }; - } - { - bind = { - _args = [ "${mod} k" ]; - _children = [ { MoveFocus._args = [ "Up" ]; } ]; - }; - } - { - bind = { - _args = [ "${mod} [" ]; - _children = [ { PreviousSwapLayout = { }; } ]; - }; - } - { - bind = { - _args = [ "${mod} ]" ]; - _children = [ { NextSwapLayout = { }; } ]; - }; - } - ]; - }; - } - { - shared_except = { - _args = [ - "normal" - "locked" - ]; - _children = [ - { - bind = { - _args = [ - "Enter" - "Esc" - ]; - _children = [ { SwitchToMode = [ "Normal" ]; } ]; - }; - } - ]; - }; - } - { - shared_except = { - _args = [ - "pane" - "locked" - ]; - _children = [ - { - bind = { - _args = [ "${mod} p" ]; - _children = [ { SwitchToMode = [ "Pane" ]; } ]; - }; - } - ]; - }; - } - { - shared_except = { - _args = [ - "resize" - "locked" - ]; - _children = [ - { - bind = { - _args = [ "${mod} r" ]; - _children = [ { SwitchToMode = [ "Resize" ]; } ]; - }; - } - ]; - }; - } - { - shared_except = { - _args = [ - "tab" - "locked" - ]; - _children = [ - { - bind = { - _args = [ "${mod} t" ]; - _children = [ { SwitchToMode = [ "Tab" ]; } ]; - }; - } - ]; - }; - } - { - shared_except = { - _args = [ - "move" - "locked" - ]; - _children = [ - { - bind = { - _args = [ "${mod} m" ]; - _children = [ { SwitchToMode = [ "Move" ]; } ]; - }; - } - ]; - }; - } - ]; - }; - - plugins = { - compact-bar = { - _props = { - location = "zellij:compact-bar"; - }; - }; - }; - - simplified_ui = true; - pane_frames = false; - copy_on_select = true; - }; - }; -} diff --git a/modules/hosts/host.nix b/modules/hosts/host.nix new file mode 100644 index 0000000..17410ce --- /dev/null +++ b/modules/hosts/host.nix @@ -0,0 +1,17 @@ +{ + flake.modules.nixos.host = + { lib, ... }: + { + # ? Could potentially move this directly into the agenix module + options = { + # Host public SSH key (e.g. /etc/ssh/ssh_host_ed25519_key.pub). + # We only set the hostPubkey if one is supplied. For new hosts the pub key will not + # exist until it is generated after the first rebuild. + hostPubkey = lib.mkOption { + type = lib.types.nullOr lib.types.str; + default = null; + description = "The public key of the host. Will be null until generated on first rebuild"; + }; + }; + }; +} diff --git a/modules/hosts/vanta/configuration.nix b/modules/hosts/vanta/configuration.nix new file mode 100644 index 0000000..f17aca9 --- /dev/null +++ b/modules/hosts/vanta/configuration.nix @@ -0,0 +1,71 @@ +{ + self, + inputs, + ... +}: +{ + flake.nixosConfigurations.vanta = inputs.nixpkgs.lib.nixosSystem { + modules = [ self.modules.nixos.vanta ]; + }; + + flake.modules.nixos.vanta = + { ... }: + { + imports = with self.modules.nixos; [ + vantaHardware + profiles-intel + host + base + eclypsecloud-shares + fprintd + gdm + niri + + # Users + home-manager + eclypse + ]; + + hostPubkey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAaDVBJdMDFL8r9NQCbaLe+DPHGhGzRv2N7+7m1/U8DP"; + + networking.hostName = "vanta"; + + # Set your time zone. + time.timeZone = "America/New_York"; + + # Select internationalisation properties. + i18n = { + defaultLocale = "en_US.UTF-8"; + extraLocaleSettings = { + LC_ADDRESS = "en_US.UTF-8"; + LC_IDENTIFICATION = "en_US.UTF-8"; + LC_MEASUREMENT = "en_US.UTF-8"; + LC_MONETARY = "en_US.UTF-8"; + LC_NAME = "en_US.UTF-8"; + LC_NUMERIC = "en_US.UTF-8"; + LC_PAPER = "en_US.UTF-8"; + LC_TELEPHONE = "en_US.UTF-8"; + LC_TIME = "en_US.UTF-8"; + }; + }; + + # This option defines the first version of NixOS you have installed on this particular machine, + # and is used to maintain compatibility with application data (e.g. databases) created on older NixOS versions. + # + # Most users should NEVER change this value after the initial install, for any reason, + # even if you've upgraded your system to a new NixOS release. + # + # This value does NOT affect the Nixpkgs version your packages and OS are pulled from, + # so changing it will NOT upgrade your system - see https://nixos.org/manual/nixos/stable/#sec-upgrading for how + # to actually do that. + # + # This value being lower than the current NixOS release does NOT mean your system is + # out of date, out of support, or vulnerable. + # + # Do NOT change this value unless you have manually inspected all the changes it would make to your configuration, + # and migrated your data accordingly. + # + # For more information, see `man configuration.nix` or https://nixos.org/manual/nixos/stable/options#opt-system.stateVersion . + system.stateVersion = "25.05"; # Did you read the comment? + }; +} diff --git a/modules/hosts/vanta/hardware-configuration.nix b/modules/hosts/vanta/hardware-configuration.nix new file mode 100644 index 0000000..6971f46 --- /dev/null +++ b/modules/hosts/vanta/hardware-configuration.nix @@ -0,0 +1,59 @@ +{ + inputs, + ... +}: +{ + flake.modules.nixos.vantaHardware = + { + config, + lib, + modulesPath, + ... + }: + { + imports = [ + inputs.nixos-hardware.nixosModules.framework-12th-gen-intel + (modulesPath + "/installer/scan/not-detected.nix") + ]; + + boot.initrd.availableKernelModules = [ + "xhci_pci" + "thunderbolt" + "nvme" + "usbhid" + "usb_storage" + "sd_mod" + ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = { + device = "/dev/disk/by-uuid/1df00fd1-f531-49b9-9dc6-6d17ca39b67a"; + fsType = "ext4"; + }; + + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/EE0E-CAE4"; + fsType = "vfat"; + options = [ + "fmask=0077" + "dmask=0077" + ]; + }; + + swapDevices = [ + { device = "/dev/disk/by-uuid/fbacd982-b161-447c-a34a-7b44bc063a08"; } + ]; + + # Enables DHCP on each ethernet and wireless interface. In case of scripted networking + # (the default) this is the recommended approach. When using systemd-networkd it's + # still possible to use this option, but it's recommended to use it in conjunction + # with explicit per-interface declarations with `networking.interfaces..useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.wlp166s0.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; + }; +} diff --git a/modules/overlays/default.nix b/modules/overlays/default.nix deleted file mode 100644 index b824a19..0000000 --- a/modules/overlays/default.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ - nixpkgs.overlays = [ - (import ./heybrochecklog.nix) - (import ./pywalfox-native.nix) - (import ./monique.nix) - ]; -} diff --git a/modules/overlays/heybrochecklog.nix b/modules/overlays/heybrochecklog.nix deleted file mode 100644 index b035919..0000000 --- a/modules/overlays/heybrochecklog.nix +++ /dev/null @@ -1,43 +0,0 @@ -self: super: with super.python3Packages; rec { - pprp = buildPythonPackage rec { - pname = "pprp"; - version = "0.2.7"; - - src = fetchPypi { - inherit pname version; - sha256 = "sha256-2ednecxSsJONvH9XJ6GV3ExgdcPrUEAlYRpZt2Nrkw0="; - }; - - format = "setuptools"; - doCheck = false; - }; - - heybrochecklog = buildPythonApplication rec { - pname = "heybrochecklog"; - version = "1.4.7"; - - src = super.fetchurl { - url = "https://github.com/doujincafe/hbcl/releases/download/v${version}/heybrochecklog-${version}.tar.gz"; - sha256 = "sha256-nCJJvzw/BoCEGDIX62zZr1ZI/b0W5nnFOZlMw4Btcnw="; - }; - - format = "pyproject"; - doCheck = false; - - nativeBuildInputs = [ - poetry-core - ]; - - propagatedBuildInputs = [ - faust-cchardet - chardet - pprp - ]; - - postPatch = '' - substituteInPlace pyproject.toml \ - --replace 'poetry.masonry.api' 'poetry.core.masonry.api' \ - --replace 'poetry>=' 'poetry-core>=' - ''; - }; -} diff --git a/modules/overlays/monique.nix b/modules/overlays/monique.nix deleted file mode 100644 index 8f57531..0000000 --- a/modules/overlays/monique.nix +++ /dev/null @@ -1,28 +0,0 @@ -self: super: with super.python3Packages; { - monique = buildPythonApplication rec { - pname = "monique"; - version = "0.5.0"; - - src = fetchPypi { - inherit pname version; - sha256 = "sha256-fA2mVMjAg1vOpHPJr2B0NtJ00cEs23/Y4S4h3WurpY4="; - }; - - pyproject = true; - build-system = [ setuptools ]; - - nativeBuildInputs = [ - super.wrapGAppsHook4 - super.gobject-introspection - ]; - - buildInputs = [ - super.libadwaita - super.gtk4 - ]; - - propagatedBuildInputs = [ - pygobject3 - ]; - }; -} diff --git a/modules/overlays/pywalfox-native.nix b/modules/overlays/pywalfox-native.nix deleted file mode 100644 index 0fe63b8..0000000 --- a/modules/overlays/pywalfox-native.nix +++ /dev/null @@ -1,16 +0,0 @@ -self: super: with super.python3Packages; { - heybrochecklog = buildPythonApplication rec { - pname = "pywalfox-native"; - version = "2.8.0rc1"; - pyproject = true; - - src = super.fetchurl { - url = "https://test-files.pythonhosted.org/packages/89/a1/8e011e2d325de8e987f7c0a67222448b252fc894634bfa0d3b3728ec6dbf/pywalfox-${version}.tar.gz"; - sha256 = "89e0d7a441eb600933440c713cddbfaecda236bde7f3f655db0ec20b0ae12845"; - }; - - build-system = [ setuptools ]; - - pythonImportsCheck = [ "pywalfox" ]; - }; -} diff --git a/modules/packages.nix b/modules/packages.nix new file mode 100644 index 0000000..0a623f3 --- /dev/null +++ b/modules/packages.nix @@ -0,0 +1,46 @@ +{ + inputs, + ... +}: +{ + imports = [ + inputs.flake-parts.flakeModules.easyOverlay + ]; + + perSystem = + { + config, + system, + pkgs, + ... + }: + let + python-extensions = python-final: python-prev: { + pprp = python-final.callPackage "${inputs.packages}/pprp.nix" { }; + }; + in + { + _module.args.pkgs = import inputs.nixpkgs { + inherit system; + overlays = [ + (final: prev: { + pythonPackagesExtensions = prev.pythonPackagesExtensions ++ [ python-extensions ]; + }) + ]; + }; + packages = { + monique = pkgs.callPackage "${inputs.packages}/monique.nix" { }; + heybrochecklog = pkgs.callPackage "${inputs.packages}/heybrochecklog.nix" { }; + pywalfox-native = pkgs.callPackage "${inputs.packages}/pywalfox-native.nix" { }; + }; + overlayAttrs = { + inherit (config.packages) + monique + heybrochecklog + pywalfox-native + ; + + pythonPackagesExtensions = pkgs.pythonPackagesExtensions ++ [ python-extensions ]; + }; + }; +} diff --git a/modules/parts.nix b/modules/parts.nix new file mode 100644 index 0000000..8abd082 --- /dev/null +++ b/modules/parts.nix @@ -0,0 +1,26 @@ +{ + inputs, + lib, + ... +}: +{ + imports = [ + inputs.flake-parts.flakeModules.modules + ]; + + config = { + # Have to nest `systems` in `config` otherwise flake-parts gets mad for some reason + systems = [ + "aarch64-darwin" + "aarch64-linux" + "x86_64-darwin" + "x86_64-linux" + ]; + }; + + # Enables the *Factory Aspect* + options.flake.factory = lib.mkOption { + type = lib.types.attrsOf lib.types.unspecified; + default = { }; + }; +} diff --git a/modules/profiles/intel.nix b/modules/profiles/intel.nix new file mode 100644 index 0000000..b8abf91 --- /dev/null +++ b/modules/profiles/intel.nix @@ -0,0 +1,23 @@ +{ ... }: +{ + flake.modules.nixos.profiles-intel = + { + pkgs, + ... + }: + { + services.thermald.enable = true; + + hardware.graphics = { + enable = true; + extraPackages = with pkgs; [ + intel-media-driver + intel-ocl + intel-vaapi-driver + vpl-gpu-rt + libvdpau-va-gl + libva-vdpau-driver + ]; + }; + }; +} diff --git a/modules/profiles/nvidia.nix b/modules/profiles/nvidia.nix new file mode 100644 index 0000000..adf185c --- /dev/null +++ b/modules/profiles/nvidia.nix @@ -0,0 +1,45 @@ +{ + flake.modules.nixos.profiles-nvidia = + { + config, + ... + }: + { + # Enable OpenGL + hardware.graphics.enable = true; + + # Load nvidia driver for Xorg and Wayland + services.xserver.videoDrivers = [ "nvidia" ]; + + hardware.nvidia = { + + # Modesetting is required. + modesetting.enable = true; + + # Nvidia power management. Experimental, and can cause sleep/suspend to fail. + # Enable this if you have graphical corruption issues or application crashes after waking + # up from sleep. This fixes it by saving the entire VRAM memory to /tmp/ instead + # of just the bare essentials. + powerManagement.enable = true; + + # Fine-grained power management. Turns off GPU when not in use. + # Experimental and only works on modern Nvidia GPUs (Turing or newer). + powerManagement.finegrained = false; + + # Use the Nvidia open source kernel module (not to be confused with the + # independent third-party "nouveau" open source driver). + # Support is limited to the Turing and later architectures. Full list of + # supported GPUs is at: + # https://github.com/NVIDIA/open-gpu-kernel-modules#compatible-gpus + # Only available from driver 513.43.04+ + open = false; + + # Enable the Nvidia settings menu, + # accessible via `nvidia-settings`. + nvidiaSettings = true; + + # Optionally, you may need to select the appropriate driver version for your specific GPU. + package = config.boot.kernelPackages.nvidiaPackages.stable; + }; + }; +} diff --git a/modules/system/agenix.nix b/modules/system/agenix.nix deleted file mode 100644 index 3bfca35..0000000 --- a/modules/system/agenix.nix +++ /dev/null @@ -1,40 +0,0 @@ -{ - inputs, - config, - pkgs, - lib, - ... -}: -{ - imports = [ - inputs.agenix.nixosModules.default - inputs.agenix-rekey.nixosModules.default - ]; - - environment.systemPackages = [ - # agenix-rekey's CLI tool replaces standard agenix's - inputs.agenix-rekey.packages.${pkgs.stdenv.hostPlatform.system}.default - ]; - - age = { - # Need to explicitly set identity paths because OpenSSH daemon is disabled - # but the host keys are still generated via services.openssh.generateHostKeys = true - identityPaths = map (key: key.path) config.services.openssh.hostKeys; - rekey = { - masterIdentities = [ "${inputs.self}/secrets/age-yubikey-identity-d9ed335b.pub" ]; - storageMode = "local"; - localStorageDir = ../../. + "/secrets/rekeyed/${config.host.name}"; - } - # We only set the hostPubkey if one is supplied. For new hosts the pub key will not - # exist until it is generated after the first rebuild. Runtime decryption will fail - # but then the ssh host key will be generated in /etc/ssh and can be supplied - // lib.optionalAttrs (config.host.pubKey != null) { - hostPubkey = config.host.pubKey; - }; - secrets = { - tailscale-auth.rekeyFile = ../../secrets/tailscale-auth.age; - eclypsecloud-eclypse.rekeyFile = ../../secrets/eclypsecloud-eclypse.age; - eclypse-password.rekeyFile = ../../secrets/eclypse-password.age; - }; - }; -} diff --git a/modules/system/base.nix b/modules/system/base.nix new file mode 100644 index 0000000..728deba --- /dev/null +++ b/modules/system/base.nix @@ -0,0 +1,38 @@ +{ + self, + ... +}: +{ + flake.modules.nixos.base = + { pkgs, ... }: + { + imports = with self.modules.nixos; [ + agenix + bluetooth + boot + firmware + network + nix + pipewire + power-management + printing + tailscale + wayland + yubikey + zsh + ]; + + programs.gdk-pixbuf.modulePackages = [ pkgs.librsvg ]; + + environment = { + systemPackages = with pkgs; [ + vim + git + disktui + ]; + variables = { + EDITOR = "vim"; + }; + }; + }; +} diff --git a/modules/system/boot.nix b/modules/system/boot.nix deleted file mode 100644 index 6aff1c7..0000000 --- a/modules/system/boot.nix +++ /dev/null @@ -1,19 +0,0 @@ -{ - config, - ... -}: -{ - boot = { - extraModulePackages = with config.boot.kernelPackages; [ virtualbox ]; - loader = { - systemd-boot = { - enable = true; - configurationLimit = 10; - }; - efi.canTouchEfiVariables = true; - }; - kernelParams = [ - "kvm.enable_virt_at_load=0" # Fixes some virtuallization issues - ]; - }; -} diff --git a/modules/system/default.nix b/modules/system/default.nix deleted file mode 100644 index c7078c9..0000000 --- a/modules/system/default.nix +++ /dev/null @@ -1,16 +0,0 @@ -{ - imports = [ - ./agenix.nix - ./boot.nix - ./desktop.nix - ./fileSystems.nix - ./network.nix - ./packages.nix - ./security.nix - ./services.nix - ./system.nix - ./tailscale.nix - ./user.nix - ./virtualisation.nix - ]; -} diff --git a/modules/system/desktop.nix b/modules/system/desktop.nix deleted file mode 100644 index 64bae22..0000000 --- a/modules/system/desktop.nix +++ /dev/null @@ -1,39 +0,0 @@ -{ - inputs, - pkgs, - ... -}: -{ - imports = [ - inputs.niri.nixosModules.niri - ]; - - programs = { - niri = { - enable = true; - package = pkgs.niri-unstable; - }; - uwsm = { - enable = true; - waylandCompositors = { - niri = { - prettyName = "Niri"; - binPath = "/run/current-system/sw/bin/niri-session"; - }; - }; - }; - }; - - environment.systemPackages = [ pkgs.xwayland-satellite-unstable ]; - - nixpkgs.overlays = [ - inputs.niri.overlays.niri - ]; - - services.displayManager = { - gdm = { - enable = true; - wayland = true; - }; - }; -} diff --git a/modules/system/fileSystems.nix b/modules/system/fileSystems.nix deleted file mode 100644 index 6abd043..0000000 --- a/modules/system/fileSystems.nix +++ /dev/null @@ -1,44 +0,0 @@ -{ - pkgs, - config, - ... -}: -let - automount_opts = [ - "x-systemd.automount" - "x-systemd.idle-timeout=60" - "x-systemd.device-timeout=5s" - "x-systemd.mount-timeout=5s" - "noauto" - "user" - "users" - ]; -in -{ - fileSystems = { - "/mnt/EclypseCloud" = { - device = "//100.78.212.35/EclypseCloud"; - fsType = "cifs"; - options = [ - "credentials=${config.age.secrets.eclypsecloud-eclypse.path}" - "uid=${toString config.users.users.eclypse.uid}" - "rw" - ] - ++ automount_opts; - }; - "/mnt/Music" = { - device = "//100.78.212.35/music"; - fsType = "cifs"; - options = [ - "credentials=${config.age.secrets.eclypsecloud-eclypse.path}" - "uid=${toString config.users.users.eclypse.uid}" - "rw" - ] - ++ automount_opts; - }; - }; - - environment.systemPackages = with pkgs; [ - cifs-utils - ]; -} diff --git a/modules/system/network.nix b/modules/system/network.nix deleted file mode 100644 index 789e26c..0000000 --- a/modules/system/network.nix +++ /dev/null @@ -1,23 +0,0 @@ -{ - config, - ... -}: -{ - networking = { - hostName = "${config.host.name}"; # Define your hostname - - # Pick only one of the below networking options. - # wireless.enable = true; # Enables wireless support via wpa_supplicant. - networkmanager.enable = true; # Easiest to use and most distros use this by default. - - # Configure network proxy if necessary - # proxy.default = "http://user:password@proxy:port/"; - # proxy.noProxy = "127.0.0.1,localhost,internal.domain"; - - # Open ports in the firewall. - # firewall.allowedTCPPorts = [ ... ]; - # firewall.allowedUDPPorts = [ ... ]; - # Or disable the firewall altogether. - # firewall.enable = false; - }; -} diff --git a/modules/system/packages.nix b/modules/system/packages.nix deleted file mode 100644 index cf0ba18..0000000 --- a/modules/system/packages.nix +++ /dev/null @@ -1,48 +0,0 @@ -{ - inputs, - pkgs, - ... -}: -{ - imports = [ - inputs.nur.modules.nixos.default # Adds the NUR overlay - ../overlays - ]; - - programs = { - # Some programs need SUID wrappers, can be configured further or are - # started in user sessions. - # mtr.enable = true; - # gnupg.agent = { - # enable = true; - # enableSSHSupport = true; - # }; - gdk-pixbuf.modulePackages = [ pkgs.librsvg ]; - nix-ld.enable = true; - xwayland.enable = true; - zsh.enable = true; - }; - - nixpkgs = { - # ? For some reason, doing config.allowUnfree does not work - # ? Maybe becuase it's not an explicit option? - # ? https://search.nixos.org/options?channel=25.05&show=nixpkgs.config&query=nixpkgs.config - config = { - allowUnfree = true; - }; - }; - - # List packages installed in system profile. To search, run: - # $ nix search wget - environment = { - pathsToLink = [ "/share/zsh" ]; - systemPackages = with pkgs; [ - vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default. - git - disktui - ]; - variables = { - EDITOR = "vim"; - }; - }; -} diff --git a/modules/system/security.nix b/modules/system/security.nix deleted file mode 100644 index 318a79a..0000000 --- a/modules/system/security.nix +++ /dev/null @@ -1,22 +0,0 @@ -{ - pkgs, - ... -}: -{ - programs = { - yubikey-manager.enable = true; - yubikey-touch-detector.enable = true; - }; - - environment.systemPackages = with pkgs; [ - age-plugin-yubikey - ]; - - services = { - yubikey-agent.enable = true; - }; - - security = { - rtkit.enable = true; - }; -} diff --git a/modules/system/services.nix b/modules/system/services.nix deleted file mode 100644 index a75981a..0000000 --- a/modules/system/services.nix +++ /dev/null @@ -1,104 +0,0 @@ -{ - pkgs, - ... -}: -{ - services = { - xserver = { - # Enable the X11 windowing system. - # You can disable this if you're only using the Wayland session. - enable = false; - - # Configure keymap in X11 - xkb = { - layout = "us"; - variant = ""; - }; - }; - - # Enable touchpad support (enabled default in most desktopManager). - libinput.enable = true; - - # Enable CUPS to print documents. - printing = { - enable = true; - drivers = with pkgs; [ - gutenprint - cnijfilter2 - ]; - }; - - avahi = { - enable = true; - nssmdns4 = true; - openFirewall = true; - }; - - # Enable sound with pipewire. - pulseaudio.enable = false; - pipewire = { - enable = true; - alsa.enable = true; - alsa.support32Bit = true; - pulse.enable = true; - # If you want to use JACK applications, uncomment this - # jack.enable = true; - - # use the example session manager (no others are packaged yet so this is enabled by default, - # no need to redefine it in your config for now) - # media-session.enable = true; - }; - - upower.enable = true; - - # Disable SSH daemon but generate host keys anyway for secret rekeying - openssh = { - enable = false; - generateHostKeys = true; - }; - - system76-scheduler.settings.cfsProfiles.enable = true; - - tlp = { - enable = true; - settings = { - CPU_BOOST_ON_AC = 1; - CPU_BOOST_ON_BAT = 0; - CPU_SCALING_GOVERNOR_ON_AC = "performance"; - CPU_SCALING_GOVERNOR_ON_BAT = "powersave"; - PLATFORM_PROFILE_ON_AC = "performance"; - PLATFORM_PROFILE_ON_BAT = "balanced"; - START_CHARGE_THRESH_BAT1 = 65; # Only STOP_CHARGE_THRESH available on Framework - STOP_CHARGE_THRESH_BAT1 = 80; - # Fixes stuttering Hyprland animations on Intel iGPU (https://wiki.hypr.land/Configuring/Performance/) - INTEL_GPU_MIN_FREQ_ON_AC = 300; - INTEL_GPU_MIN_FREQ_ON_BAT = 300; - }; - }; - - # Disable GNOME's power management (conflicts with TLP) - power-profiles-daemon.enable = false; - - # Enable thermald (only necessary for Intel CPUs) - thermald.enable = true; - - fwupd.enable = true; - - fprintd.enable = true; - }; - - powerManagement = { - enable = true; - powertop.enable = true; - }; - - hardware = { - bluetooth = { - enable = true; - powerOnBoot = false; - }; - sane = { - enable = true; - }; - }; -} diff --git a/modules/system/system.nix b/modules/system/system.nix deleted file mode 100644 index 70d3add..0000000 --- a/modules/system/system.nix +++ /dev/null @@ -1,74 +0,0 @@ -{ - inputs, - ... -}: -{ - nix = { - nixPath = [ "nixpkgs=${inputs.nixpkgs}" ]; - settings = { - experimental-features = [ - "nix-command" - "flakes" - ]; - substituters = [ - "https://cache.nixos.org" - "https://nix-community.cachix.org" - "https://devenv.cachix.org" - "https://hyprland.cachix.org" - ]; - trusted-public-keys = [ - "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" - "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" - "devenv.cachix.org-1:w1cLUi8dv3hnoSPGAuibQv+f9TZLr6cv/Hm9XgU50cw=" - "hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc=" - ]; - extra-substituters = [ "https://vicinae.cachix.org" ]; - extra-trusted-public-keys = [ "vicinae.cachix.org-1:1kDrfienkGHPYbkpNj1mWTr7Fm1+zcenzgTizIcI3oc=" ]; - }; - }; - - # Set your time zone. - time.timeZone = "America/New_York"; - - # Select internationalisation properties. - i18n = { - defaultLocale = "en_US.UTF-8"; - extraLocaleSettings = { - LC_ADDRESS = "en_US.UTF-8"; - LC_IDENTIFICATION = "en_US.UTF-8"; - LC_MEASUREMENT = "en_US.UTF-8"; - LC_MONETARY = "en_US.UTF-8"; - LC_NAME = "en_US.UTF-8"; - LC_NUMERIC = "en_US.UTF-8"; - LC_PAPER = "en_US.UTF-8"; - LC_TELEPHONE = "en_US.UTF-8"; - LC_TIME = "en_US.UTF-8"; - }; - }; - - # Select internationalisation properties. - # console = { - # font = "Lat2-Terminus16"; - # keyMap = "us"; - # useXkbConfig = true; # use xkb.options in tty. - # }; - - # This option defines the first version of NixOS you have installed on this particular machine, - # and is used to maintain compatibility with application data (e.g. databases) created on older NixOS versions. - # - # Most users should NEVER change this value after the initial install, for any reason, - # even if you've upgraded your system to a new NixOS release. - # - # This value does NOT affect the Nixpkgs version your packages and OS are pulled from, - # so changing it will NOT upgrade your system - see https://nixos.org/manual/nixos/stable/#sec-upgrading for how - # to actually do that. - # - # This value being lower than the current NixOS release does NOT mean your system is - # out of date, out of support, or vulnerable. - # - # Do NOT change this value unless you have manually inspected all the changes it would make to your configuration, - # and migrated your data accordingly. - # - # For more information, see `man configuration.nix` or https://nixos.org/manual/nixos/stable/options#opt-system.stateVersion . - system.stateVersion = "25.05"; # Did you read the comment? -} diff --git a/modules/system/tailscale.nix b/modules/system/tailscale.nix deleted file mode 100644 index c16bad6..0000000 --- a/modules/system/tailscale.nix +++ /dev/null @@ -1,31 +0,0 @@ -{ - config, - pkgs, - ... -}: -{ - services.tailscale = { - enable = true; - useRoutingFeatures = "client"; - authKeyFile = config.age.secrets.tailscale-auth.path; - - # * Only applied if `authKeyFile` is specified - extraUpFlags = [ - "--ssh" - "--accept-routes=true" - ]; - extraSetFlags = [ - "--operator=eclypse" - ]; - }; - - # Taildrop - systemd.user.services.taildrop = { - description = "Taildrop File Receiver Service"; - wantedBy = [ "default.target" ]; - serviceConfig = { - Type = "simple"; - ExecStart = "${pkgs.tailscale}/bin/tailscale file get --verbose --loop %h/Downloads/"; - }; - }; -} diff --git a/modules/system/user.nix b/modules/system/user.nix deleted file mode 100644 index aa8b687..0000000 --- a/modules/system/user.nix +++ /dev/null @@ -1,43 +0,0 @@ -{ - inputs, - pkgs, - config, - ... -}: -{ - imports = [ inputs.home-manager.nixosModules.home-manager ]; - - home-manager = { - useUserPackages = true; - useGlobalPkgs = true; - extraSpecialArgs = { inherit inputs; }; - - users.eclypse = { - imports = [ ../home ]; - home = { - username = "eclypse"; - homeDirectory = "/home/eclypse"; - stateVersion = "25.05"; - }; - programs.home-manager.enable = true; - }; - - backupFileExtension = "backup"; - }; - - users.mutableUsers = false; - users.users.eclypse = { - isNormalUser = true; - uid = 1000; - description = "Eclypse"; - extraGroups = [ - "networkmanager" - "wheel" - "scanner" - "lp" - "dialout" - ]; - hashedPasswordFile = config.age.secrets.eclypse-password.path; - shell = pkgs.zsh; - }; -} diff --git a/modules/system/virtualisation.nix b/modules/system/virtualisation.nix deleted file mode 100644 index bb10a6b..0000000 --- a/modules/system/virtualisation.nix +++ /dev/null @@ -1,19 +0,0 @@ -{ - pkgs, - ... -}: -{ - virtualisation = { - # virtualbox.host = { - # enable = true; - # enableExtensionPack = true; - # }; - podman.enable = true; - }; - - environment.systemPackages = with pkgs; [ - distrobox - ]; - - users.extraGroups.vboxusers.members = [ "eclypse" ]; -} diff --git a/modules/users/eclypse.nix b/modules/users/eclypse.nix new file mode 100644 index 0000000..55170ad --- /dev/null +++ b/modules/users/eclypse.nix @@ -0,0 +1,93 @@ +{ + self, + inputs, + ... +}: +let + username = "eclypse"; +in +{ + flake.modules.nixos.${username} = + { config, pkgs, ... }: + { + users.mutableUsers = false; + users.users.${username} = { + isNormalUser = true; + uid = 1000; + description = "Eclypse"; + extraGroups = [ + "networkmanager" + "wheel" + "scanner" + "lp" + "dialout" + ]; + hashedPasswordFile = config.age.secrets.eclypse-password.path; + shell = pkgs.zsh; + }; + + age.secrets.eclypse-password.rekeyFile = "${inputs.secrets}/eclypse-password.age"; + + home-manager.users.${username} = { + imports = [ self.modules.homeManager.${username} ]; + }; + }; + + flake.modules.homeManager.${username} = + { pkgs, ... }: + { + imports = with self.modules.homeManager; [ + inputs.nix-jmu-cs345.homeManagerModules.bernstdh + direnv + fastfetch + firefox + foot + fzf + git + helix + kanshi + niri + noctalia + ssh + starship + stylix + swappy + vesktop + vicinae + xdg + yazi + zed + zellij + zoxide + zsh + ]; + + home = { + inherit username; + homeDirectory = "/home/${username}"; + stateVersion = "25.05"; + }; + + programs.home-manager.enable = true; + programs.nix-jmu-cs345.enable = true; + + home.packages = with pkgs; [ + devenv + htop + obsidian + upscayl + trayscale + nautilus + + # CD Stuff + picard + heybrochecklog + rsgain + + playerctl + brightnessctl + monique + opencode + ]; + }; +} diff --git a/modules/users/home-manager.nix b/modules/users/home-manager.nix new file mode 100644 index 0000000..7d834e8 --- /dev/null +++ b/modules/users/home-manager.nix @@ -0,0 +1,15 @@ +{ + inputs, + ... +}: +{ + flake.modules.nixos.home-manager = { + imports = [ inputs.home-manager.nixosModules.home-manager ]; + + home-manager = { + useUserPackages = true; + useGlobalPkgs = true; + backupFileExtension = "backup"; + }; + }; +} diff --git a/packages/heybrochecklog.nix b/packages/heybrochecklog.nix new file mode 100644 index 0000000..fac199d --- /dev/null +++ b/packages/heybrochecklog.nix @@ -0,0 +1,44 @@ +{ + lib, + python3Packages, + fetchFromGitHub, + ... +}: +with python3Packages; + +buildPythonApplication rec { + pname = "heybrochecklog"; + version = "v1.4.7"; + + src = fetchFromGitHub { + owner = "doujincafe"; + repo = "hbcl"; + rev = version; + sha256 = "sha256-LB2Xn6oS3iBL/+1vMRuj0cmRc9tRiCjgJ5axm4tYkdg="; + }; + + format = "pyproject"; + doCheck = false; + + nativeBuildInputs = [ + poetry-core + ]; + + propagatedBuildInputs = [ + faust-cchardet + chardet + pprp # Comes from the overlay, not part of nixpkgs + ]; + + postPatch = '' + substituteInPlace pyproject.toml \ + --replace 'poetry.masonry.api' 'poetry.core.masonry.api' \ + --replace 'poetry>=' 'poetry-core>=' + ''; + + meta = { + description = "A doujin café discord community maintained log checker"; + homepage = "https://github.com/doujincafe/hbcl"; + license = lib.licenses.asl20; + }; +} diff --git a/packages/monique.nix b/packages/monique.nix new file mode 100644 index 0000000..cd335b3 --- /dev/null +++ b/packages/monique.nix @@ -0,0 +1,45 @@ +{ + lib, + python3Packages, + fetchPypi, + libadwaita, + gtk4, + wrapGAppsHook4, + gobject-introspection, + ... +}: +with python3Packages; + +buildPythonApplication rec { + pname = "monique"; + version = "0.5.0"; + + src = fetchPypi { + inherit pname version; + sha256 = "sha256-fA2mVMjAg1vOpHPJr2B0NtJ00cEs23/Y4S4h3WurpY4="; + }; + + pyproject = true; + build-system = [ setuptools ]; + + nativeBuildInputs = [ + wrapGAppsHook4 + gobject-introspection + ]; + + buildInputs = [ + libadwaita + gtk4 + ]; + + propagatedBuildInputs = [ + pygobject3 + ]; + + meta = { + description = "Graphical monitor configurator for Hyprland and Sway"; + homepage = "https://github.com/ToRvaLDz/monique"; + license = lib.licenses.gpl3; + platforms = lib.platforms.linux; + }; +} diff --git a/packages/pprp.nix b/packages/pprp.nix new file mode 100644 index 0000000..6f8da50 --- /dev/null +++ b/packages/pprp.nix @@ -0,0 +1,27 @@ +{ + lib, + buildPythonPackage, + fetchPypi, + ... +}: + +buildPythonPackage rec { + pname = "pprp"; + version = "0.2.7"; + + src = fetchPypi { + inherit pname version; + sha256 = "sha256-2ednecxSsJONvH9XJ6GV3ExgdcPrUEAlYRpZt2Nrkw0="; + }; + + format = "setuptools"; + doCheck = false; + + pythonImportsCheck = [ "pprp" ]; + + meta = { + description = "A pure-Python Rijndael (AES) and PBKDF2 library"; + homepage = "https://github.com/dsoprea/RijndaelPbkdf"; + license = lib.licenses.gpl2; + }; +} diff --git a/packages/pywalfox-native.nix b/packages/pywalfox-native.nix new file mode 100644 index 0000000..64e00f0 --- /dev/null +++ b/packages/pywalfox-native.nix @@ -0,0 +1,28 @@ +{ + lib, + python3Packages, + fetchurl, + ... +}: +with python3Packages; + +buildPythonApplication rec { + pname = "pywalfox-native"; + version = "2.8.0rc1"; + pyproject = true; + + src = fetchurl { + url = "https://test-files.pythonhosted.org/packages/89/a1/8e011e2d325de8e987f7c0a67222448b252fc894634bfa0d3b3728ec6dbf/pywalfox-${version}.tar.gz"; + sha256 = "sha256-ieDXpEHrYAkzRAxxPN2/rs2iNr3n8/ZV2w7CCwrhKEU="; + }; + + build-system = [ setuptools ]; + + pythonImportsCheck = [ "pywalfox" ]; + + meta = { + description = " Native app used alongside the Pywalfox addon"; + homepage = "https://github.com/Frewacom/pywalfox-native"; + license = lib.licenses.mpl20; + }; +} diff --git a/profiles/intel.nix b/profiles/intel.nix deleted file mode 100644 index 0f6e3c6..0000000 --- a/profiles/intel.nix +++ /dev/null @@ -1,17 +0,0 @@ -{ - pkgs, - ... -}: -{ - hardware.graphics = { - enable = true; - extraPackages = with pkgs; [ - intel-media-driver - intel-ocl - intel-vaapi-driver - vpl-gpu-rt - libvdpau-va-gl - libva-vdpau-driver - ]; - }; -} diff --git a/profiles/nvidia.nix b/profiles/nvidia.nix deleted file mode 100644 index e605917..0000000 --- a/profiles/nvidia.nix +++ /dev/null @@ -1,42 +0,0 @@ -{ - config, - ... -}: -{ - # Enable OpenGL - hardware.graphics.enable = true; - - # Load nvidia driver for Xorg and Wayland - services.xserver.videoDrivers = [ "nvidia" ]; - - hardware.nvidia = { - - # Modesetting is required. - modesetting.enable = true; - - # Nvidia power management. Experimental, and can cause sleep/suspend to fail. - # Enable this if you have graphical corruption issues or application crashes after waking - # up from sleep. This fixes it by saving the entire VRAM memory to /tmp/ instead - # of just the bare essentials. - powerManagement.enable = true; - - # Fine-grained power management. Turns off GPU when not in use. - # Experimental and only works on modern Nvidia GPUs (Turing or newer). - powerManagement.finegrained = false; - - # Use the Nvidia open source kernel module (not to be confused with the - # independent third-party "nouveau" open source driver). - # Support is limited to the Turing and later architectures. Full list of - # supported GPUs is at: - # https://github.com/NVIDIA/open-gpu-kernel-modules#compatible-gpus - # Only available from driver 513.43.04+ - open = false; - - # Enable the Nvidia settings menu, - # accessible via `nvidia-settings`. - nvidiaSettings = true; - - # Optionally, you may need to select the appropriate driver version for your specific GPU. - package = config.boot.kernelPackages.nvidiaPackages.stable; - }; -}