diff --git a/.gitattributes b/.gitattributes index 8aafc71a..c028012f 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1 +1 @@ -extras/secrets.nix filter=git-crypt diff=git-crypt +variables/secrets/** filter=git-crypt diff=git-crypt diff --git a/README.md b/README.md index 6632f76c..25610e86 100644 --- a/README.md +++ b/README.md @@ -1,33 +1,39 @@ -## My Nix files, now organized in a flake. +## Jimbo's Nix Systems -Thanks for taking a look at my Nix* configs! -While this is primarily organized for my use only, you may find each individual service file or user config to be a good starting point, or something to take and adapt into your own config. +Thanks for taking a look at my Nix* flake! +While this is primarily organized for my own use, you may find each individual service or config useful to read, reference, learn from, and adapt for your own systems. ### Installation -Installing any of my flakes onto a system should be done after any initial install. I would opt to do a minimal install, but this is up to you. -After installing NixOS, backup your hardware-config.nix file, so you can adapt it to fit the format of ``nixos/hardware/machines``, then adjusting the other referenced files in the flake.nix file to reference your specific computer. +Installing this flake is best done from an existing system. A minimal install is fastest, but is up to you. After installing NixOS, backup your hardware-config.nix file, and adapt it to fit the format of ``/hosts``, adjusting for your specific system. -An initial install will have to be ran as ``nixos-rebuild switch --flake /etc/nixos/.#HOSTNAME``, where HOSTNAME is a hostname defined in your flake. You may also have to enable "experimental" features with a flag, such as nix-command and flakes. -Home-Manager is handled separately, despite being in the same folder. A rebuild of a user's home would have to be done with ``home-manager switch --flake /etc/nixos``. This will pull the config as defined in the flake as ``USER@HOSTNAME``, where USER is the user running the ``home-manager`` command. +An initial install will can be done with ``nixos-rebuild switch --flake /etc/nixos/.#host``, where ``host`` is a hostname defined in this flake. You may also have to enable "experimental" features with a flag, such as nix-command and flakes. + +Home-Manager is handled separately from the system, despite being in the same folder. A rebuild of a user's home is done with ``home-manager switch --flake /etc/nixos/.#user@host``, as defined under ``homeConfigurations`` in the flake. ### Usage My config uses these tools: -Sway - Window manager / Desktop -Foot - Terminal emulator -Rofi - App launcher and menu system -ZSH - Primary shell +``Sway`` - Window manager / Desktop +``ZSH`` - Primary shell +``Foot`` - Terminal emulator +``Rofi`` - App launcher and menu system -I have made shell aliases in ZSH for rebuilding the system. They are as follows: +I have defined shell aliases in ZSH for rebuilding different parts of Nix, they are as follows: `flakedate` - Update the flake.lock, which renews the sources of nixpkgs. This is needed to update the system. `sysswitch` - Switch the system profile. `homeswitch` = Switch the user's home-manager profile. -`nixswitch` = Switch to new config for both user and system. +`nixswitch` = Switch both user and system profile. `nixdate` = Same as before, but updating flake.nix before doing so. This is essentially a full system update. -My config heavily references a gnupg-protected secrets file. These will have to be adapted and rewritten if anyone is to use my config for themselves. +My server's config heavily references a git-crypt protected secrets file. These will have to be adapted and rewritten if anyone is to use my config directly. For my use, unlocking secrets can be done with this command: ``gpg --pinentry-mode loopback --decrypt local.key.asc | git-crypt unlock -`` +### Credits +Without the help of heavy inspiration, I would not have been able to learn and get up and running nearly as quickly. My most heavily borrowed configs are as follows: +[CloudyChris' nix-starter-configs fork](https://github.com/CloudyChris/NixOsConfig), the very initial base of my conversion to flakes. +[WillPower3309's personal flake](https://github.com/WillPower3309/nixos-config) for being a pleasure in the SwayFX Discord and having a really nice flake.nix file I borrowed from. +[Jules Sommer's minimal flake](https://github.com/WillPower3309/swayfx) for giving me a good basis for writing individual files and repeatedly helping me throughout the entire process. + Made with love ❤️ ![image](./preview.png) diff --git a/extras/cmd.nix b/extras/cmd.nix deleted file mode 100644 index a407dca8..00000000 --- a/extras/cmd.nix +++ /dev/null @@ -1,4 +0,0 @@ -{ - auth = "doas"; - nixcfg = "ranger /etc/nixos"; -} diff --git a/extras/displays.nix b/extras/displays.nix deleted file mode 100644 index b111d6b2..00000000 --- a/extras/displays.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ - d1 = "DP-3"; - d2 = "DP-1"; - d3 = "DP-2"; - dI = "eDP-1"; -} diff --git a/extras/ips.nix b/extras/ips.nix deleted file mode 100644 index 0d30dfec..00000000 --- a/extras/ips.nix +++ /dev/null @@ -1,11 +0,0 @@ -rec { - netInt = "eno1"; - localSpan = "10.0.0"; - server = "${localSpan}.2"; - pc = "${localSpan}.3"; - vm = "${localSpan}.4"; - hx = "${localSpan}.70"; - - wgInt = "wg0"; - wgSpan = "10.100.0"; -} diff --git a/extras/look.nix b/extras/look.nix deleted file mode 100644 index 0a2dad55..00000000 --- a/extras/look.nix +++ /dev/null @@ -1,21 +0,0 @@ -{ - colors = { - prime = ''3823C4''; #3823C4 - accent = ''1B1F59''; #1B1F59 - split = ''555B9E''; #555B9E - actSplit = ''5980B7''; #5980B7 - dark = ''101419''; #101419 - mid = ''171C23''; #171C23 - light = ''272b33''; #272B33 - urgent = ''C43823''; #C43823 - text = ''C7D3E3''; #C7D3E3 - }; - fonts = { - main = ''Ubuntu''; - nerd = ''UbuntuMono Nerd Font''; - }; - border = rec { - int = 3; - string = toString int; - }; -} diff --git a/extras/overlays.nix b/extras/overlays.nix deleted file mode 100644 index fe3e0196..00000000 --- a/extras/overlays.nix +++ /dev/null @@ -1,17 +0,0 @@ -{inputs, ...}: { - # This one brings our custom packages from the 'pkgs' directory - additions = final: _prev: import ./pkgs {pkgs = final;}; - - selfsuper = (self: super: { - mpv = super.mpv.override { - scripts = with self.mpvScripts; [mpris sponsorblock thumbnail]; - }; - }); - - finalprev = (final: prev: { - unstable = import inputs.unstable { - system = final.system; - config.allowUnfree = true; - }; - }); -} diff --git a/extras/pkgs/default.nix b/extras/pkgs/default.nix deleted file mode 100644 index 3e3edab2..00000000 --- a/extras/pkgs/default.nix +++ /dev/null @@ -1,5 +0,0 @@ -# Custom packages, that can be defined similarly to nixpkgs -{pkgs, ...}: { - xash3d = pkgs.callPackage ./xash/xash3d.nix {}; - hlsdk = pkgs.callPackage ./xash/hlsdk.nix {}; -} diff --git a/extras/secrets-template.nix b/extras/secrets-template.nix deleted file mode 100644 index e1023319..00000000 --- a/extras/secrets-template.nix +++ /dev/null @@ -1,72 +0,0 @@ -{ - # Define domains - jimDomain = ""; - - # User account passwords, generated with 'mkpasswd -m sha-512' - jimboAccPass = ""; - - # External emails - jimUsername = ""; - jimEmail = ""; - - # SSH Keys - jimKeys = [ - "" - "" - ]; - - # System timezone in standard timezone identifier format - timeZone = ""; - - # Cloudflare API key - flareApiKey = ""; - - # Wireguard keys, generated with the wg command - wgServerPriv = ""; - wgServerPub = ""; - wgClientPriv = ""; - wgClientPub = ""; - wgPixel9Pub = ""; - wgOraclePub = ""; - - # Icecast, plaintext - castAdminPass = ""; - castSourcePass = ""; - - # Photoprism, plaintext - prismAdminPass = ""; - - # Matrix secrets - matrixSecret = ""; - discordBotID = ""; - discordBotToken = ""; - - # Pixelfed secret, must be 32 characters long - pixelfedKey = '' - APP_KEY= - ''; - - # Transmission credentials, plaintext - transmissionCredFile = '' - { - "rpc-username": "", - "rpc-password": "" - } - ''; - - # Email cleartext passwords - noreplyPassword = ""; - - # Email account hashes, generated with 'mkpasswd -m bcrypt' - noreplyMailHash = ""; - jimboMailHash = ""; - lunaMailHash = ""; - freecornMailHash = ""; - tinyMailHash = ""; - - # IPs - jimIP1 = ""; - jimIP2 = ""; - lunaIP = ""; - cornIP = ""; -} diff --git a/extras/secrets.nix b/extras/secrets.nix deleted file mode 100644 index 431f37f5..00000000 Binary files a/extras/secrets.nix and /dev/null differ diff --git a/extras/workspaces.nix b/extras/workspaces.nix deleted file mode 100644 index 4615a494..00000000 --- a/extras/workspaces.nix +++ /dev/null @@ -1,21 +0,0 @@ -{ - w0 = ''0:0''; - w1 = ''1:1''; - w2 = ''2:2''; - w3 = ''3:3''; - w4 = ''4:4''; - w5 = ''5:5''; - w6 = ''6:6''; - w7 = ''7:7''; - w8 = ''8:8''; - w9 = ''9:9''; - w1a = ''11:I''; - w2a = ''22:II''; - w3a = ''33:III''; - w4a = ''44:IV''; - w5a = ''55:V''; - w6a = ''66:VI''; - w7a = ''77:VII''; - w8a = ''88:VIII''; - w9a = ''99:IX''; -} diff --git a/flake.lock b/flake.lock index 2c9a6df4..418f8b01 100644 --- a/flake.lock +++ b/flake.lock @@ -33,6 +33,30 @@ "type": "gitlab" } }, + "chaotic": { + "inputs": { + "flake-schemas": "flake-schemas", + "home-manager": "home-manager", + "jovian": "jovian", + "nixpkgs": [ + "unstable" + ] + }, + "locked": { + "lastModified": 1729510449, + "narHash": "sha256-/EwjBMYBZ3/2ROT+4M/6tLomgJEgZBpKosWhqtYZkDI=", + "owner": "chaotic-cx", + "repo": "nyx", + "rev": "4e03e8d762623ca925c604800aa18f109cd3bd97", + "type": "github" + }, + "original": { + "owner": "chaotic-cx", + "ref": "nyxpkgs-unstable", + "repo": "nyx", + "type": "github" + } + }, "crane": { "inputs": { "nixpkgs": [ @@ -123,6 +147,20 @@ "type": "github" } }, + "flake-schemas": { + "locked": { + "lastModified": 1721999734, + "narHash": "sha256-G5CxYeJVm4lcEtaO87LKzOsVnWeTcHGKbKxNamNWgOw=", + "rev": "0a5c42297d870156d9c57d8f99e476b738dcd982", + "revCount": 75, + "type": "tarball", + "url": "https://api.flakehub.com/f/pinned/DeterminateSystems/flake-schemas/0.1.5/0190ef2f-61e0-794b-ba14-e82f225e55e6/source.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://flakehub.com/f/DeterminateSystems/flake-schemas/%3D0.1.5.tar.gz" + } + }, "flake-utils": { "inputs": { "systems": "systems" @@ -198,6 +236,27 @@ } }, "home-manager": { + "inputs": { + "nixpkgs": [ + "chaotic", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1729414726, + "narHash": "sha256-Dtmm1OU8Ymiy9hVWn/a2B8DhRYo9Eoyx9veERdOBR4o=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "fe56302339bb28e3471632379d733547caec8103", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "home-manager", + "type": "github" + } + }, + "home-manager_2": { "inputs": { "nixpkgs": [ "nixpkgs" @@ -218,6 +277,28 @@ "type": "github" } }, + "jovian": { + "inputs": { + "nix-github-actions": "nix-github-actions", + "nixpkgs": [ + "chaotic", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1729177642, + "narHash": "sha256-DdKal+ZhB9QD/tnEwFg4cZ4j4YnrkvSljBxnyG+3eE0=", + "owner": "Jovian-Experiments", + "repo": "Jovian-NixOS", + "rev": "bb69165ff372ddbd3228a03513922acd783040e8", + "type": "github" + }, + "original": { + "owner": "Jovian-Experiments", + "repo": "Jovian-NixOS", + "type": "github" + } + }, "lanzaboote": { "inputs": { "crane": "crane", @@ -288,6 +369,29 @@ "type": "github" } }, + "nix-github-actions": { + "inputs": { + "nixpkgs": [ + "chaotic", + "jovian", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1690328911, + "narHash": "sha256-fxtExYk+aGf2YbjeWQ8JY9/n9dwuEt+ma1eUFzF8Jeo=", + "owner": "zhaofengli", + "repo": "nix-github-actions", + "rev": "96df4a39c52f53cb7098b923224d8ce941b64747", + "type": "github" + }, + "original": { + "owner": "zhaofengli", + "ref": "matrix-name", + "repo": "nix-github-actions", + "type": "github" + } + }, "nixpkgs": { "locked": { "lastModified": 1722221733, @@ -366,18 +470,17 @@ }, "nixpkgs_4": { "locked": { - "lastModified": 1727540905, - "narHash": "sha256-40J9tW7Y794J7Uw4GwcAKlMxlX2xISBl6IBigo83ih8=", - "owner": "nixos", + "lastModified": 1728740863, + "narHash": "sha256-u+rxA79a0lyhG+u+oPBRtTDtzz8kvkc9a6SWSt9ekVc=", + "owner": "NixOS", "repo": "nixpkgs", - "rev": "fbca5e745367ae7632731639de5c21f29c8744ed", + "rev": "a3f9ad65a0bf298ed5847629a57808b97e6e8077", "type": "github" }, "original": { - "owner": "nixos", + "id": "nixpkgs", "ref": "nixos-24.05", - "repo": "nixpkgs", - "type": "github" + "type": "indirect" } }, "nur": { @@ -425,8 +528,9 @@ "root": { "inputs": { "blender-bin": "blender-bin", + "chaotic": "chaotic", "hardware": "hardware", - "home-manager": "home-manager", + "home-manager": "home-manager_2", "lanzaboote": "lanzaboote", "mailserver": "mailserver", "minecraft": "minecraft", @@ -509,16 +613,15 @@ "locked": { "lastModified": 1728492678, "narHash": "sha256-9UTxR8eukdg+XZeHgxW5hQA9fIKHsKCdOIUycTryeVw=", - "owner": "nixos", + "owner": "NixOS", "repo": "nixpkgs", "rev": "5633bcff0c6162b9e4b5f1264264611e950c8ec7", "type": "github" }, "original": { - "owner": "nixos", + "id": "nixpkgs", "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" + "type": "indirect" } }, "utils": { diff --git a/flake.nix b/flake.nix index 46806529..b8c07ca2 100644 --- a/flake.nix +++ b/flake.nix @@ -1,97 +1,91 @@ { - description = "Jimbo's systems as a flake"; - inputs = { - nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05"; - unstable.url = "github:nixos/nixpkgs/nixos-unstable"; + nixpkgs.url = "nixpkgs/nixos-24.05"; + unstable.url = "nixpkgs/nixos-unstable"; + + home-manager = { + url = "github:nix-community/home-manager/release-24.05"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + nur.url = "github:nix-community/NUR"; - mailserver.url = "gitlab:simple-nixos-mailserver/nixos-mailserver/nixos-24.05"; + chaotic = { + url = "github:chaotic-cx/nyx/nyxpkgs-unstable"; + inputs.nixpkgs.follows = "unstable"; + }; + blender-bin.url = "https://flakehub.com/f/edolstra/blender-bin/1.0.9.tar.gz"; - minecraft.url = "github:Infinidoge/nix-minecraft"; hardware.url = "github:nixos/nixos-hardware/master"; - # Secure boot lanzaboote = { url = "github:nix-community/lanzaboote/v0.4.1"; inputs.nixpkgs.follows = "nixpkgs"; }; - # Home manager - home-manager = { - url = "github:nix-community/home-manager/release-24.05"; - inputs.nixpkgs.follows = "nixpkgs"; - }; + mailserver.url = "gitlab:simple-nixos-mailserver/nixos-mailserver/nixos-24.05"; + minecraft.url = "github:Infinidoge/nix-minecraft"; }; outputs = { - self, nixpkgs, unstable, + home-manager, nur, - mailserver, + chaotic, blender-bin, hardware, lanzaboote, - home-manager, + mailserver, + minecraft, ... - }@inputs: let - mkNixos = modules: nixpkgs.lib.nixosSystem { + }: + let + mkNix = modules: nixpkgs.lib.nixosSystem { inherit modules; - specialArgs = { inherit (self) inputs outputs; }; + specialArgs = { + inherit + unstable + chaotic + hardware + lanzaboote + mailserver + minecraft + ; + }; }; - mkHome = modules: pkgs: home-manager.lib.homeManagerConfiguration { inherit modules pkgs; - extraSpecialArgs = { inherit (self) inputs outputs; }; + extraSpecialArgs = { + inherit + unstable + nur + blender-bin + ; + }; }; in { - # Your custom packages and modifications, exported as overlays - overlays = import ./extras/overlays.nix { inherit inputs; }; - - # Variables defined so they can be accessed globally - secrets = import ./extras/secrets.nix; - cmd = import ./extras/cmd.nix; - displays = import ./extras/displays.nix; - ips = import ./extras/ips.nix; - look = import ./extras/look.nix; - ws = import ./extras/workspaces.nix; - - # NixOS configuration: 'nixos-rebuild --flake .#hostname' + # nixos-rebuild switch --flake .#hostname nixosConfigurations = { - JimDesktop = mkNixos [ - ./system/hosts/JimDesktop/configuration.nix - lanzaboote.nixosModules.lanzaboote - ]; - JimServer = mkNixos [ - ./system/hosts/JimServer/configuration.nix - mailserver.nixosModule - ]; - JimPine = mkNixos [ - ./system/hosts/JimPine/configuration.nix - hardware.nixosModules.pine64-pinebook-pro - ]; + # PCs and Laptops + firefly = mkNix [ ./hosts/firefly/system ]; + shuttleworth = mkNix [ ./hosts/shuttleworth/system ]; + lacros = mkNix [ ./hosts/lacros/system ]; + redmond = mkNix [ ./hosts/redmond/system ]; + + # Servers + cyberspark = mkNix [ ./hosts/cyberspark/system ]; + bomberman = mkNix [ ./hosts/bomberman/system ]; }; - # Home-manager configuration: 'home-manager --flake .#username@hostname' + # home-manager switch --flake .#username@hostname homeConfigurations = { - "jimbo@JimDesktop" = mkHome [ - ./home/hosts/JimDesktop/home.nix - nur.nixosModules.nur - ] nixpkgs.legacyPackages.x86_64-linux; + "jimbo@firefly" = mkHome [ ./hosts/firefly/home ] nixpkgs.legacyPackages.x86_64-linux; + "jimbo@shuttleworth" = mkHome [ ./hosts/shuttleworth/home ] nixpkgs.legacyPackages.aarch64-linux; + "jimbo@lacros" = mkHome [ ./hosts/lacros/home ] nixpkgs.legacyPackages.x86_64-linux; + "jimbo@redmond" = mkHome [ ./hosts/redmond/home ] nixpkgs.legacyPackages.x86_64-linux; - "jimbo@JimServer" = mkHome [ - ./home/hosts/JimServer/home.nix - ] nixpkgs.legacyPackages.x86_64-linux; - - "jimbo@JimPine" = mkHome [ - ./home/hosts/JimPine/home.nix - nur.nixosModules.nur - ] nixpkgs.legacyPackages.aarch64-linux; - - # Profile for ssh envrionments on different non-root systems - "jimbo@JimTerminal" = mkHome [ - ./home/hosts/JimTerminal/home.nix - ] nixpkgs.legacyPackages.x86_64-linux; + "jimbo@cyberspark" = mkHome [ ./hosts/cyberspark/home ] nixpkgs.legacyPackages.x86_64-linux; + "jimbo@bomberman" = mkHome [ ./hosts/bomberman/home ] nixpkgs.legacyPackages.aarch64-linux; }; }; } diff --git a/home/base.nix b/home/base.nix deleted file mode 100644 index 053fdac3..00000000 --- a/home/base.nix +++ /dev/null @@ -1,41 +0,0 @@ -# This is your home-manager configuration file -# Use this to configure your home environment (it replaces ~/.config/nixpkgs/home.nix) -{pkgs, inputs, outputs, ...}: { - imports = [ - # Terminal apps - ./utils/zsh.nix - ./utils/fastfetch.nix - ./utils/neovim.nix - ./utils/ranger.nix - ./utils/tmux.nix - - # Services - ./services/reloadunits.nix - ]; - - nixpkgs = { - config.allowUnfree = true; - overlays = [ - outputs.overlays.additions - outputs.overlays.selfsuper - outputs.overlays.finalprev - inputs.blender-bin.overlays.default - ]; - }; - - # Common programs I'll need everywhere - home.packages = with pkgs; [ - home-manager - gotop - tcptrack - p7zip - vimv - dua - pciutils - usbutils - protonvpn-cli_2 - ]; - - # https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion - home.stateVersion = "24.05"; -} diff --git a/home/hosts/JimDesktop/home.nix b/home/hosts/JimDesktop/home.nix deleted file mode 100644 index 8f213a9a..00000000 --- a/home/hosts/JimDesktop/home.nix +++ /dev/null @@ -1,47 +0,0 @@ -{config, ...}: { - imports = [ - # Common modules - ./../../base.nix - ./../../users/jimbo.nix - ./../../utils/git.nix - - # GUI Apps - ./../../misc/guifiles.nix - ./../../misc/fonts.nix - ./../../sway/sway.nix - ./../../sway/swaylock.nix - ./../../programs/gtk.nix - ./../../programs/foot.nix - ./../../programs/librewolf.nix - ./../../programs/mangohud.nix - ./../../programs/mpv.nix - ./../../programs/obs.nix - ./../../programs/pcmanfm-qt.nix - ./../../programs/rofi.nix - ./../../programs/swappy.nix - ./../../programs/easyeffects.nix - ./../../utils/ncmpcpp.nix - - # Misc apps and tools - ./../../misc/useful.nix - ./../../misc/avtools.nix - ./../../misc/filemanager.nix - ./../../misc/production.nix - ./../../misc/gaming.nix - ./../../misc/xash3d.nix - #./../../misc/emulators.nix - #./../../misc/remotedesktop.nix - ./../../misc/school.nix - ./../../misc/variables.nix - - # Services - ./../../services/gnome-keyring.nix - ./../../services/mako.nix - ./../../services/udiskie.nix - ]; - - # Symlinks - home.file = { - "VMs".source = config.lib.file.mkOutOfStoreSymlink "/etc/libvirt/VMs"; - }; -} diff --git a/home/hosts/JimLenovo/home.nix b/home/hosts/JimLenovo/home.nix deleted file mode 100644 index a2090db1..00000000 --- a/home/hosts/JimLenovo/home.nix +++ /dev/null @@ -1,40 +0,0 @@ -{ - imports = [ - # Common modules - ./../../base.nix - ./../../users/jimbo.nix - ./../../utils/git.nix - - # GUI Apps - ./../../misc/guifiles.nix - ./../../misc/fonts.nix - ./../../sway/sway.nix - ./../../sway/swaylock.nix - ./../../programs/gtk.nix - ./../../programs/foot.nix - ./../../programs/librewolf.nix - ./../../programs/mangohud.nix - ./../../programs/mpv.nix - ./../../programs/obs.nix - ./../../programs/pcmanfm-qt.nix - ./../../programs/rofi.nix - ./../../programs/swappy.nix - ./../../programs/easyeffects.nix - ./../../utils/ncmpcpp.nix - - # Misc apps and tools - ./../../misc/useful.nix - ./../../misc/avtools.nix - ./../../misc/filemanager.nix - ./../../misc/gaming.nix - ./../../misc/xash3d.nix - ./../../misc/remotedesktop.nix - ./../../misc/school.nix - ./../../misc/variables.nix - - # Services - ./../../services/gnome-keyring.nix - ./../../services/mako.nix - ./../../services/udiskie.nix - ]; -} diff --git a/home/hosts/JimPine/home.nix b/home/hosts/JimPine/home.nix deleted file mode 100644 index 809906ca..00000000 --- a/home/hosts/JimPine/home.nix +++ /dev/null @@ -1,43 +0,0 @@ -{pkgs, outputs, ...}: { - imports = [ - # Common modules - ./../../base.nix - ./../../users/jimbo.nix - ./../../utils/git.nix - - # GUI Apps - ./../../misc/guifiles.nix - ./../../misc/fonts.nix - ./../../sway/sway.nix - ./../../sway/swaylock.nix - ./../../programs/gtk.nix - ./../../programs/foot.nix - ./../../programs/librewolf.nix - ./../../programs/mangohud.nix - ./../../programs/mpv.nix - ./../../programs/pcmanfm-qt.nix - ./../../programs/rofi.nix - ./../../programs/swappy.nix - ./../../programs/easyeffects.nix - ./../../utils/ncmpcpp.nix - - # Misc apps and tools - ./../../misc/useful.nix - ./../../misc/avtools.nix - ./../../misc/filemanager.nix - ./../../misc/remotedesktop.nix - ./../../misc/variables.nix - - # Services - ./../../services/gnome-keyring.nix - ./../../services/mako.nix - ./../../services/udiskie.nix - ]; - - # Needed to make the speaker work - home.packages = with pkgs; [ - alsa-utils - ]; - - wayland.windowManager.sway.config.output.${outputs.displays.dI}.scale = "1.3"; -} diff --git a/home/hosts/JimServer/home.nix b/home/hosts/JimServer/home.nix deleted file mode 100644 index 8f71646a..00000000 --- a/home/hosts/JimServer/home.nix +++ /dev/null @@ -1,8 +0,0 @@ -{ - imports = [ - # Common modules - ./../../base.nix - ./../../users/jimbo.nix - ./../../utils/git.nix - ]; -} diff --git a/home/hosts/JimTerminal/home.nix b/home/hosts/JimTerminal/home.nix deleted file mode 100644 index d0d54aed..00000000 --- a/home/hosts/JimTerminal/home.nix +++ /dev/null @@ -1,14 +0,0 @@ -{ - imports = [ - # Common modules - ./../../base.nix - ./../../users/jimbo.nix - ]; - - # Rebuild this entire system - programs.zsh = { - shellAliases = { - termswitch = "home-manager switch --flake ~/.home-manager/.#jimbo@JimTerminal --extra-experimental-features 'nix-command flakes'"; - }; - }; -} diff --git a/home/misc/filemanager.nix b/home/misc/filemanager.nix deleted file mode 100644 index f6b18f95..00000000 --- a/home/misc/filemanager.nix +++ /dev/null @@ -1,7 +0,0 @@ -{pkgs, ...}: { - home.packages = with pkgs; [ - gnome.file-roller - imagemagick - poppler_utils - ]; -} diff --git a/home/misc/guifiles.nix b/home/misc/guifiles.nix deleted file mode 100644 index dc85cc11..00000000 --- a/home/misc/guifiles.nix +++ /dev/null @@ -1,15 +0,0 @@ -{pkgs, ...}: { - # Files that only make sense with a GUI - home.file = { - ".face" = { - source = ../assets/user-icon.png; - }; - ".wallpapers" = { - source = ../assets/wallpapers; - recursive = true; - }; - ".icons/default" = { - source = "${pkgs.simp1e-cursors}/share/icons/Simp1e-Dark"; - }; - }; -} diff --git a/home/misc/production.nix b/home/misc/production.nix deleted file mode 100644 index c5a89671..00000000 --- a/home/misc/production.nix +++ /dev/null @@ -1,9 +0,0 @@ -{pkgs, ...}: { - home.packages = with pkgs; [ - krita - inkscape - audacity - blender_4_2 - sunvox - ]; -} diff --git a/home/misc/variables.nix b/home/misc/variables.nix deleted file mode 100644 index e353e65d..00000000 --- a/home/misc/variables.nix +++ /dev/null @@ -1,30 +0,0 @@ -{pkgs, inputs, ...}: { - # Select default apps - xdg.mimeApps.defaultApplications = { - "inode/directory" = ["pcmanfm-qt.desktop"]; - "text/plain" = ["nvim.desktop"]; - "image/png" = ["imv.desktop"]; - "image/jpeg" = ["imv.desktop"]; - "video/*" = ["mpv.desktop"]; - }; - - # Set dconf settings - dconf.settings = { - "org/gnome/desktop/interface/color-scheme" = { - color-scheme = "prefer-dark"; - }; - "org/virt-manager/virt-manager/connections" = { - autoconnect = ["qemu:///system"]; - uris = ["qemu:///system"]; - }; - }; - - home.file = let - alsoftConf = '' - drivers=pulse - ''; - in { - # Alsoft config - ".alsoftrc".text = alsoftConf; - }; -} diff --git a/home/programs/easyeffects.nix b/home/programs/easyeffects.nix deleted file mode 100644 index bffaa3ed..00000000 --- a/home/programs/easyeffects.nix +++ /dev/null @@ -1,309 +0,0 @@ -{pkgs, ...}: { - home = { - packages = with pkgs; [ - easyeffects - ]; - file = let - # An Easyeffects equalizer profile that sounds good to me - easyEffectsProfile = '' - { - "output": { - "blocklist": [], - "crystalizer#0": { - "band0": { - "bypass": false, - "intensity": 0.0, - "mute": false - }, - "band1": { - "bypass": false, - "intensity": -1.0, - "mute": false - }, - "band2": { - "bypass": false, - "intensity": -2.0, - "mute": false - }, - "band3": { - "bypass": false, - "intensity": -3.0, - "mute": false - }, - "band4": { - "bypass": false, - "intensity": -4.0, - "mute": false - }, - "band5": { - "bypass": false, - "intensity": -5.0, - "mute": false - }, - "band6": { - "bypass": false, - "intensity": -6.0, - "mute": false - }, - "band7": { - "bypass": false, - "intensity": -7.0, - "mute": false - }, - "band8": { - "bypass": false, - "intensity": -8.0, - "mute": false - }, - "band9": { - "bypass": false, - "intensity": -9.0, - "mute": false - }, - "band10": { - "bypass": false, - "intensity": -10.0, - "mute": false - }, - "band11": { - "bypass": false, - "intensity": -11.0, - "mute": false - }, - "band12": { - "bypass": false, - "intensity": -12.0, - "mute": false - }, - "bypass": false, - "input-gain": 0.0, - "output-gain": 0.0 - }, - "equalizer#0": { - "balance": 0.0, - "bypass": false, - "input-gain": 0.0, - "left": { - "band0": { - "frequency": 32.0, - "gain": 1.1, - "mode": "RLC (BT)", - "mute": false, - "q": 4.36, - "slope": "x1", - "solo": false, - "type": "Bell" - }, - "band1": { - "frequency": 64.0, - "gain": 1.16, - "mode": "RLC (BT)", - "mute": false, - "q": 4.36, - "slope": "x1", - "solo": false, - "type": "Bell" - }, - "band2": { - "frequency": 125.0, - "gain": 3.33, - "mode": "RLC (BT)", - "mute": false, - "q": 4.36, - "slope": "x1", - "solo": false, - "type": "Bell" - }, - "band3": { - "frequency": 250.0, - "gain": 1.53, - "mode": "RLC (BT)", - "mute": false, - "q": 4.36, - "slope": "x1", - "solo": false, - "type": "Bell" - }, - "band4": { - "frequency": 500.0, - "gain": -1.83, - "mode": "RLC (BT)", - "mute": false, - "q": 4.36, - "slope": "x1", - "solo": false, - "type": "Bell" - }, - "band5": { - "frequency": 1000.0, - "gain": -0.58, - "mode": "RLC (BT)", - "mute": false, - "q": 4.36, - "slope": "x1", - "solo": false, - "type": "Bell" - }, - "band6": { - "frequency": 2000.0, - "gain": 1.42, - "mode": "RLC (BT)", - "mute": false, - "q": 4.36, - "slope": "x1", - "solo": false, - "type": "Bell" - }, - "band7": { - "frequency": 4000.0, - "gain": 4.73, - "mode": "RLC (BT)", - "mute": false, - "q": 4.36, - "slope": "x1", - "solo": false, - "type": "Bell" - }, - "band8": { - "frequency": 16000.0, - "gain": 7.62, - "mode": "RLC (BT)", - "mute": false, - "q": 4.36, - "slope": "x1", - "solo": false, - "type": "Bell" - }, - "band9": { - "frequency": 156.38, - "gain": 2.84, - "mode": "RLC (BT)", - "mute": false, - "q": 4.36, - "slope": "x1", - "solo": false, - "type": "Bell" - } - }, - "mode": "IIR", - "num-bands": 10, - "output-gain": 0.0, - "pitch-left": 0.0, - "pitch-right": 0.0, - "right": { - "band0": { - "frequency": 32.0, - "gain": 1.1, - "mode": "RLC (BT)", - "mute": false, - "q": 4.36, - "slope": "x1", - "solo": false, - "type": "Bell" - }, - "band1": { - "frequency": 64.0, - "gain": 1.16, - "mode": "RLC (BT)", - "mute": false, - "q": 4.36, - "slope": "x1", - "solo": false, - "type": "Bell" - }, - "band2": { - "frequency": 125.0, - "gain": 3.33, - "mode": "RLC (BT)", - "mute": false, - "q": 4.36, - "slope": "x1", - "solo": false, - "type": "Bell" - }, - "band3": { - "frequency": 250.0, - "gain": 1.53, - "mode": "RLC (BT)", - "mute": false, - "q": 4.36, - "slope": "x1", - "solo": false, - "type": "Bell" - }, - "band4": { - "frequency": 500.0, - "gain": -1.83, - "mode": "RLC (BT)", - "mute": false, - "q": 4.36, - "slope": "x1", - "solo": false, - "type": "Bell" - }, - "band5": { - "frequency": 1000.0, - "gain": -0.58, - "mode": "RLC (BT)", - "mute": false, - "q": 4.36, - "slope": "x1", - "solo": false, - "type": "Bell" - }, - "band6": { - "frequency": 2000.0, - "gain": 1.42, - "mode": "RLC (BT)", - "mute": false, - "q": 4.36, - "slope": "x1", - "solo": false, - "type": "Bell" - }, - "band7": { - "frequency": 4000.0, - "gain": 4.73, - "mode": "RLC (BT)", - "mute": false, - "q": 4.36, - "slope": "x1", - "solo": false, - "type": "Bell" - }, - "band8": { - "frequency": 16000.0, - "gain": 7.62, - "mode": "RLC (BT)", - "mute": false, - "q": 4.36, - "slope": "x1", - "solo": false, - "type": "Bell" - }, - "band9": { - "frequency": 156.38, - "gain": 2.84, - "mode": "RLC (BT)", - "mute": false, - "q": 4.36, - "slope": "x1", - "solo": false, - "type": "Bell" - } - }, - "split-channels": false - }, - "plugins_order": [ - "equalizer#0", - "crystalizer#0" - ] - } - } - ''; - in { - # Easyeffects profile - ".config/easyeffects/output/JimHeadphones.json".text = easyEffectsProfile; - }; - }; -} diff --git a/home/programs/swappy.nix b/home/programs/swappy.nix deleted file mode 100644 index 917bc40f..00000000 --- a/home/programs/swappy.nix +++ /dev/null @@ -1,19 +0,0 @@ -{pkgs, ...}: { - # Swappy config file - home = { - packages = with pkgs; [ - swappy - ]; - file = let - # Swappy config, for screenshot editing - swappyConfig = '' - [Default] - early_exit=true - save_dir=$HOME/Pictures/Screenshots - ''; - in { - # Swappy's config - ".config/swappy/config".text = swappyConfig; - }; - }; -} diff --git a/home/services/gnome-keyring.nix b/home/services/gnome-keyring.nix deleted file mode 100644 index 9b45e0d0..00000000 --- a/home/services/gnome-keyring.nix +++ /dev/null @@ -1,13 +0,0 @@ -{pkgs, ...}: { - services.gnome-keyring = { - enable = true; - components = [ - "ssh" - ]; - }; - - home.packages = with pkgs; [ - gnome.gnome-keyring - gnome.libgnome-keyring - ]; -} diff --git a/home/services/reloadunits.nix b/home/services/reloadunits.nix deleted file mode 100644 index 2cd1837b..00000000 --- a/home/services/reloadunits.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ - # Nicely reload system units when changing configs - systemd.user = { - enable = true; - startServices = "sd-switch"; - }; -} diff --git a/home/sway/hotkeys.nix b/home/sway/hotkeys.nix deleted file mode 100644 index 84756dea..00000000 --- a/home/sway/hotkeys.nix +++ /dev/null @@ -1,269 +0,0 @@ -{config, pkgs, outputs, ...}: { - wayland.windowManager.sway = { - config = let - # Set default modifier and variables - primeMod = "Mod4"; - secMod = "Mod1"; - resizeAmount = ''55''; - sendNotif = ''notify-send --expire-time=1500''; - in { - # Hotkeys - modifier = "${primeMod}"; - keybindings = let - # Define scripts specific to Sway - pinWindow = pkgs.writeScript "pin-window" '' - # Get the current border style of the focused window - current_style=$(swaymsg -t get_tree | jq -r '.. | select(.focused?).border') - - # Toggle between "normal" (default) and "pixel ${outputs.look.border.string}" border styles - if [ "$current_style" == "none" ]; then - swaymsg "sticky disable, border pixel ${outputs.look.border.string}" - else - swaymsg "sticky enable, border none" - fi - ''; - - # Kill a window or probe it for info - swayTools = pkgs.writeScript "swaytools" '' - # List the app name and whether or not it uses wayland - swayprop() { - selected_window=$(swaymsg -t get_tree | jq -r '.. | select(.pid? and .visible?) | "\(.rect.x),\(.rect.y) \(.rect.width)x\(.rect.height)"' | slurp -r -c ${outputs.look.colors.prime} -B 00000066 -b 00000000) - if [ -n "$selected_window" ]; then - app_id=$(swaymsg -t get_tree | jq -r '.. | select(.pid? and .visible?) | select("\(.rect.x),\(.rect.y) \(.rect.width)x\(.rect.height)" == "'"$selected_window"'") | .app_id') - system=$(sed 's/xdg_shell/Wayland/g; s/xwayland/Xorg/g' < <(swaymsg -t get_tree | jq -r '.. | select(.pid? and .visible?) | select("\(.rect.x),\(.rect.y) \(.rect.width)x\(.rect.height)" == "'"$selected_window"'") | .shell')) - notify-send "$(echo -e "Window's app_id: $app_id\nWindow System: $system")" - fi - } - - # Kill a selected window - swaykill() { - selected_window=$(swaymsg -t get_tree | jq -r '.. | select(.pid? and .visible?) | "\(.rect.x),\(.rect.y) \(.rect.width)x\(.rect.height)"' | slurp -r -c ${outputs.look.colors.prime} -B 00000066 -b 00000000) - if [ -n "$selected_window" ]; then - pid=$(swaymsg -t get_tree | jq -r '.. | select(.pid? and .visible?) | select("\(.rect.x),\(.rect.y) \(.rect.width)x\(.rect.height)" == "'"$selected_window"'") | .pid') - kill -9 "$pid" - fi - } - - # Handle which tool we use - if [ "$1" == "--prop" ]; then - swayprop - elif [ "$1" == "--kill" ]; then - swaykill - fi - ''; - in { - ## Launcher keys - - # LibreWolf profiles - "${primeMod}+F1" = ''exec librewolf -P Jimbo --name=JimBrowser | ${sendNotif} "Main Browser"''; - "${primeMod}+F2" = ''exec librewolf -P Alt --name=AltBrowser | ${sendNotif} "Alternate Browser"''; - "${primeMod}+F3" = ''exec librewolf -P Misc --name=MiscBrowser | ${sendNotif} "Miscellaneous Browser"''; - - # Discord - "${primeMod}+F4" = ''exec vesktop --ozone-platform-hint=auto | ${sendNotif} "Discord"''; - - # Games - "${primeMod}+F5" = ''exec steam | ${sendNotif} "Steam"''; - "${primeMod}+F6" = ''exec heroic | ${sendNotif} "Heroic Games"''; - - # Looking glass for VMs - "${primeMod}+F7" = ''exec looking-glass-client input:rawMouse=yes | ${sendNotif} "Looking Glass"''; - - # Virtual Machines - "${primeMod}+F10" = ''exec virt-manager | ${sendNotif} "Virtual Machines"''; - - # BeMenu scripts - "${primeMod}+F11" = ''exec rofiscripts --scratchpads | ${sendNotif} "Scratchpads"''; - "${primeMod}+${secMod}+Ctrl+r" = ''exec rofiscripts --resolutions''; - - # Open NixOS configuration files - "${primeMod}+F12" = ''exec foot ${outputs.cmd.nixcfg} | ${sendNotif} "Nix Config"''; - - # Terminal, rofi, clipmenu, media script, power menu, show/hide waybar - "${primeMod}+Return" = ''exec foot''; - "${primeMod}+s" = ''exec rofi -show run -p Command''; - "${primeMod}+c" = ''exec clipman pick -t rofi''; - "${primeMod}+x" = ''exec rofiscripts --power''; - "${primeMod}+b" = ''exec pkill -USR1 waybar''; - "${primeMod}+Escape" = ''exec ${swayTools} --kill''; - - # PCManFM, Emoji Picker, Rofi Launcher, Bluetooth, Ranger - "${primeMod}+Shift+t" = ''exec pcmanfm-qt''; - "${primeMod}+Shift+e" = ''exec BEMOJI_PICKER_CMD="rofi -dmenu -i -p Emoji" bemoji -n -P 0''; - "${primeMod}+Shift+s" = ''exec rofi -show drun -modi drun -drun-display-format {name} -show-icons -disable-history''; - "${primeMod}+Shift+b" = ''exec rofi-bluetooth''; - "${primeMod}+Shift+Return" = ''exec foot ranger''; - - # Swaytools prop, colorpicker, obs-cmd - "${primeMod}+Ctrl+x" = ''exec ${swayTools} --prop''; - "${primeMod}+Ctrl+c" = ''exec ${pkgs.hyprpicker}/bin/hyprpicker -an && ${sendNotif} "Color copied to clipboard"''; - "${primeMod}+Ctrl+Prior" = ''exec ${pkgs.obs-cmd}/bin/obs-cmd scene switch "Main"''; - "${primeMod}+Ctrl+Next" = ''exec ${pkgs.obs-cmd}/bin/obs-cmd scene switch "Guest"''; - - ## Media keys - - # Volume control - "XF86AudioRaiseVolume" = ''exec wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+''; - "XF86AudioLowerVolume" = ''exec wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-''; - - # MPV volume control - "${secMod}+XF86AudioRaiseVolume" = ''exec mpc volume +3''; - "${secMod}+XF86AudioLowerVolume" = ''exec mpc volume -3''; - - # Mute, Stop - "XF86AudioMute" = ''exec wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle''; - "XF86AudioStop" = ''exec mpc stop''; - - # Play MPD, Firefox, or MPV - "XF86AudioPlay" = ''exec mpc toggle''; - "${secMod}+XF86AudioPlay" = ''exec playerctl --player=librewolf play-pause''; - "Ctrl+XF86AudioPlay" = ''exec playerctl --player=mpv play-pause''; - - # Next/Previous - "XF86AudioNext" = ''exec mpc next''; - "XF86AudioPrev" = ''exec mpc prev''; - - # Seek - "${secMod}+Shift+XF86AudioNext" = ''exec mpc seek +5''; - "${secMod}+Shift+XF86AudioPrev" = ''exec mpc seek -5''; - - ## Notification keys - - # Toggle mako - "${primeMod}+n" = ''exec makotoggle''; - "${primeMod}+Shift+n" = ''exec makoctl restore''; - "${primeMod}+Ctrl+n" = ''exec makoctl dismiss -a''; - - ## Miscellaneous keys - - # Screenshots - "Print" = ''exec swayshot --swappy''; - "${primeMod}+Shift+f" = ''exec swayshot --swappy''; - "Shift+Print" = ''exec swayshot --screen''; - - # Server SSH - "${primeMod}+Ctrl+Return" = ''exec foot ssh ${outputs.ips.server} -p 2222''; - - # Display Brightness and Keyboard Brightness - "XF86MonBrightnessUp" = ''exec light -A 5''; - "XF86MonBrightnessDown" = ''exec light -U 5''; - "Shift+XF86MonBrightnessUp" = ''exec light -A 1''; - "Shift+XF86MonBrightnessDown" = ''exec light -U 1''; - "XF86KbdBrightnessUp" = ''exec light -s sysfs/leds/smc::kbd_backlight -A 5''; - "XF86KbdBrightnessDown" = ''exec light -s sysfs/leds/smc::kbd_backlight -U 5''; - - ## Window manager keys - "${primeMod}+q" = ''kill''; - "${primeMod}+Shift+r" = ''reload''; - - # Switch to workspaces - "${primeMod}+grave" = ''workspace ${outputs.ws.w0}''; - "${primeMod}+1" = ''workspace ${outputs.ws.w1}''; - "${primeMod}+2" = ''workspace ${outputs.ws.w2}''; - "${primeMod}+3" = ''workspace ${outputs.ws.w3}''; - "${primeMod}+4" = ''workspace ${outputs.ws.w4}''; - "${primeMod}+5" = ''workspace ${outputs.ws.w5}''; - "${primeMod}+6" = ''workspace ${outputs.ws.w6}''; - "${primeMod}+7" = ''workspace ${outputs.ws.w7}''; - "${primeMod}+8" = ''workspace ${outputs.ws.w8}''; - "${primeMod}+9" = ''workspace ${outputs.ws.w9}''; - - # Switch to alternate workspaces - "${secMod}+F1" = ''workspace ${outputs.ws.w1a}''; - "${secMod}+F2" = ''workspace ${outputs.ws.w2a}''; - "${secMod}+F3" = ''workspace ${outputs.ws.w3a}''; - "${secMod}+F4" = ''workspace ${outputs.ws.w4a}''; - "${secMod}+F5" = ''workspace ${outputs.ws.w5a}''; - "${secMod}+F6" = ''workspace ${outputs.ws.w6a}''; - "${secMod}+F7" = ''workspace ${outputs.ws.w7a}''; - "${secMod}+F8" = ''workspace ${outputs.ws.w8a}''; - "${secMod}+F9" = ''workspace ${outputs.ws.w9a}''; - - # Move window to and focus new workspace - "${primeMod}+Shift+grave" = ''move container to workspace ${outputs.ws.w0}; workspace ${outputs.ws.w0}''; - "${primeMod}+Shift+1" = ''move container to workspace ${outputs.ws.w1}; workspace ${outputs.ws.w1}''; - "${primeMod}+Shift+2" = ''move container to workspace ${outputs.ws.w2}; workspace ${outputs.ws.w2}''; - "${primeMod}+Shift+3" = ''move container to workspace ${outputs.ws.w3}; workspace ${outputs.ws.w3}''; - "${primeMod}+Shift+4" = ''move container to workspace ${outputs.ws.w4}; workspace ${outputs.ws.w4}''; - "${primeMod}+Shift+5" = ''move container to workspace ${outputs.ws.w5}; workspace ${outputs.ws.w5}''; - "${primeMod}+Shift+6" = ''move container to workspace ${outputs.ws.w6}; workspace ${outputs.ws.w6}''; - "${primeMod}+Shift+7" = ''move container to workspace ${outputs.ws.w7}; workspace ${outputs.ws.w7}''; - "${primeMod}+Shift+8" = ''move container to workspace ${outputs.ws.w8}; workspace ${outputs.ws.w8}''; - "${primeMod}+Shift+9" = ''move container to workspace ${outputs.ws.w9}; workspace ${outputs.ws.w9}''; - - # Move window to and focus new alternate workspace - "${secMod}+Shift+F1" = ''move container to workspace ${outputs.ws.w1a}; workspace ${outputs.ws.w1a}''; - "${secMod}+Shift+F2" = ''move container to workspace ${outputs.ws.w2a}; workspace ${outputs.ws.w2a}''; - "${secMod}+Shift+F3" = ''move container to workspace ${outputs.ws.w3a}; workspace ${outputs.ws.w3a}''; - "${secMod}+Shift+F4" = ''move container to workspace ${outputs.ws.w4a}; workspace ${outputs.ws.w4a}''; - "${secMod}+Shift+F5" = ''move container to workspace ${outputs.ws.w5a}; workspace ${outputs.ws.w5a}''; - "${secMod}+Shift+F6" = ''move container to workspace ${outputs.ws.w6a}; workspace ${outputs.ws.w6a}''; - "${secMod}+Shift+F7" = ''move container to workspace ${outputs.ws.w7a}; workspace ${outputs.ws.w7a}''; - "${secMod}+Shift+F8" = ''move container to workspace ${outputs.ws.w8a}; workspace ${outputs.ws.w8a}''; - "${secMod}+Shift+F9" = ''move container to workspace ${outputs.ws.w9a}; workspace ${outputs.ws.w9a}''; - - # Change focus across windows - "${primeMod}+Up" = ''focus up''; - "${primeMod}+Down" = ''focus down''; - "${primeMod}+Left" = ''focus left''; - "${primeMod}+Right" = ''focus right''; - - # Switch focus across outputs - "${primeMod}+j" = ''focus output ${outputs.displays.d2}''; - "${primeMod}+k" = ''focus output ${outputs.displays.d1}''; - "${primeMod}+l" = ''focus output ${outputs.displays.d3}''; - - # Move focused window - "${primeMod}+Shift+Up" = ''move up ${resizeAmount} px''; - "${primeMod}+Shift+Down" = ''move down ${resizeAmount} px''; - "${primeMod}+Shift+Left" = ''move left ${resizeAmount} px''; - "${primeMod}+Shift+Right" = ''move right ${resizeAmount} px''; - - # Move window across outputs - "${primeMod}+Shift+j" = ''move output ${outputs.displays.d2}; focus output ${outputs.displays.d2}''; - "${primeMod}+Shift+k" = ''move output ${outputs.displays.d1}; focus output ${outputs.displays.d1}''; - "${primeMod}+Shift+l" = ''move output ${outputs.displays.d3}; focus output ${outputs.displays.d3}''; - - # Change focus between floating/tiled, toggle floating - "${primeMod}+space" = ''focus mode_toggle''; - "${primeMod}+Shift+space" = ''floating toggle''; - - # Allow a window to be visible on all workspaces, toggle border - "${primeMod}+0" = ''exec ${pinWindow}''; - - # Toggle fullscreen - "${primeMod}+f" = ''fullscreen toggle''; - "${primeMod}+${secMod}+Ctrl+f" = ''fullscreen toggle global''; - - # Change container layout - "${primeMod}+w" = ''layout toggle split''; - "${primeMod}+e" = ''layout toggle tabbed stacking''; - - # Change split direction - "${primeMod}+h" = ''split h''; - "${primeMod}+v" = ''split v''; - - # Focus parent / child - "${primeMod}+a" = ''focus parent''; - "${primeMod}+d" = ''focus child''; - - # Resize windows - "${primeMod}+${secMod}+Up" = ''resize grow height ${resizeAmount} px or 5 ppt''; - "${primeMod}+${secMod}+Down" = ''resize shrink height ${resizeAmount} px or 5 ppt''; - "${primeMod}+${secMod}+Left" = ''resize shrink width ${resizeAmount} px or 5 ppt''; - "${primeMod}+${secMod}+Right" = ''resize grow width ${resizeAmount} px or 5 ppt''; - - # Adjust gap size - "${primeMod}+Shift+equal" = ''gaps inner current set 5''; - "${primeMod}+equal" = ''gaps inner current plus 5''; - "${primeMod}+minus" = ''gaps inner current minus 5''; - - # Scratchpads - "Ctrl+Shift+Escape" = ''[app_id="gotop"] scratchpad show, move position center, resize set 1216 888''; - "${primeMod}+Shift+m" = ''[app_id="music"] scratchpad show, move position center, resize set 1006 657''; - "${primeMod}+Shift+v" = ''[app_id="sound"] scratchpad show, move position center, resize set 1000 800''; - "${primeMod}+Shift+Backslash" = ''[app_id="com.github.wwmm.easyeffects"] scratchpad show, move position center, resize set 1000 800''; - }; - }; - }; -} diff --git a/home/sway/swayfx.nix b/home/sway/swayfx.nix deleted file mode 100644 index 53904905..00000000 --- a/home/sway/swayfx.nix +++ /dev/null @@ -1,14 +0,0 @@ -{config, pkgs, ...}: { - # Enable Sway and write some scripts - wayland.windowManager.sway = { - package = pkgs.unstable.sway; - extraConfig = '' - # SwayFX specific options - blur enable - blur_passes 3 - blur_radius 5 - layer_effects 'rofi' blur enable - layer_effects 'notifications' blur enable; blur_ignore_transparent enable - ''; - }; -} diff --git a/home/sway/theme.nix b/home/sway/theme.nix deleted file mode 100644 index 6cf24e48..00000000 --- a/home/sway/theme.nix +++ /dev/null @@ -1,50 +0,0 @@ -{config, pkgs, outputs, ...}: { - # Enable Sway and write some scripts - wayland.windowManager.sway = { - enable = true; - #package = pkgs.unstable.sway; - wrapperFeatures.gtk = true; - checkConfig = false; - config = { - # Theming settings - colors = { - focused = { - border = "#${outputs.look.colors.prime}"; - background = "#${outputs.look.colors.prime}"; - text = "#FFFFFF"; - indicator = "#${outputs.look.colors.actSplit}"; - childBorder = "#${outputs.look.colors.prime}"; - }; - focusedInactive = { - border = "#${outputs.look.colors.accent}"; - background = "#${outputs.look.colors.accent}"; - text = "#${outputs.look.colors.text}"; - indicator = "#${outputs.look.colors.split}"; - childBorder = "#${outputs.look.colors.accent}"; - }; - unfocused = { - border = "#${outputs.look.colors.dark}"; - background = "#${outputs.look.colors.dark}"; - text = "#${outputs.look.colors.text}"; - indicator = "#${outputs.look.colors.split}"; - childBorder = "#${outputs.look.colors.split}"; - }; - urgent = { - border = "#${outputs.look.colors.urgent}"; - background = "#${outputs.look.colors.urgent}"; - text = "#${outputs.look.colors.text}"; - indicator = "#${outputs.look.colors.urgent}"; - childBorder = "#${outputs.look.colors.urgent}"; - }; - }; - fonts = { - names = ["${outputs.look.fonts.main}"]; - size = 10.5; - }; - gaps = { - inner = 5; - smartGaps = true; - }; - }; - }; -} diff --git a/home/utils/git.nix b/home/utils/git.nix deleted file mode 100644 index b10c56da..00000000 --- a/home/utils/git.nix +++ /dev/null @@ -1,8 +0,0 @@ -{pkgs, outputs, ...}: { - programs.git = { - enable = true; - lfs.enable = true; - userName = outputs.secrets.jimUsername; - userEmail = outputs.secrets.jimEmail; - }; -} diff --git a/hosts/bomberman/home/default.nix b/hosts/bomberman/home/default.nix new file mode 100644 index 00000000..c6c69e71 --- /dev/null +++ b/hosts/bomberman/home/default.nix @@ -0,0 +1,19 @@ +{ ... }: +{ + imports = [ + # Programs and apps + ../../../modules/home + ../../../modules/home/users + ../../../modules/home/programs/misc/headless + ../../../modules/home/programs/terminal/fastfetch + ../../../modules/home/programs/terminal/git + ../../../modules/home/programs/terminal/neovim + ../../../modules/home/programs/terminal/ranger + ../../../modules/home/programs/terminal/tmux + ../../../modules/home/utils/zsh + + # Misc + ../../../variables/domains + ../../../variables/look/colors/purple + ]; +} diff --git a/hosts/bomberman/id_ed25519.pub b/hosts/bomberman/id_ed25519.pub new file mode 100644 index 00000000..7ca55e92 --- /dev/null +++ b/hosts/bomberman/id_ed25519.pub @@ -0,0 +1 @@ +ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICtxnPjkLdUIi5mVqBHXM9rW+Mmsqx1C1XnpRusVTWhm jimbo@bomberman diff --git a/hosts/bomberman/system/default.nix b/hosts/bomberman/system/default.nix new file mode 100644 index 00000000..fbe62ad3 --- /dev/null +++ b/hosts/bomberman/system/default.nix @@ -0,0 +1,28 @@ +{ config, ... }: +{ + imports = [ + ./hardware + + # Apps and programs + ../../../modules/system + ../../../modules/system/accounts + ../../../modules/system/devices/filesystems + ../../../modules/system/devices/boot/systemd + ../../../modules/system/devices/networking + ../../../modules/system/devices/networking/firewall/pc + ../../../modules/system/devices/networking/wireguard/pc + ../../../modules/system/programs/git + ../../../modules/system/programs/security + ../../../modules/system/services/common + ../../../modules/system/services/server/acme + ../../../modules/system/services/server/webhost/nginx + ../../../modules/system/services/server/mailserver + + # Misc + ../../../overlays + ../../../variables + ]; + + networking.hostName = "bomberman"; + networking.wireguard.interfaces."${config.ips.wgInt}".ips = [ "${config.ips.wgSpan}.19/24" ]; +} diff --git a/hosts/bomberman/system/hardware/default.nix b/hosts/bomberman/system/hardware/default.nix new file mode 100644 index 00000000..d6d255ac --- /dev/null +++ b/hosts/bomberman/system/hardware/default.nix @@ -0,0 +1,61 @@ +{ config, lib, pkgs, modulesPath, ... }: +{ + imports = [ + (modulesPath + "/profiles/qemu-guest.nix") + ]; + + boot.initrd = { + availableKernelModules = [ + "xhci_pci" + "virtio_scsi" + ]; + kernelModules = [ + "dm-snapshot" + ]; + }; + + fileSystems = { + "/" = { + device = "/dev/disk/by-uuid/e50e186d-e5bc-40b0-9cd7-43b609cde3ea"; + fsType = "btrfs"; + options = [ "subvol=@" ]; + }; + "/home" = { + device = "/dev/disk/by-uuid/e50e186d-e5bc-40b0-9cd7-43b609cde3ea"; + fsType = "btrfs"; + options = [ "subvol=@home" ]; + }; + "/nix" = { + device = "/dev/disk/by-uuid/e50e186d-e5bc-40b0-9cd7-43b609cde3ea"; + fsType = "btrfs"; + options = [ "subvol=@nix" ]; + }; + "/var" = { + device = "/dev/disk/by-uuid/e50e186d-e5bc-40b0-9cd7-43b609cde3ea"; + fsType = "btrfs"; + options = [ "subvol=@var" ]; + }; + "/.snapshots" = { + device = "/dev/disk/by-uuid/e50e186d-e5bc-40b0-9cd7-43b609cde3ea"; + fsType = "btrfs"; + options = [ "subvol=@snapshots" ]; + }; + "/boot" = { + device = "/dev/disk/by-uuid/7C94-8C9A"; + fsType = "vfat"; + options = [ "fmask=0022" "dmask=0022" ]; + }; + "/export/Bulk" = { + device = "/dev/disk/by-uuid/ef465845-cc56-4db5-9260-8ae515eb025e"; + fsType = "btrfs"; + noCheck = true; + }; + }; + + swapDevices = [ + { device = "/dev/disk/by-uuid/7e8c773d-c8f4-4dd8-a835-bde78e5b6760"; } + ]; + + networking.useDHCP = lib.mkDefault true; + nixpkgs.hostPlatform = lib.mkDefault "aarch64-linux"; +} diff --git a/hosts/cyberspark/home/default.nix b/hosts/cyberspark/home/default.nix new file mode 100644 index 00000000..c6c69e71 --- /dev/null +++ b/hosts/cyberspark/home/default.nix @@ -0,0 +1,19 @@ +{ ... }: +{ + imports = [ + # Programs and apps + ../../../modules/home + ../../../modules/home/users + ../../../modules/home/programs/misc/headless + ../../../modules/home/programs/terminal/fastfetch + ../../../modules/home/programs/terminal/git + ../../../modules/home/programs/terminal/neovim + ../../../modules/home/programs/terminal/ranger + ../../../modules/home/programs/terminal/tmux + ../../../modules/home/utils/zsh + + # Misc + ../../../variables/domains + ../../../variables/look/colors/purple + ]; +} diff --git a/hosts/cyberspark/id_ed25519.pub b/hosts/cyberspark/id_ed25519.pub new file mode 100644 index 00000000..1c06662a --- /dev/null +++ b/hosts/cyberspark/id_ed25519.pub @@ -0,0 +1 @@ +ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIKC8Uqxb09V3msBgDv6lD/nETMYr/X0OgtpDo8ldcMK diff --git a/hosts/cyberspark/system/default.nix b/hosts/cyberspark/system/default.nix new file mode 100644 index 00000000..5979d3b6 --- /dev/null +++ b/hosts/cyberspark/system/default.nix @@ -0,0 +1,25 @@ +{ ... }: +{ + imports = [ + ./hardware + + # Apps and programs + ../../../modules/system + ../../../modules/system/accounts + ../../../modules/system/devices/filesystems + ../../../modules/system/devices/boot/systemd + ../../../modules/system/devices/networking + ../../../modules/system/devices/networking/firewall/server + ../../../modules/system/devices/networking/wireguard/server + ../../../modules/system/programs/git + ../../../modules/system/programs/security + ../../../modules/system/services/common + ../../../modules/system/services/server + + # Misc + ../../../overlays + ../../../variables + ]; + + networking.hostName = "cyberspark"; +} diff --git a/hosts/cyberspark/system/hardware/default.nix b/hosts/cyberspark/system/hardware/default.nix new file mode 100644 index 00000000..7d60b9e6 --- /dev/null +++ b/hosts/cyberspark/system/hardware/default.nix @@ -0,0 +1,130 @@ +{ config, lib, pkgs, modulesPath, ... }: +{ + imports = [ + (modulesPath + "/installer/scan/not-detected.nix") + ]; + + boot = { + blacklistedKernelModules = [ + "pcspkr" + ]; + initrd = { + availableKernelModules = [ + "xhci_pci" + "ehci_pci" + "ahci" + "nvme" + "usbhid" + "sd_mod" + "sr_mod" + ]; + kernelModules = [ + "kvm-intel" + ]; + }; + swraid = { + enable = true; + mdadmConf = "MAILADDR jimbo@jimbosfiles.com"; + }; + }; + + # Main root + fileSystems = { + "/" = { + device = "/dev/disk/by-uuid/b8b7ed47-c98c-4a49-af01-b2832dde1287"; + fsType = "btrfs"; + options = [ "subvol=@" ]; + }; + "/home" = { + device = "/dev/disk/by-uuid/b8b7ed47-c98c-4a49-af01-b2832dde1287"; + fsType = "btrfs"; + options = [ "subvol=@home" ]; + }; + "/nix" = { + device = "/dev/disk/by-uuid/b8b7ed47-c98c-4a49-af01-b2832dde1287"; + fsType = "btrfs"; + options = [ "subvol=@nix" ]; + }; + "/var" = { + device = "/dev/disk/by-uuid/acf95700-8669-45c7-9a72-bf3215b3c325"; + fsType = "btrfs"; + options = [ "subvol=@var" ]; + }; + "/srv/minecraft" = { + device = "/dev/disk/by-uuid/acf95700-8669-45c7-9a72-bf3215b3c325"; + fsType = "btrfs"; + options = [ "subvol=@minecraft" "compress=zstd" ]; + }; + "/.snapshots" = { + device = "/dev/disk/by-uuid/b8b7ed47-c98c-4a49-af01-b2832dde1287"; + fsType = "btrfs"; + options = [ "subvol=@snapshots" ]; + }; + "/boot" = { + device = "/dev/disk/by-uuid/CD94-1D3F"; + fsType = "vfat"; + options = [ "fmask=0022" "dmask=0022" ]; + }; + + # Atrocity of subvols + "/export/JimboNFS/Downloads" = { + device = "/dev/disk/by-uuid/acf95700-8669-45c7-9a72-bf3215b3c325"; + fsType = "btrfs"; + options = [ "subvol=@downloads" "compress=zstd" ]; + }; + "/export/JimboNFS/Documents" = { + device = "/dev/disk/by-uuid/acf95700-8669-45c7-9a72-bf3215b3c325"; + fsType = "btrfs"; + options = [ "subvol=@docs" "compress=zstd" ]; + }; + "/export/JimboNFS/Photos" = { + device = "/dev/disk/by-uuid/acf95700-8669-45c7-9a72-bf3215b3c325"; + fsType = "btrfs"; + options = [ "subvol=@photos" "compress=zstd" ]; + }; + "/export/JimboNFS/Videos/Random" = { + device = "/dev/disk/by-uuid/acf95700-8669-45c7-9a72-bf3215b3c325"; + fsType = "btrfs"; + options = [ "subvol=@videos-random" "compress=zstd" ]; + }; + "/export/JimboNFS/Videos/Media" = { + device = "/dev/disk/by-uuid/acf95700-8669-45c7-9a72-bf3215b3c325"; + fsType = "btrfs"; + options = [ "subvol=@videos-media" "compress=zstd" ]; + }; + "/export/JimboNFS/Music/Synced" = { + device = "/dev/disk/by-uuid/acf95700-8669-45c7-9a72-bf3215b3c325"; + fsType = "btrfs"; + options = [ "subvol=@music-synced" "compress=zstd" ]; + }; + "/export/JimboNFS/Music/Unsynced" = { + device = "/dev/disk/by-uuid/acf95700-8669-45c7-9a72-bf3215b3c325"; + fsType = "btrfs"; + options = [ "subvol=@music-unsynced" "compress=zstd" ]; + }; + "/export/JimboNFS/Projects" = { + device = "/dev/disk/by-uuid/acf95700-8669-45c7-9a72-bf3215b3c325"; + fsType = "btrfs"; + options = [ "subvol=@projects" "compress=zstd" ]; + }; + "/export/JimboNFS/School" = { + device = "/dev/disk/by-uuid/acf95700-8669-45c7-9a72-bf3215b3c325"; + fsType = "btrfs"; + options = [ "subvol=@school" "compress=zstd" ]; + }; + "/export/JimboNFS/.snapshots" = { + device = "/dev/disk/by-uuid/acf95700-8669-45c7-9a72-bf3215b3c325"; + fsType = "btrfs"; + options = [ "subvol=@snapshots" "compress=zstd" ]; + }; + }; + + + swapDevices = [ + { device = "/dev/disk/by-uuid/57178cfc-3e71-4d35-8c7f-e355f9dc84df"; } + ]; + + networking.useDHCP = lib.mkDefault true; + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/hosts/firefly/home/default.nix b/hosts/firefly/home/default.nix new file mode 100644 index 00000000..41029b5f --- /dev/null +++ b/hosts/firefly/home/default.nix @@ -0,0 +1,27 @@ +{ nur, config, ... }: +{ + imports = [ + # Apps and programs + ../../../modules/home + ../../../modules/home/users + ../../../modules/home/files + ../../../modules/home/settings + ../../../modules/home/programs + ../../../modules/home/programs/misc/production + ../../../modules/home/programs/misc/gaming/launchers + ../../../modules/home/programs/misc/gaming/xash3d + ../../../modules/home/programs/misc/school + ../../../modules/home/sway + ../../../modules/home/utils + + # Misc + ../../../overlays + ../../../variables + ../../../variables/look/colors/red + + # Imports + nur.nixosModules.nur + ]; + + wayland.windowManager.sway.config.output.${config.displays.d1}.allow_tearing = "yes"; +} diff --git a/hosts/firefly/id_ed25519.pub b/hosts/firefly/id_ed25519.pub new file mode 100644 index 00000000..e36a85de --- /dev/null +++ b/hosts/firefly/id_ed25519.pub @@ -0,0 +1 @@ +ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIC2lMkUd+BbXITE5LTg94hEzmA6UKsIIbaf5YOjGoLzl diff --git a/hosts/firefly/system/boot/default.nix b/hosts/firefly/system/boot/default.nix new file mode 100644 index 00000000..45430c90 --- /dev/null +++ b/hosts/firefly/system/boot/default.nix @@ -0,0 +1,50 @@ +{ pkgs, ... }: +let + commonKernelParams = [ + # Nvidia settings + "nvidia_drm.fbdev=1" + "nouveau.config=NvGspRm=1" + + # VM/GPU passthrough + "amd_iommu=on" + "iommu=pt" + "nested=1" + + # Virtualization nonsense + "transparent_hugepage=never" + + # Isolate devices into IOMMU groups + "pcie_acs_override=downstream,multifunction" + "pci=routeirq" + ]; +in { + boot = { + kernelPackages = pkgs.linuxPackages_cachyos; + blacklistedKernelModules = [ + "pcspkr" + ]; + kernel.sysctl."vm.max_map_count" = 2147483642; + kernelParams = commonKernelParams ++ [ + "vfio-pci.ids=10de:1f82,10de:10fa" + ]; + + # Encryption and TPM + initrd = { + systemd.enable = true; + luks.devices = { + "crypt-ssd" = { + device = "/dev/disk/by-uuid/52110c74-19b6-40ef-9710-e6c9b157005f"; + preLVM = true; + allowDiscards = true; + }; + }; + }; + }; + + # Additional entry to boot from the second GPU + specialisation = { + gputwo.configuration = { + boot.kernelParams = commonKernelParams ++ [ "vfio-pci.ids=10de:2504,10de:228e" ]; + }; + }; +} diff --git a/hosts/firefly/system/default.nix b/hosts/firefly/system/default.nix new file mode 100644 index 00000000..6511ff1f --- /dev/null +++ b/hosts/firefly/system/default.nix @@ -0,0 +1,37 @@ +{ chaotic, pkgs, ... }: +{ + imports = [ + ./hardware + ./boot + + # Apps and programs + ../../../modules/system + ../../../modules/system/accounts + ../../../modules/system/desktop + ../../../modules/system/programs + ../../../modules/system/services + ../../../modules/system/services/pc/sunshine + ../../../modules/system/services/pc/school + ../../../modules/system/services/pc/virtualization/qemu + + # Devices and hardware + ../../../modules/system/devices + ../../../modules/system/devices/boot/lanzaboote + ../../../modules/system/devices/video/nvidia + ../../../modules/system/devices/networking/firewall/pc + + # Misc + ../../../overlays + ../../../variables + + # Imports + chaotic.homeManagerModules.default + ]; + + programs.sway.package = pkgs.sway_git; + + networking.hostName = "firefly"; + + # Force Electron to use Wayland + environment.sessionVariables.NIXOS_OZONE_WL = "1"; +} diff --git a/system/hosts/JimDesktop/hardware-configuration.nix b/hosts/firefly/system/hardware/default.nix similarity index 55% rename from system/hosts/JimDesktop/hardware-configuration.nix rename to hosts/firefly/system/hardware/default.nix index 7dc5a62a..038c02ae 100644 --- a/system/hosts/JimDesktop/hardware-configuration.nix +++ b/hosts/firefly/system/hardware/default.nix @@ -1,72 +1,29 @@ -{ config, lib, pkgs, outputs, modulesPath, ... }: let - # Set common boot paramaters - commonKernelParams = [ - # Nvidia settings - "nvidia_drm.fbdev=1" - "nouveau.config=NvGspRm=1" - - # VM/GPU passthrough - "amd_iommu=on" - "iommu=pt" - "nested=1" - - # Virtualization nonsense - "transparent_hugepage=never" - - # Isolate devices into IOMMU groups - "pcie_acs_override=downstream,multifunction" - "pci=routeirq" - ]; -in { +{ config, lib, modulesPath, ... }: +{ imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; boot = { - kernelPackages = pkgs.unstable.linuxPackages_zen; - blacklistedKernelModules = [ - "pcspkr" - ]; - kernel.sysctl."vm.max_map_count" = 2147483642; - kernelParams = commonKernelParams ++ [ - "vfio-pci.ids=10de:1f82,10de:10fa" - ]; initrd = { availableKernelModules = [ "nvme" - "xhci_pci" - "ahci" - "usbhid" - "usb_storage" - "sd_mod" + "xhci_pci" + "ahci" + "usbhid" + "usb_storage" + "sd_mod" ]; kernelModules = [ + "dm-snapshot" "vfio" - "vfio_pci" - "vfio_iommu_type1" - "kvm-amd" + "vfio_pci" + "vfio_iommu_type1" + "kvm-amd" ]; - - # Encryption and TPM - systemd.enable = true; - luks.devices = { - "crypt-ssd" = { - device = "/dev/disk/by-uuid/52110c74-19b6-40ef-9710-e6c9b157005f"; - preLVM = true; - allowDiscards = true; - }; - }; }; }; - # Additional entry to boot from the second GPU - specialisation = { - gputwo.configuration = { - boot.kernelParams = commonKernelParams ++ [ "vfio-pci.ids=10de:2504,10de:228e" ]; - }; - }; - - # Mount everything as necessary fileSystems = { "/" = { device = "/dev/disk/by-uuid/bbfed7d1-62f2-4d8e-b63f-7f6ec932105b"; @@ -88,6 +45,11 @@ in { fsType = "btrfs"; options = [ "subvol=@var" "noatime" "nodiratime" "discard" ]; }; + "/.snapshots" = { + device = "/dev/disk/by-uuid/bbfed7d1-62f2-4d8e-b63f-7f6ec932105b"; + fsType = "btrfs"; + options = [ "subvol=@snapshots" "noatime" "nodiratime" "discard" ]; + }; "/boot" = { device = "/dev/disk/by-uuid/3B4A-76C9"; fsType = "vfat"; @@ -129,19 +91,57 @@ in { }; # Network mounts - "/home/jimbo/JimboNFS" = { - device = "${outputs.ips.server}:/export/JimboNFS"; + "/home/jimbo/JimboNFS/Downloads" = { + device = "${config.ips.server}:/export/JimboNFS/Downloads"; + fsType = "nfs4"; + options = [ "x-systemd.automount" "_netdev" "nofail" "noauto" ]; + }; + "/home/jimbo/JimboNFS/Documents" = { + device = "${config.ips.server}:/export/JimboNFS/Documents"; + fsType = "nfs4"; + options = [ "x-systemd.automount" "_netdev" "nofail" "noauto" ]; + }; + "/home/jimbo/JimboNFS/Photos" = { + device = "${config.ips.server}:/export/JimboNFS/Photos"; + fsType = "nfs4"; + options = [ "x-systemd.automount" "_netdev" "nofail" "noauto" ]; + }; + "/home/jimbo/JimboNFS/Videos/Random" = { + device = "${config.ips.server}:/export/JimboNFS/Videos/Random"; + fsType = "nfs4"; + options = [ "x-systemd.automount" "_netdev" "nofail" "noauto" ]; + }; + "/home/jimbo/JimboNFS/Videos/Media" = { + device = "${config.ips.server}:/export/JimboNFS/Videos/Media"; + fsType = "nfs4"; + options = [ "x-systemd.automount" "_netdev" "nofail" "noauto" ]; + }; + "/home/jimbo/JimboNFS/Music/Synced" = { + device = "${config.ips.server}:/export/JimboNFS/Music/Synced"; + fsType = "nfs4"; + options = [ "x-systemd.automount" "_netdev" "nofail" "noauto" ]; + }; + "/home/jimbo/JimboNFS/Music/Unsynced" = { + device = "${config.ips.server}:/export/JimboNFS/Music/Unsynced"; + fsType = "nfs4"; + options = [ "x-systemd.automount" "_netdev" "nofail" "noauto" ]; + }; + "/home/jimbo/JimboNFS/Projects" = { + device = "${config.ips.server}:/export/JimboNFS/Projects"; + fsType = "nfs4"; + options = [ "x-systemd.automount" "_netdev" "nofail" "noauto" ]; + }; + "/home/jimbo/JimboNFS/School" = { + device = "${config.ips.server}:/export/JimboNFS/School"; fsType = "nfs4"; options = [ "x-systemd.automount" "_netdev" "nofail" "noauto" ]; }; }; - # Set the swap partition swapDevices = [ { device = "/dev/disk/by-uuid/1a6a68d0-8ae7-4836-a585-b708597937a1"; } ]; - # Enables DHCP on each ethernet and wireless interface. networking.useDHCP = lib.mkDefault true; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; diff --git a/hosts/lacros/home/default.nix b/hosts/lacros/home/default.nix new file mode 100644 index 00000000..b51a8c87 --- /dev/null +++ b/hosts/lacros/home/default.nix @@ -0,0 +1,22 @@ +{ config, nur, ... }: +{ + imports = [ + # Apps and programs + ../../../modules/home + ../../../modules/home/users + ../../../modules/home/files + ../../../modules/home/settings + ../../../modules/home/programs + ../../../modules/home/programs/misc/remote-desktop + ../../../modules/home/sway + ../../../modules/home/utils + + # Misc + ../../../overlays + ../../../variables + ../../../variables/look/colors/orange + + # Imports + nur.nixosModules.nur + ]; +} diff --git a/hosts/lacros/id_ed25519.pub b/hosts/lacros/id_ed25519.pub new file mode 100644 index 00000000..84c223ca --- /dev/null +++ b/hosts/lacros/id_ed25519.pub @@ -0,0 +1 @@ +ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBk6ALxn+zKrRys6/c1oYSoWJaUUEo3nAM224ElhjJQR jimbo@lacros diff --git a/hosts/lacros/system/boot/default.nix b/hosts/lacros/system/boot/default.nix new file mode 100644 index 00000000..8b5e01f6 --- /dev/null +++ b/hosts/lacros/system/boot/default.nix @@ -0,0 +1,17 @@ +{ ... }: +{ + boot = { + kernelPackages = pkgs.linuxPackages_latest; + kernel.sysctl."vm.max_map_count" = 2147483642; + initrd = { + systemd.enable = true; + luks.devices = { + crypt-mmc = { + device = "/dev/disk/by-uuid/5906e176-7ad3-41e5-bc45-ae65664eb10c"; + preLVM = true; + allowDiscards = true; + }; + }; + }; + }; +} diff --git a/hosts/lacros/system/default.nix b/hosts/lacros/system/default.nix new file mode 100644 index 00000000..5e8628fc --- /dev/null +++ b/hosts/lacros/system/default.nix @@ -0,0 +1,34 @@ +{ config, lib, ... }: +{ + imports = [ + ./hardware + ./boot + + # Apps and programs + ../../../modules/system + ../../../modules/system/accounts + ../../../modules/system/desktop + ../../../modules/system/programs + ../../../modules/system/services + + # Devices and hardware + ../../../modules/system/devices + ../../../modules/system/devices/boot/lanzaboote + ../../../modules/system/devices/networking/wireless + ../../../modules/system/devices/networking/firewall/pc + ../../../modules/system/devices/networking/wireguard/pc + + # Extras + ../../../overlays + ../../../variables + ]; + + services.keyd.keyboards.default.settings.main = { + leftmeta = lib.mkForce "overload(control, esc)"; + leftcontrol = lib.mkForce "leftmeta"; + f13 = lib.mkForce "delete"; + }; + + networking.hostName = "lacros"; + networking.wireguard.interfaces."${config.ips.wgInt}".ips = [ "${config.ips.wgSpan}.18/24" ]; +} diff --git a/hosts/lacros/system/hardware/default.nix b/hosts/lacros/system/hardware/default.nix new file mode 100644 index 00000000..4b3b692a --- /dev/null +++ b/hosts/lacros/system/hardware/default.nix @@ -0,0 +1,63 @@ +{ config, lib, modulesPath, ... }: + +{ + imports = [ + (modulesPath + "/installer/scan/not-detected.nix") + ]; + + boot = { + initrd = { + availableKernelModules = [ "xhci_pci" "sdhci_pci" ]; + kernelModules = [ "dm-snapshot" ]; + }; + kernelModules = [ "kvm-intel" ]; + }; + + fileSystems = { + "/" = { + device = "/dev/disk/by-uuid/e8c9c5a8-4df0-4100-8de6-f08a1a774fad"; + fsType = "btrfs"; + options = [ "subvol=@" "noatime" "nodiratime" "discard" ]; + }; + "/nix" = { + device = "/dev/disk/by-uuid/e8c9c5a8-4df0-4100-8de6-f08a1a774fad"; + fsType = "btrfs"; + options = [ "subvol=@nix" "noatime" "nodiratime" "discard" ]; + }; + "/var" = { + device = "/dev/disk/by-uuid/e8c9c5a8-4df0-4100-8de6-f08a1a774fad"; + fsType = "btrfs"; + options = [ "subvol=@var" "noatime" "nodiratime" "discard" ]; + }; + "/.snapshots" = { + device = "/dev/disk/by-uuid/e8c9c5a8-4df0-4100-8de6-f08a1a774fad"; + fsType = "btrfs"; + options = [ "subvol=@snapshots" "noatime" "nodiratime" "discard" ]; + }; + "/home" = { + device = "/dev/disk/by-uuid/e8c9c5a8-4df0-4100-8de6-f08a1a774fad"; + fsType = "btrfs"; + options = [ "subvol=@home" "noatime" "nodiratime" "discard" ]; + }; + "/boot" = { + device = "/dev/disk/by-uuid/1C76-1006"; + fsType = "vfat"; + options = [ "fmask=0022" "dmask=0022" ]; + }; + + # Remote + "/home/jimbo/JimboNFS" = { + device = "${config.ips.wgSpan}.1:/export/JimboNFS"; + fsType = "nfs4"; + options = ["x-systemd.automount" "_netdev" "nofail" "noauto"]; + }; + }; + + swapDevices = [ + { device = "/dev/disk/by-uuid/54a9cc22-4a2c-4e04-a968-313c34481489"; } + ]; + + networking.useDHCP = lib.mkDefault true; + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/hosts/redmond/home/default.nix b/hosts/redmond/home/default.nix new file mode 100644 index 00000000..b8ab842b --- /dev/null +++ b/hosts/redmond/home/default.nix @@ -0,0 +1,24 @@ +{ config, nur, ... }: +{ + imports = [ + # Apps and programs + ../../../modules/home + ../../../modules/home/users + ../../../modules/home/files + ../../../modules/home/settings + ../../../modules/home/programs + ../../../modules/home/programs/misc/production + ../../../modules/home/programs/misc/gaming/launchers + ../../../modules/home/programs/misc/remote-desktop + ../../../modules/home/sway + ../../../modules/home/utils + + # Misc + ../../../overlays + ../../../variables + ../../../variables/look/colors/green + + # Imports + nur.nixosModules.nur + ]; +} diff --git a/hosts/redmond/id_ed25519.pub b/hosts/redmond/id_ed25519.pub new file mode 100644 index 00000000..0978bb17 --- /dev/null +++ b/hosts/redmond/id_ed25519.pub @@ -0,0 +1 @@ +ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIG9uITpyw5WgxT7UnswueFtyWxAqQCZv4h9DfcDkr+kn jimbo@nixos diff --git a/hosts/redmond/system/boot/default.nix b/hosts/redmond/system/boot/default.nix new file mode 100644 index 00000000..80224164 --- /dev/null +++ b/hosts/redmond/system/boot/default.nix @@ -0,0 +1,7 @@ +{ pkgs, ... }: +{ + boot = { + kernelPackages = pkgs.linuxPackages_latest; + kernel.sysctl."vm.max_map_count" = 2147483642; + }; +} diff --git a/hosts/redmond/system/default.nix b/hosts/redmond/system/default.nix new file mode 100644 index 00000000..d1a1cd8a --- /dev/null +++ b/hosts/redmond/system/default.nix @@ -0,0 +1,28 @@ +{ config, ... }: +{ + imports = [ + ./hardware + ./boot + + # Apps and programs + ../../../modules/system + ../../../modules/system/accounts + ../../../modules/system/desktop + ../../../modules/system/programs + ../../../modules/system/services + + # Devices and hardware + ../../../modules/system/devices + ../../../modules/system/devices/boot/systemd + ../../../modules/system/devices/networking/wireless + ../../../modules/system/devices/networking/firewall/pc + ../../../modules/system/devices/networking/wireguard/pc + + # Extras + ../../../overlays + ../../../variables + ]; + + networking.hostName = "redmond"; + networking.wireguard.interfaces."${config.ips.wgInt}".ips = [ "${config.ips.wgSpan}.20/24" ]; +} diff --git a/system/hosts/JimLenovo/hardware-configuration.nix b/hosts/redmond/system/hardware/default.nix similarity index 55% rename from system/hosts/JimLenovo/hardware-configuration.nix rename to hosts/redmond/system/hardware/default.nix index be3a8b47..4b1d568d 100644 --- a/system/hosts/JimLenovo/hardware-configuration.nix +++ b/hosts/redmond/system/hardware/default.nix @@ -1,32 +1,24 @@ -{ config, lib, pkgs, modulesPath, ... }: { +{ config, lib, pkgs, modulesPath, ... }: +{ imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; - # Set all boot options boot = { - # Set a kernel version and load/blacklist drivers - kernelPackages = pkgs.linuxPackages_zen; - blacklistedKernelModules = [ - "pcspkr" - ]; - kernel.sysctl."vm.max_map_count" = 2147483642; initrd = { availableKernelModules = [ - "nvme" - "xhci_pci" - "usbhid" - "usb_storage" - "sd_mod" - "sdhci_pci" - ]; - kernelModules = [ - "kvm-amd" + "xhci_pci" + "ahci" + "ehci_pci" + "sd_mod" + "sr_mod" + "sdhci_pci" + "rtsx_usb_sdmmc" ]; }; + kernelModules = [ "kvm-amd" ]; }; - # Mount everything as necessary fileSystems = { "/" = { device = "/dev/disk/by-uuid/c0fe8419-88f9-48a0-8c5b-acd4c11f8037"; @@ -37,11 +29,14 @@ fsType = "vfat"; options = [ "fmask=0022" "dmask=0022" ]; }; + "/home/jimbo/JimboNFS" = { + device = "${config.ips.wgSpan}.1:/export/JimboNFS"; + fsType = "nfs4"; + options = ["x-systemd.automount" "_netdev" "nofail" "noauto"]; + }; }; - # Enables DHCP on each ethernet and wireless interface. networking.useDHCP = lib.mkDefault true; - nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; } diff --git a/hosts/shuttleworth/home/default.nix b/hosts/shuttleworth/home/default.nix new file mode 100644 index 00000000..bb9098cd --- /dev/null +++ b/hosts/shuttleworth/home/default.nix @@ -0,0 +1,28 @@ +{ config, pkgs, nur, ... }: +{ + imports = [ + # Apps and programs + ../../../modules/home + ../../../modules/home/users + ../../../modules/home/files + ../../../modules/home/settings + ../../../modules/home/programs + ../../../modules/home/programs/misc/remote-desktop + ../../../modules/home/sway + ../../../modules/home/utils + + # Misc + ../../../overlays + ../../../variables + ../../../variables/look/colors/purple + + # Imports + nur.nixosModules.nur + ]; + + home.packages = with pkgs; [ + alsa-utils + ]; + + wayland.windowManager.sway.config.output.${config.displays.dI}.scale = "1.3"; +} diff --git a/hosts/shuttleworth/id_ed25519.pub b/hosts/shuttleworth/id_ed25519.pub new file mode 100644 index 00000000..3d0e0ec3 --- /dev/null +++ b/hosts/shuttleworth/id_ed25519.pub @@ -0,0 +1 @@ +ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIK+L723mCLy9/9UAXwkY3+06Oq22dOj+lDnA0lMLbrsR diff --git a/hosts/shuttleworth/system/boot/default.nix b/hosts/shuttleworth/system/boot/default.nix new file mode 100644 index 00000000..80224164 --- /dev/null +++ b/hosts/shuttleworth/system/boot/default.nix @@ -0,0 +1,7 @@ +{ pkgs, ... }: +{ + boot = { + kernelPackages = pkgs.linuxPackages_latest; + kernel.sysctl."vm.max_map_count" = 2147483642; + }; +} diff --git a/hosts/shuttleworth/system/default.nix b/hosts/shuttleworth/system/default.nix new file mode 100644 index 00000000..06ca1a71 --- /dev/null +++ b/hosts/shuttleworth/system/default.nix @@ -0,0 +1,32 @@ +{ config, lib, hardware, ... }: +{ + imports = [ + ./hardware + ./boot + + # Apps and programs + ../../../modules/system + ../../../modules/system/accounts + ../../../modules/system/desktop + ../../../modules/system/programs + ../../../modules/system/services + + # Devices and hardware + ../../../modules/system/devices + ../../../modules/system/devices/boot/extlinux + ../../../modules/system/devices/networking/wireless + ../../../modules/system/devices/networking/firewall/pc + ../../../modules/system/devices/networking/wireguard/pc + + # Extras + ../../../overlays + ../../../variables + + # Imports + hardware.nixosModules.pine64-pinebook-pro + ]; + + networking.hostName = "shuttleworth"; + hardware.opengl.driSupport32Bit = lib.mkForce false; + networking.wireguard.interfaces."${config.ips.wgInt}".ips = [ "${config.ips.wgSpan}.17/24" ]; +} diff --git a/system/hosts/JimPine/hardware-configuration.nix b/hosts/shuttleworth/system/hardware/default.nix similarity index 76% rename from system/hosts/JimPine/hardware-configuration.nix rename to hosts/shuttleworth/system/hardware/default.nix index 6dcf9420..2de1890b 100644 --- a/system/hosts/JimPine/hardware-configuration.nix +++ b/hosts/shuttleworth/system/hardware/default.nix @@ -1,5 +1,4 @@ -{ config, outputs, lib, pkgs, modulesPath, ... }: - +{ config, lib, pkgs, modulesPath, ... }: { imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; @@ -28,12 +27,7 @@ fsType = "btrfs"; }; "/home/jimbo/JimboNFS" = { - device = "${outputs.ips.wgSpan}.1:/export/JimboNFS"; - fsType = "nfs4"; - options = ["x-systemd.automount" "_netdev" "nofail" "noauto"]; - }; - "/home/jimbo/FreecornNFS" = { - device = "${outputs.secrets.cornIP}:/export/freecornNFS"; + device = "${config.ips.wgSpan}.1:/export/JimboNFS"; fsType = "nfs4"; options = ["x-systemd.automount" "_netdev" "nofail" "noauto"]; }; diff --git a/modules/home/default.nix b/modules/home/default.nix new file mode 100644 index 00000000..1feed841 --- /dev/null +++ b/modules/home/default.nix @@ -0,0 +1,6 @@ +{ ... }: +{ + programs.home-manager.enable = true; + nixpkgs.config.allowUnfree = true; + home.stateVersion = "24.05"; +} diff --git a/home/assets/wallpapers/lock.png b/modules/home/files/assets/lockscreens/holymoly/lock.png similarity index 100% rename from home/assets/wallpapers/lock.png rename to modules/home/files/assets/lockscreens/holymoly/lock.png diff --git a/home/assets/user-icon.png b/modules/home/files/assets/pfp.png similarity index 100% rename from home/assets/user-icon.png rename to modules/home/files/assets/pfp.png diff --git a/modules/home/files/assets/wallpapers/dogmatica/1.png b/modules/home/files/assets/wallpapers/dogmatica/1.png new file mode 100644 index 00000000..40f21e79 Binary files /dev/null and b/modules/home/files/assets/wallpapers/dogmatica/1.png differ diff --git a/modules/home/files/assets/wallpapers/dogmatica/2.png b/modules/home/files/assets/wallpapers/dogmatica/2.png new file mode 100644 index 00000000..42d7de1e Binary files /dev/null and b/modules/home/files/assets/wallpapers/dogmatica/2.png differ diff --git a/modules/home/files/assets/wallpapers/dogmatica/3.png b/modules/home/files/assets/wallpapers/dogmatica/3.png new file mode 100644 index 00000000..029ec5fb Binary files /dev/null and b/modules/home/files/assets/wallpapers/dogmatica/3.png differ diff --git a/modules/home/files/assets/wallpapers/hillorange/1.png b/modules/home/files/assets/wallpapers/hillorange/1.png new file mode 100644 index 00000000..0ed3607a Binary files /dev/null and b/modules/home/files/assets/wallpapers/hillorange/1.png differ diff --git a/modules/home/files/assets/wallpapers/hillorange/2.png b/modules/home/files/assets/wallpapers/hillorange/2.png new file mode 100644 index 00000000..5dfc477b Binary files /dev/null and b/modules/home/files/assets/wallpapers/hillorange/2.png differ diff --git a/modules/home/files/assets/wallpapers/hillorange/3.png b/modules/home/files/assets/wallpapers/hillorange/3.png new file mode 100644 index 00000000..85dbbea7 Binary files /dev/null and b/modules/home/files/assets/wallpapers/hillorange/3.png differ diff --git a/modules/home/files/assets/wallpapers/leaves/1.png b/modules/home/files/assets/wallpapers/leaves/1.png new file mode 100644 index 00000000..8ec765b9 Binary files /dev/null and b/modules/home/files/assets/wallpapers/leaves/1.png differ diff --git a/modules/home/files/assets/wallpapers/leaves/2.png b/modules/home/files/assets/wallpapers/leaves/2.png new file mode 100644 index 00000000..69a45680 Binary files /dev/null and b/modules/home/files/assets/wallpapers/leaves/2.png differ diff --git a/modules/home/files/assets/wallpapers/leaves/3.png b/modules/home/files/assets/wallpapers/leaves/3.png new file mode 100644 index 00000000..3312d139 Binary files /dev/null and b/modules/home/files/assets/wallpapers/leaves/3.png differ diff --git a/home/assets/wallpapers/1.png b/modules/home/files/assets/wallpapers/purplespace/1.png similarity index 100% rename from home/assets/wallpapers/1.png rename to modules/home/files/assets/wallpapers/purplespace/1.png diff --git a/home/assets/wallpapers/2.png b/modules/home/files/assets/wallpapers/purplespace/2.png similarity index 100% rename from home/assets/wallpapers/2.png rename to modules/home/files/assets/wallpapers/purplespace/2.png diff --git a/home/assets/wallpapers/3.png b/modules/home/files/assets/wallpapers/purplespace/3.png similarity index 100% rename from home/assets/wallpapers/3.png rename to modules/home/files/assets/wallpapers/purplespace/3.png diff --git a/modules/home/files/default.nix b/modules/home/files/default.nix new file mode 100644 index 00000000..e640b39b --- /dev/null +++ b/modules/home/files/default.nix @@ -0,0 +1,22 @@ +{ pkgs, config, ... }: { + home.file = { + "VMs" = { + source = config.lib.file.mkOutOfStoreSymlink "/etc/libvirt/VMs"; + }; + ".face" = { + source = ./assets/pfp.png; + }; + ".assets/wallpapers" = { + source = ./assets/wallpapers/${config.look.colors.wallpapers}; + }; + ".assets/lockscreen" = { + source = ./assets/lockscreens/holymoly; + }; + ".icons/default" = { + source = "${pkgs.simp1e-cursors}/share/icons/Simp1e-Dark"; + }; + ".alsoftrc" = { + text = ''drivers=pulse''; + }; + }; +} diff --git a/modules/home/programs/default.nix b/modules/home/programs/default.nix new file mode 100644 index 00000000..023aaf79 --- /dev/null +++ b/modules/home/programs/default.nix @@ -0,0 +1,8 @@ +{ ... }: +{ + imports = [ + ./gui + ./terminal + ./misc + ]; +} diff --git a/modules/home/programs/gui/default.nix b/modules/home/programs/gui/default.nix new file mode 100644 index 00000000..fefac514 --- /dev/null +++ b/modules/home/programs/gui/default.nix @@ -0,0 +1,13 @@ +{ ... }: +{ + imports = [ + ./easyeffects + ./foot + ./librewolf + ./mako + ./mangohud + ./mpv + ./pcmanfm-qt + ./rofi + ]; +} diff --git a/modules/home/programs/gui/easyeffects/JimHeadphones.json b/modules/home/programs/gui/easyeffects/JimHeadphones.json new file mode 100644 index 00000000..1a075ae1 --- /dev/null +++ b/modules/home/programs/gui/easyeffects/JimHeadphones.json @@ -0,0 +1,294 @@ +{ + "output": { + "blocklist": [], + "crystalizer#0": { + "band0": { + "bypass": false, + "intensity": 0.0, + "mute": false + }, + "band1": { + "bypass": false, + "intensity": -1.0, + "mute": false + }, + "band2": { + "bypass": false, + "intensity": -2.0, + "mute": false + }, + "band3": { + "bypass": false, + "intensity": -3.0, + "mute": false + }, + "band4": { + "bypass": false, + "intensity": -4.0, + "mute": false + }, + "band5": { + "bypass": false, + "intensity": -5.0, + "mute": false + }, + "band6": { + "bypass": false, + "intensity": -6.0, + "mute": false + }, + "band7": { + "bypass": false, + "intensity": -7.0, + "mute": false + }, + "band8": { + "bypass": false, + "intensity": -8.0, + "mute": false + }, + "band9": { + "bypass": false, + "intensity": -9.0, + "mute": false + }, + "band10": { + "bypass": false, + "intensity": -10.0, + "mute": false + }, + "band11": { + "bypass": false, + "intensity": -11.0, + "mute": false + }, + "band12": { + "bypass": false, + "intensity": -12.0, + "mute": false + }, + "bypass": false, + "input-gain": 0.0, + "output-gain": 0.0 + }, + "equalizer#0": { + "balance": 0.0, + "bypass": false, + "input-gain": 0.0, + "left": { + "band0": { + "frequency": 32.0, + "gain": 1.1, + "mode": "RLC (BT)", + "mute": false, + "q": 4.36, + "slope": "x1", + "solo": false, + "type": "Bell" + }, + "band1": { + "frequency": 64.0, + "gain": 1.16, + "mode": "RLC (BT)", + "mute": false, + "q": 4.36, + "slope": "x1", + "solo": false, + "type": "Bell" + }, + "band2": { + "frequency": 125.0, + "gain": 3.33, + "mode": "RLC (BT)", + "mute": false, + "q": 4.36, + "slope": "x1", + "solo": false, + "type": "Bell" + }, + "band3": { + "frequency": 250.0, + "gain": 1.53, + "mode": "RLC (BT)", + "mute": false, + "q": 4.36, + "slope": "x1", + "solo": false, + "type": "Bell" + }, + "band4": { + "frequency": 500.0, + "gain": -1.83, + "mode": "RLC (BT)", + "mute": false, + "q": 4.36, + "slope": "x1", + "solo": false, + "type": "Bell" + }, + "band5": { + "frequency": 1000.0, + "gain": -0.58, + "mode": "RLC (BT)", + "mute": false, + "q": 4.36, + "slope": "x1", + "solo": false, + "type": "Bell" + }, + "band6": { + "frequency": 2000.0, + "gain": 1.42, + "mode": "RLC (BT)", + "mute": false, + "q": 4.36, + "slope": "x1", + "solo": false, + "type": "Bell" + }, + "band7": { + "frequency": 4000.0, + "gain": 4.73, + "mode": "RLC (BT)", + "mute": false, + "q": 4.36, + "slope": "x1", + "solo": false, + "type": "Bell" + }, + "band8": { + "frequency": 16000.0, + "gain": 7.62, + "mode": "RLC (BT)", + "mute": false, + "q": 4.36, + "slope": "x1", + "solo": false, + "type": "Bell" + }, + "band9": { + "frequency": 156.38, + "gain": 2.84, + "mode": "RLC (BT)", + "mute": false, + "q": 4.36, + "slope": "x1", + "solo": false, + "type": "Bell" + } + }, + "mode": "IIR", + "num-bands": 10, + "output-gain": 0.0, + "pitch-left": 0.0, + "pitch-right": 0.0, + "right": { + "band0": { + "frequency": 32.0, + "gain": 1.1, + "mode": "RLC (BT)", + "mute": false, + "q": 4.36, + "slope": "x1", + "solo": false, + "type": "Bell" + }, + "band1": { + "frequency": 64.0, + "gain": 1.16, + "mode": "RLC (BT)", + "mute": false, + "q": 4.36, + "slope": "x1", + "solo": false, + "type": "Bell" + }, + "band2": { + "frequency": 125.0, + "gain": 3.33, + "mode": "RLC (BT)", + "mute": false, + "q": 4.36, + "slope": "x1", + "solo": false, + "type": "Bell" + }, + "band3": { + "frequency": 250.0, + "gain": 1.53, + "mode": "RLC (BT)", + "mute": false, + "q": 4.36, + "slope": "x1", + "solo": false, + "type": "Bell" + }, + "band4": { + "frequency": 500.0, + "gain": -1.83, + "mode": "RLC (BT)", + "mute": false, + "q": 4.36, + "slope": "x1", + "solo": false, + "type": "Bell" + }, + "band5": { + "frequency": 1000.0, + "gain": -0.58, + "mode": "RLC (BT)", + "mute": false, + "q": 4.36, + "slope": "x1", + "solo": false, + "type": "Bell" + }, + "band6": { + "frequency": 2000.0, + "gain": 1.42, + "mode": "RLC (BT)", + "mute": false, + "q": 4.36, + "slope": "x1", + "solo": false, + "type": "Bell" + }, + "band7": { + "frequency": 4000.0, + "gain": 4.73, + "mode": "RLC (BT)", + "mute": false, + "q": 4.36, + "slope": "x1", + "solo": false, + "type": "Bell" + }, + "band8": { + "frequency": 16000.0, + "gain": 7.62, + "mode": "RLC (BT)", + "mute": false, + "q": 4.36, + "slope": "x1", + "solo": false, + "type": "Bell" + }, + "band9": { + "frequency": 156.38, + "gain": 2.84, + "mode": "RLC (BT)", + "mute": false, + "q": 4.36, + "slope": "x1", + "solo": false, + "type": "Bell" + } + }, + "split-channels": false + }, + "plugins_order": [ + "equalizer#0", + "crystalizer#0" + ] + } +} diff --git a/modules/home/programs/gui/easyeffects/default.nix b/modules/home/programs/gui/easyeffects/default.nix new file mode 100644 index 00000000..817b42d2 --- /dev/null +++ b/modules/home/programs/gui/easyeffects/default.nix @@ -0,0 +1,11 @@ +{ pkgs, ... }: +{ + home = { + packages = with pkgs; [ + easyeffects + ]; + file = { + ".config/easyeffects/output/JimHeadphones.json".source = ./JimHeadphones.json; + }; + }; +} diff --git a/home/programs/foot.nix b/modules/home/programs/gui/foot/default.nix similarity index 80% rename from home/programs/foot.nix rename to modules/home/programs/gui/foot/default.nix index 73d8a1c2..13d396e1 100644 --- a/home/programs/foot.nix +++ b/modules/home/programs/gui/foot/default.nix @@ -1,19 +1,19 @@ -{outputs, ...}: { - # Enable a terminal emulator +{ config, ... }: +{ programs.foot = { enable = true; server.enable = false; settings = { main = { term = "xterm-256color"; - font = "${outputs.look.fonts.nerd}:size=14.7"; + font = "${config.look.fonts.nerd}:size=14.7"; }; cursor = { style = "beam"; }; colors = { - alpha = "0.65"; - background = "${outputs.look.colors.dark}"; + alpha = "0.85"; + background = "${config.look.colors.dark}"; regular0 = "3f3f3f"; regular1 = "cc0000"; regular2 = "4e9a06"; diff --git a/home/programs/librewolf.nix b/modules/home/programs/gui/librewolf/default.nix similarity index 90% rename from home/programs/librewolf.nix rename to modules/home/programs/gui/librewolf/default.nix index 31b9ca14..83f1ef29 100644 --- a/home/programs/librewolf.nix +++ b/modules/home/programs/gui/librewolf/default.nix @@ -1,30 +1,31 @@ -{pkgs, config, outputs, ...}: let - # FireFox colors +{ pkgs, config, ... }: +let + # FireFox colors, based on https://github.com/Dook97/firefox-qutebrowser-userchrome themeJim = '' :root { - --tab-active-bg-color: #${outputs.look.colors.prime}; - --tab-hover-bg-color: #${outputs.look.colors.accent}; - --tab-inactive-bg-color: #${outputs.look.colors.dark}; + --tab-active-bg-color: #${config.look.colors.prime}; + --tab-hover-bg-color: #${config.look.colors.accent}; + --tab-inactive-bg-color: #${config.look.colors.dark}; --tab-active-fg-fallback-color: #FFFFFF; - --tab-inactive-fg-fallback-color: #${outputs.look.colors.text}; - --urlbar-focused-bg-color: #${outputs.look.colors.dark}; - --urlbar-not-focused-bg-color: #${outputs.look.colors.dark}; - --toolbar-bgcolor: #${outputs.look.colors.dark} !important; + --tab-inactive-fg-fallback-color: #${config.look.colors.text}; + --urlbar-focused-bg-color: #${config.look.colors.dark}; + --urlbar-not-focused-bg-color: #${config.look.colors.dark}; + --toolbar-bgcolor: #${config.look.colors.dark} !important; ''; themeAlt = '' :root { - --tab-active-bg-color: #${outputs.look.colors.dark}; - --tab-hover-bg-color: #${outputs.look.colors.accent}; - --tab-inactive-bg-color: #${outputs.look.colors.prime}; - --tab-active-fg-fallback-color: #${outputs.look.colors.text}; + --tab-active-bg-color: #${config.look.colors.dark}; + --tab-hover-bg-color: #${config.look.colors.accent}; + --tab-inactive-bg-color: #${config.look.colors.prime}; + --tab-active-fg-fallback-color: #${config.look.colors.text}; --tab-inactive-fg-fallback-color: #FFFFFF; - --urlbar-focused-bg-color: #${outputs.look.colors.prime}; - --urlbar-not-focused-bg-color: #${outputs.look.colors.prime}; - --toolbar-bgcolor: #${outputs.look.colors.prime} !important; + --urlbar-focused-bg-color: #${config.look.colors.prime}; + --urlbar-not-focused-bg-color: #${config.look.colors.prime}; + --toolbar-bgcolor: #${config.look.colors.prime} !important; ''; quteFoxCSS = '' - --tab-font: '${outputs.look.fonts.main}'; - --urlbar-font: '${outputs.look.fonts.main}'; + --tab-font: '${config.look.fonts.main}'; + --urlbar-font: '${config.look.fonts.main}'; /* try increasing if you encounter problems */ --urlbar-height-setting: 24px; @@ -335,9 +336,9 @@ in { }; }; commonSettings = { - "font.name.serif.x-western" = "${outputs.look.fonts.main}"; - "font.name.sans-serif.x-western" = "${outputs.look.fonts.main}"; - "font.name.monospace.x-western" = "${outputs.look.fonts.nerd}"; + "font.name.serif.x-western" = "${config.look.fonts.main}"; + "font.name.sans-serif.x-western" = "${config.look.fonts.main}"; + "font.name.monospace.x-western" = "${config.look.fonts.nerd}"; "general.autoScroll" = true; "browser.compactmode.show" = true; "browser.uidensity" = 1; diff --git a/home/services/mako.nix b/modules/home/programs/gui/mako/default.nix similarity index 76% rename from home/services/mako.nix rename to modules/home/programs/gui/mako/default.nix index 050bdf34..c818efcf 100644 --- a/home/services/mako.nix +++ b/modules/home/programs/gui/mako/default.nix @@ -1,23 +1,22 @@ -{pkgs, outputs, ...}: { - # Notification daemon +{ pkgs, config, ... }: +{ services.mako = { enable = true; - borderColor = "#${outputs.look.colors.accent}"; - backgroundColor = "#${outputs.look.colors.dark}CC"; - output = "${outputs.displays.d1}"; + borderColor = "#${config.look.colors.accent}"; + backgroundColor = "#${config.look.colors.dark}D9"; + output = "${config.displays.d1}"; sort = "+time"; layer = "overlay"; padding = "8"; margin = "0"; - borderSize = outputs.look.border.int; + borderSize = config.look.border.int; maxIconSize = 40; defaultTimeout = 6000; - font = "${outputs.look.fonts.main} 12"; + font = "${config.look.fonts.main} 12"; anchor = "bottom-right"; extraConfig = "on-button-right=dismiss-all\nouter-margin=10\n[mode=do-not-disturb]\ninvisible=1"; }; - # Script to toggle notifications using mako home.packages = let makoToggle = pkgs.writeScriptBin "makotoggle" '' # Run makoctl mode and store the output in a variable diff --git a/home/programs/mangohud.nix b/modules/home/programs/gui/mangohud/default.nix similarity index 76% rename from home/programs/mangohud.nix rename to modules/home/programs/gui/mangohud/default.nix index f7160d73..4ce3b0d7 100644 --- a/home/programs/mangohud.nix +++ b/modules/home/programs/gui/mangohud/default.nix @@ -1,11 +1,11 @@ -{pkgs, ...}: { +{ pkgs, ... }: +{ home = { packages = with pkgs; [ mangohud ]; - file = let - # Mangohud config file - mangoConf = '' + file = { + ".config/MangoHud/MangoHud.conf".text = '' table_columns=2 frametime=0 legacy_layout=0 @@ -24,9 +24,6 @@ gpu_load_change frame_timing ''; - in { - # Mangohud config - ".config/MangoHud/MangoHud.conf".text = mangoConf; }; }; } diff --git a/home/programs/mpv.nix b/modules/home/programs/gui/mpv/default.nix similarity index 88% rename from home/programs/mpv.nix rename to modules/home/programs/gui/mpv/default.nix index 0fec58b4..1e9e4d45 100644 --- a/home/programs/mpv.nix +++ b/modules/home/programs/gui/mpv/default.nix @@ -1,5 +1,5 @@ +{ ... }: { - # MPV settings programs.mpv = { enable = true; config = { diff --git a/home/programs/pcmanfm-qt.nix b/modules/home/programs/gui/pcmanfm-qt/default.nix similarity index 83% rename from home/programs/pcmanfm-qt.nix rename to modules/home/programs/gui/pcmanfm-qt/default.nix index e8e4838c..ff6ee82c 100644 --- a/home/programs/pcmanfm-qt.nix +++ b/modules/home/programs/gui/pcmanfm-qt/default.nix @@ -1,12 +1,12 @@ -{pkgs, ...}: { - # Swappy config file +{ pkgs, ... }: +{ home = { packages = with pkgs; [ pcmanfm-qt + gnome.file-roller ]; - file = let - # File manager config - pcmanConf = '' + file = { + ".config/pcmanfm-qt/default/settings.conf".text = '' [Behavior] BookmarkOpenMethod=current_tab ConfirmDelete=true @@ -53,9 +53,6 @@ SwitchToNewTab=true TabPaths=@Invalid() ''; - in { - # PCManFM config - ".config/pcmanfm-qt/default/settings.conf".text = pcmanConf; }; }; } diff --git a/home/programs/rofi.nix b/modules/home/programs/gui/rofi/default.nix similarity index 77% rename from home/programs/rofi.nix rename to modules/home/programs/gui/rofi/default.nix index f84a2c33..a46ab78a 100644 --- a/home/programs/rofi.nix +++ b/modules/home/programs/gui/rofi/default.nix @@ -1,10 +1,10 @@ -{pkgs, config, outputs, ...}: { - # Enable Rofi +{ pkgs, config, ... }: +{ programs.rofi = { enable = true; package = pkgs.rofi-wayland; terminal = "foot"; - font = "${outputs.look.fonts.main} 14"; + font = "${config.look.fonts.main} 14"; theme = let inherit (config.lib.formats.rasi) mkLiteral; in { @@ -15,24 +15,24 @@ red = mkLiteral "#DC322F"; background-color = mkLiteral "#00000000"; separatorcolor = mkLiteral "#00000000"; - normal-foreground = mkLiteral "#${outputs.look.colors.text}"; - normal-background = mkLiteral "#${outputs.look.colors.dark}1A"; - urgent-foreground = mkLiteral "#${outputs.look.colors.urgent}"; - active-foreground = mkLiteral "#${outputs.look.colors.split}"; - selected-active-foreground = mkLiteral "#${outputs.look.colors.prime}"; - background = mkLiteral "#${outputs.look.colors.dark}B3"; - bordercolor = mkLiteral "#${outputs.look.colors.prime}"; + normal-foreground = mkLiteral "#${config.look.colors.text}"; + normal-background = mkLiteral "#${config.look.colors.dark}1A"; + urgent-foreground = mkLiteral "#${config.look.colors.urgent}"; + active-foreground = mkLiteral "#${config.look.colors.split}"; + selected-active-foreground = mkLiteral "#${config.look.colors.prime}"; + background = mkLiteral "#${config.look.colors.dark}D9"; + bordercolor = mkLiteral "#${config.look.colors.prime}"; selected-normal-foreground = mkLiteral "#FFFFFF"; - selected-normal-background = mkLiteral "#${outputs.look.colors.prime}80"; - border-color = mkLiteral "#${outputs.look.colors.prime}"; - urgent-background = mkLiteral "#${outputs.look.colors.accent}26"; - active-background = mkLiteral "#${outputs.look.colors.accent}26"; - selected-active-background = mkLiteral "#${outputs.look.colors.split}54"; + selected-normal-background = mkLiteral "#${config.look.colors.prime}80"; + border-color = mkLiteral "#${config.look.colors.prime}"; + urgent-background = mkLiteral "#${config.look.colors.accent}26"; + active-background = mkLiteral "#${config.look.colors.accent}26"; + selected-active-background = mkLiteral "#${config.look.colors.split}54"; }; "#window" = { background-color = mkLiteral "@background"; width = 500; - border = mkLiteral "${outputs.look.border.string}"; + border = mkLiteral "${config.look.border.string}"; padding = 5; }; "#message" = { @@ -124,7 +124,7 @@ }; }; home.packages = let - # All my rofi scripts in one file + # A script to execute commands with Rofi rofiScripts = pkgs.writeScriptBin "rofiscripts" '' # Scratchpad function handle_scratchpads() { @@ -155,13 +155,13 @@ case $RET in Default) swaymsg reload ;; Wide) swaymsg " - output ${outputs.displays.d1} enable pos 1680 0 mode 1680x1050@59.954Hz - output ${outputs.displays.d2} enable pos 0 0 mode 1680x1050@59.954Hz - output ${outputs.displays.d3} enable pos 3360 0 transform 0 + output ${config.displays.d1} enable pos 1680 0 mode 1680x1050@59.954Hz + output ${config.displays.d2} enable pos 0 0 mode 1680x1050@59.954Hz + output ${config.displays.d3} enable pos 3360 0 transform 0 ";; GPU2) swaymsg " - output ${outputs.displays.d2} enable pos 1680 0 mode 1920x1080@60Hz - output ${outputs.displays.d3} enable pos 0 0 transform 0 + output ${config.displays.d2} enable pos 1680 0 mode 1920x1080@60Hz + output ${config.displays.d3} enable pos 0 0 transform 0 ";; esac } diff --git a/home/misc/avtools.nix b/modules/home/programs/misc/avtools/default.nix similarity index 85% rename from home/misc/avtools.nix rename to modules/home/programs/misc/avtools/default.nix index baffc4b3..c4d6f093 100644 --- a/home/misc/avtools.nix +++ b/modules/home/programs/misc/avtools/default.nix @@ -1,4 +1,5 @@ -{pkgs, ...}: { +{ pkgs, ... }: +{ home.packages = with pkgs; [ yt-dlp spotdl diff --git a/modules/home/programs/misc/chat/default.nix b/modules/home/programs/misc/chat/default.nix new file mode 100644 index 00000000..aea297b6 --- /dev/null +++ b/modules/home/programs/misc/chat/default.nix @@ -0,0 +1,7 @@ +{ pkgs, lib, config, ... }: +{ + home.packages = with pkgs; [ + vesktop + fractal + ]; +} diff --git a/modules/home/programs/misc/default.nix b/modules/home/programs/misc/default.nix new file mode 100644 index 00000000..52a332da --- /dev/null +++ b/modules/home/programs/misc/default.nix @@ -0,0 +1,9 @@ +{ ... }: +{ + imports = [ + ./avtools + ./chat + ./general + ./headless + ]; +} diff --git a/modules/home/programs/misc/gaming/default.nix b/modules/home/programs/misc/gaming/default.nix new file mode 100644 index 00000000..9e9eaae1 --- /dev/null +++ b/modules/home/programs/misc/gaming/default.nix @@ -0,0 +1,8 @@ +{ ... }: +{ + imports = [ + ./launchers + ./emulators + ./xash3d + ]; +} diff --git a/home/misc/emulators.nix b/modules/home/programs/misc/gaming/emulators/default.nix similarity index 70% rename from home/misc/emulators.nix rename to modules/home/programs/misc/gaming/emulators/default.nix index 931f46d6..8acaf48a 100644 --- a/home/misc/emulators.nix +++ b/modules/home/programs/misc/gaming/emulators/default.nix @@ -1,10 +1,11 @@ -{pkgs, ...}: { +{ pkgs, lib, config, ... }: +{ home.packages = with pkgs; [ dolphin-emu cemu ryujinx duckstation pcsx2 - unstable.lime3ds + #lime3ds ]; } diff --git a/home/misc/gaming.nix b/modules/home/programs/misc/gaming/launchers/default.nix similarity index 75% rename from home/misc/gaming.nix rename to modules/home/programs/misc/gaming/launchers/default.nix index 8bc40406..7fc5aa9e 100644 --- a/home/misc/gaming.nix +++ b/modules/home/programs/misc/gaming/launchers/default.nix @@ -1,4 +1,5 @@ -{pkgs, ...}: { +{ pkgs, lib, config, ... }: +{ home.packages = with pkgs; [ steam steam-run diff --git a/home/misc/xash3d.nix b/modules/home/programs/misc/gaming/xash3d/default.nix similarity index 62% rename from home/misc/xash3d.nix rename to modules/home/programs/misc/gaming/xash3d/default.nix index 714944ca..21586063 100644 --- a/home/misc/xash3d.nix +++ b/modules/home/programs/misc/gaming/xash3d/default.nix @@ -1,6 +1,6 @@ -{pkgs, ...}: { +{ pkgs, lib, config, ... }: +{ home.packages = with pkgs; [ xash3d - hlsdk ]; } diff --git a/home/misc/useful.nix b/modules/home/programs/misc/general/default.nix similarity index 79% rename from home/misc/useful.nix rename to modules/home/programs/misc/general/default.nix index e6f4d7f0..4efce085 100644 --- a/home/misc/useful.nix +++ b/modules/home/programs/misc/general/default.nix @@ -1,10 +1,9 @@ -{pkgs, ...}: { +{ pkgs, lib, config, ... }: +{ home.packages = with pkgs; [ imv qbittorrent libreoffice-fresh - vesktop - fractal ffmpegthumbnailer thunderbird protonvpn-cli_2 diff --git a/modules/home/programs/misc/headless/default.nix b/modules/home/programs/misc/headless/default.nix new file mode 100644 index 00000000..9bc4853e --- /dev/null +++ b/modules/home/programs/misc/headless/default.nix @@ -0,0 +1,13 @@ +{ pkgs, ... }: +{ + home.packages = with pkgs; [ + gotop + tcptrack + p7zip + vimv + dua + pciutils + usbutils + protonvpn-cli_2 + ]; +} diff --git a/modules/home/programs/misc/production/default.nix b/modules/home/programs/misc/production/default.nix new file mode 100644 index 00000000..6f881db5 --- /dev/null +++ b/modules/home/programs/misc/production/default.nix @@ -0,0 +1,16 @@ +{ pkgs, blender-bin, ... }: +{ + imports = [ + ./obs + ]; + + home.packages = with pkgs; [ + krita + inkscape + audacity + blender_4_2 + sunvox + ]; + + nixpkgs.overlays = [ blender-bin.overlays.default ]; +} diff --git a/home/programs/obs.nix b/modules/home/programs/misc/production/obs/default.nix similarity index 86% rename from home/programs/obs.nix rename to modules/home/programs/misc/production/obs/default.nix index f8da5fe9..164ffe23 100644 --- a/home/programs/obs.nix +++ b/modules/home/programs/misc/production/obs/default.nix @@ -1,5 +1,5 @@ -{pkgs, ...}: { - # OBS with plugins +{ pkgs, lib, config, ... }: +{ programs.obs-studio = { enable = true; plugins = with pkgs.obs-studio-plugins; [ diff --git a/home/misc/remotedesktop.nix b/modules/home/programs/misc/remote-desktop/default.nix similarity index 71% rename from home/misc/remotedesktop.nix rename to modules/home/programs/misc/remote-desktop/default.nix index 4d18c485..d7e65b62 100644 --- a/home/misc/remotedesktop.nix +++ b/modules/home/programs/misc/remote-desktop/default.nix @@ -1,4 +1,5 @@ -{pkgs, ...}: { +{ pkgs, lib, config, ... }: +{ home.packages = with pkgs; [ moonlight-qt rustdesk-flutter diff --git a/home/misc/school.nix b/modules/home/programs/misc/school/default.nix similarity index 77% rename from home/misc/school.nix rename to modules/home/programs/misc/school/default.nix index 9b4630f6..10320e69 100644 --- a/home/misc/school.nix +++ b/modules/home/programs/misc/school/default.nix @@ -1,9 +1,9 @@ -{pkgs, ...}: { +{ pkgs, lib, config, ... }: +{ home.packages = with pkgs; [ remmina freerdp - globalprotect-openconnect - python3 zoom-us + globalprotect-openconnect ]; } diff --git a/modules/home/programs/terminal/default.nix b/modules/home/programs/terminal/default.nix new file mode 100644 index 00000000..4c16f71c --- /dev/null +++ b/modules/home/programs/terminal/default.nix @@ -0,0 +1,11 @@ +{ ... }: +{ + imports = [ + ./fastfetch + ./git + ./ncmpcpp + ./neovim + ./ranger + ./tmux + ]; +} diff --git a/home/utils/fastfetch.nix b/modules/home/programs/terminal/fastfetch/default.nix similarity index 99% rename from home/utils/fastfetch.nix rename to modules/home/programs/terminal/fastfetch/default.nix index 44a10136..d5d55606 100644 --- a/home/utils/fastfetch.nix +++ b/modules/home/programs/terminal/fastfetch/default.nix @@ -1,4 +1,5 @@ -{pkgs, ...}: { +{ pkgs, ... }: +{ home = { file = let fastConf = '' diff --git a/modules/home/programs/terminal/git/default.nix b/modules/home/programs/terminal/git/default.nix new file mode 100644 index 00000000..20638f09 --- /dev/null +++ b/modules/home/programs/terminal/git/default.nix @@ -0,0 +1,8 @@ +{ config, ... }: +{ + programs.git = { + enable = true; + userName = "Jimbo"; + userEmail = "jimbo@${config.domains.jim2}"; + }; +} diff --git a/home/utils/ncmpcpp.nix b/modules/home/programs/terminal/ncmpcpp/default.nix similarity index 51% rename from home/utils/ncmpcpp.nix rename to modules/home/programs/terminal/ncmpcpp/default.nix index 37019ac1..418cb8b7 100644 --- a/home/utils/ncmpcpp.nix +++ b/modules/home/programs/terminal/ncmpcpp/default.nix @@ -1,17 +1,21 @@ -{pkgs, ...}: { - # Enable NCMPCPP +{ pkgs, ... }: +{ programs.ncmpcpp = { enable = true; settings = { browser_sort_mode = "name"; user_interface = "alternative"; }; + bindings = [ + { key = "h"; command = "volume_down"; } + { key = "j"; command = "scroll_down"; } + { key = "k"; command = "scroll_up"; } + { key = "l"; command = "volume_up"; } + ]; }; - # Enable Discord Music RPC services.mpd-discord-rpc.enable = true; - # Allow terminal control of mpd home.packages = with pkgs; [ mpc-cli ]; diff --git a/home/utils/neovim.nix b/modules/home/programs/terminal/neovim/default.nix similarity index 93% rename from home/utils/neovim.nix rename to modules/home/programs/terminal/neovim/default.nix index e5f924a8..9573332a 100644 --- a/home/utils/neovim.nix +++ b/modules/home/programs/terminal/neovim/default.nix @@ -1,5 +1,5 @@ -{pkgs, outputs, ...}: { - # Install Neovim and plugins +{ config, pkgs, ... }: +{ programs.neovim = { enable = true; defaultEditor = true; @@ -85,8 +85,8 @@ let g:airline_theme='onedark' let g:airline#extensions#tabline#enabled = 1 hi Normal guibg=none ctermbg=235 - hi Visual guibg=#${outputs.look.colors.mid} ctermbg=238 - hi Pmenu guibg=#${outputs.look.colors.mid} ctermbg=238 + hi Visual guibg=#${config.look.colors.mid} ctermbg=238 + hi Pmenu guibg=#${config.look.colors.mid} ctermbg=238 hi EndOfBuffer guibg=none ctermbg=235 hi LineNr guibg=none ctermbg=none lua require'colorizer'.setup() diff --git a/home/utils/ranger.nix b/modules/home/programs/terminal/ranger/default.nix similarity index 77% rename from home/utils/ranger.nix rename to modules/home/programs/terminal/ranger/default.nix index 338952c9..ab41bbe5 100644 --- a/home/utils/ranger.nix +++ b/modules/home/programs/terminal/ranger/default.nix @@ -1,5 +1,5 @@ -{pkgs, ...}: { - # Enable Ranger +{ pkgs, ... }: +{ programs.ranger = { enable = true; settings = { @@ -100,28 +100,34 @@ ''; }; - # Ranger's bookmarks - home.file = let - rangerBookmarks = '' - # Local files - h:/home/jimbo/ - k:/home/jimbo/Downloads - v:/home/jimbo/Videos - c:/home/jimbo/.config - L:/home/jimbo/.local - D:/mnt - n:/etc/nixos + # Ranger's bookmarks and necessary tools + home = { + file = let + rangerBookmarks = '' + # Local files + h:/home/jimbo/ + k:/home/jimbo/Downloads + v:/home/jimbo/Videos + c:/home/jimbo/.config + L:/home/jimbo/.local + D:/mnt + n:/etc/nixos - # Remote files - a:/home/jimbo/JimboNFS - K:/home/jimbo/JimboNFS/Downloads - p:/home/jimbo/JimboNFS/Photos - P:/home/jimbo/JimboNFS/Projects - V:/home/jimbo/JimboNFS/Videos/Random - m:/home/jimbo/JimboNFS/Music - s:/home/jimbo/JimboNFS/School - ''; - in { - ".local/share/ranger/bookmarks".text = rangerBookmarks; + # Remote files + j:/home/jimbo/JimboNFS + K:/home/jimbo/JimboNFS/Downloads + p:/home/jimbo/JimboNFS/Photos + P:/home/jimbo/JimboNFS/Projects + V:/home/jimbo/JimboNFS/Videos/Random + m:/home/jimbo/JimboNFS/Music/Synced + s:/home/jimbo/JimboNFS/School + ''; + in { + ".local/share/ranger/bookmarks".text = rangerBookmarks; + }; + packages = with pkgs; [ + imagemagick + poppler_utils + ]; }; } diff --git a/home/utils/tmux.nix b/modules/home/programs/terminal/tmux/default.nix similarity index 97% rename from home/utils/tmux.nix rename to modules/home/programs/terminal/tmux/default.nix index 3ff224a2..471f6e2d 100644 --- a/home/utils/tmux.nix +++ b/modules/home/programs/terminal/tmux/default.nix @@ -1,5 +1,5 @@ +{ ... }: { - # Enable tmux programs.tmux = { enable = true; extraConfig = '' diff --git a/modules/home/settings/dconf/default.nix b/modules/home/settings/dconf/default.nix new file mode 100644 index 00000000..54ad39da --- /dev/null +++ b/modules/home/settings/dconf/default.nix @@ -0,0 +1,12 @@ +{ ... }: +{ + dconf.settings = { + "org/gnome/desktop/interface/color-scheme" = { + color-scheme = "prefer-dark"; + }; + "org/virt-manager/virt-manager/connections" = { + autoconnect = ["qemu:///system"]; + uris = ["qemu:///system"]; + }; + }; +} diff --git a/modules/home/settings/default.nix b/modules/home/settings/default.nix new file mode 100644 index 00000000..23945be7 --- /dev/null +++ b/modules/home/settings/default.nix @@ -0,0 +1,9 @@ +{ ... }: +{ + imports = [ + ./dconf + ./fonts + ./gtk + ./xdg + ]; +} diff --git a/home/misc/fonts.nix b/modules/home/settings/fonts/default.nix similarity index 100% rename from home/misc/fonts.nix rename to modules/home/settings/fonts/default.nix diff --git a/home/programs/gtk.nix b/modules/home/settings/gtk/default.nix similarity index 68% rename from home/programs/gtk.nix rename to modules/home/settings/gtk/default.nix index fcf97ed2..78a4bfc5 100644 --- a/home/programs/gtk.nix +++ b/modules/home/settings/gtk/default.nix @@ -1,9 +1,9 @@ -{pkgs, outputs, ...}: { - # Define GTK theme settings +{ pkgs, config, ... }: +{ gtk = { enable = true; font = { - name = "${outputs.look.fonts.main}"; + name = "${config.look.fonts.main}"; size = 11; }; theme = { @@ -16,7 +16,7 @@ }; }; iconTheme = { - package = pkgs.papirus-icon-theme.override {color = "indigo";}; + package = pkgs.papirus-icon-theme.override { color = "${config.look.colors.folder}"; }; name = "Papirus-Dark"; }; cursorTheme = { @@ -24,7 +24,6 @@ name = "Simp1e-Dark"; }; - # GTK app bookmarks gtk3 = { bookmarks = [ # Local @@ -34,16 +33,7 @@ "file:///home/jimbo/Pictures/Screenshots" "file:///home/jimbo/VMs" - # Remote - "file:///home/jimbo/JimboNFS/Downloads" - "file:///home/jimbo/JimboNFS/Documents" - "file:///home/jimbo/JimboNFS/Music" - "file:///home/jimbo/JimboNFS/Photos" - "file:///home/jimbo/JimboNFS/Videos" - "file:///home/jimbo/JimboNFS/Projects" - # More important stuff - "file:///home/jimbo/JimboNFS/School" "file:///etc/nixos" ]; diff --git a/modules/home/settings/xdg/default.nix b/modules/home/settings/xdg/default.nix new file mode 100644 index 00000000..19869b7f --- /dev/null +++ b/modules/home/settings/xdg/default.nix @@ -0,0 +1,11 @@ +{ ... }: +{ + xdg.mimeApps.defaultApplications = { + "inode/directory" = [ "pcmanfm-qt.desktop" ]; + "text/plain" = [ "nvim.desktop" ]; + "image/png" = [ "imv.desktop" ]; + "image/jpeg" = [ "imv.desktop" ]; + "image/jp2" = [ "imv.desktop" ]; + "video/*" = [ "mpv.desktop" ]; + }; +} diff --git a/home/sway/autostart.nix b/modules/home/sway/autostart/default.nix similarity index 89% rename from home/sway/autostart.nix rename to modules/home/sway/autostart/default.nix index 7de28dac..79cf26b5 100644 --- a/home/sway/autostart.nix +++ b/modules/home/sway/autostart/default.nix @@ -1,8 +1,7 @@ -{config, pkgs, ...}: { - # Enable Sway and write some scripts +{ pkgs, ... }: +{ wayland.windowManager.sway = { config = { - # Use Waybar rather than Sway's bars = [{command = "waybar";}]; startup = [ diff --git a/home/sway/sway.nix b/modules/home/sway/default.nix similarity index 59% rename from home/sway/sway.nix rename to modules/home/sway/default.nix index 5d8d7168..80f8412c 100644 --- a/home/sway/sway.nix +++ b/modules/home/sway/default.nix @@ -1,25 +1,24 @@ -{config, pkgs, outputs, ...}: { - # Import modules +{ config, pkgs, ... }: +{ imports = [ - #"./swayfx.nix" - ./hardware.nix - ./theme.nix - ./hotkeys.nix - ./rules.nix - ./autostart.nix - ./waybar.nix - ./swayshot.nix + ./hardware + ./theme + ./hotkeys + ./programs + ./rules + ./autostart + ./waybar + ./swayshot + ./swaylock ]; - # Enable Sway and write some scripts wayland.windowManager.sway = { enable = true; package = null; wrapperFeatures.gtk = true; checkConfig = false; extraConfig = '' - # Options I can't find in Nix yet - default_floating_border pixel ${outputs.look.border.string} + default_floating_border pixel ${config.look.border.string} hide_edge_borders --i3 smart titlebar_padding 10 1 primary_selection disabled @@ -31,8 +30,8 @@ }} # Switch to workspace 1 - workspace ${outputs.ws.w7} - workspace ${outputs.ws.w1} + workspace ${config.ws.w7} + workspace ${config.ws.w1} ''; }; } diff --git a/home/sway/hardware.nix b/modules/home/sway/hardware/default.nix similarity index 74% rename from home/sway/hardware.nix rename to modules/home/sway/hardware/default.nix index dc0b3329..bed8f286 100644 --- a/home/sway/hardware.nix +++ b/modules/home/sway/hardware/default.nix @@ -1,31 +1,31 @@ -{config, pkgs, outputs, ...}: { +{ config, ... }: +{ wayland.windowManager.sway = { config = { # Define monitors output = { - ${outputs.displays.d1} = { + ${config.displays.d1} = { pos = "1920 405"; mode = "1920x1080@143.980Hz"; max_render_time = "3"; - bg = "~/.wallpapers/1.png fill"; + bg = "~/.assets/wallpapers/1.png fill"; adaptive_sync = "on"; - #tearing_allowed = "1"; }; - ${outputs.displays.d2} = { + ${config.displays.d2} = { pos = "0 405"; mode = "1920x1080@60Hz"; max_render_time = "3"; - bg = "~/.wallpapers/2.png fill"; + bg = "~/.assets/wallpapers/2.png fill"; }; - ${outputs.displays.d3} = { + ${config.displays.d3} = { pos = "3840 0"; mode = "1680x1050@59.883Hz"; transform = "270"; max_render_time = "3"; - bg = "~/.wallpapers/3.png fill"; + bg = "~/.assets/wallpapers/3.png fill"; }; "*" = { - bg = "~/.wallpapers/1.png fill"; + bg = "~/.assets/wallpapers/1.png fill"; }; }; diff --git a/home/sway/README.md b/modules/home/sway/hotkeys/README.md similarity index 100% rename from home/sway/README.md rename to modules/home/sway/hotkeys/README.md diff --git a/modules/home/sway/hotkeys/default.nix b/modules/home/sway/hotkeys/default.nix new file mode 100644 index 00000000..5ed34cdc --- /dev/null +++ b/modules/home/sway/hotkeys/default.nix @@ -0,0 +1,228 @@ +{ pkgs, config, ... }: +{ + wayland.windowManager.sway = { + config = let + # Set default modifier and variables + primeMod = "Mod4"; + secMod = "Mod1"; + resizeAmount = ''55''; + sendNotif = ''notify-send --expire-time=1500''; + in { + # Hotkeys + modifier = "${primeMod}"; + keybindings = let + # Define scripts specific to Sway + pinWindow = pkgs.writeScript "pin-window" '' + # Get the current border style of the focused window + current_style=$(swaymsg -t get_tree | jq -r '.. | select(.focused?).border') + + # Toggle between "normal" (default) and "pixel ${config.look.border.string}" border styles + if [ "$current_style" == "none" ]; then + swaymsg "sticky disable, border pixel ${config.look.border.string}" + else + swaymsg "sticky enable, border none" + fi + ''; + + # Kill a window or probe it for info + swayTools = pkgs.writeScript "swaytools" '' + # List the app name and whether or not it uses wayland + swayprop() { + selected_window=$(swaymsg -t get_tree | jq -r '.. | select(.pid? and .visible?) | "\(.rect.x),\(.rect.y) \(.rect.width)x\(.rect.height)"' | slurp -r -c ${config.look.colors.prime} -B 00000066 -b 00000000) + if [ -n "$selected_window" ]; then + app_id=$(swaymsg -t get_tree | jq -r '.. | select(.pid? and .visible?) | select("\(.rect.x),\(.rect.y) \(.rect.width)x\(.rect.height)" == "'"$selected_window"'") | .app_id') + system=$(sed 's/xdg_shell/Wayland/g; s/xwayland/Xorg/g' < <(swaymsg -t get_tree | jq -r '.. | select(.pid? and .visible?) | select("\(.rect.x),\(.rect.y) \(.rect.width)x\(.rect.height)" == "'"$selected_window"'") | .shell')) + notify-send "$(echo -e "Window's app_id: $app_id\nWindow System: $system")" + fi + } + + # Kill a selected window + swaykill() { + selected_window=$(swaymsg -t get_tree | jq -r '.. | select(.pid? and .visible?) | "\(.rect.x),\(.rect.y) \(.rect.width)x\(.rect.height)"' | slurp -r -c ${config.look.colors.prime} -B 00000066 -b 00000000) + if [ -n "$selected_window" ]; then + pid=$(swaymsg -t get_tree | jq -r '.. | select(.pid? and .visible?) | select("\(.rect.x),\(.rect.y) \(.rect.width)x\(.rect.height)" == "'"$selected_window"'") | .pid') + kill -9 "$pid" + fi + } + + # Handle which tool we use + if [ "$1" == "--prop" ]; then + swayprop + elif [ "$1" == "--kill" ]; then + swaykill + fi + ''; + in { + ## Launcher keys + + # LibreWolf profiles + "${primeMod}+F1" = ''exec librewolf -P Jimbo --name=JimBrowser | ${sendNotif} "Main Browser"''; + "${primeMod}+F2" = ''exec librewolf -P Alt --name=AltBrowser | ${sendNotif} "Alternate Browser"''; + "${primeMod}+F3" = ''exec librewolf -P Misc --name=MiscBrowser | ${sendNotif} "Miscellaneous Browser"''; + + # Virtual Machines + "${primeMod}+F4" = ''exec virt-manager | ${sendNotif} "Virtual Machines"''; + "${primeMod}+F5" = ''exec looking-glass-client input:rawMouse=yes | ${sendNotif} "Looking Glass"''; + + # BeMenu scripts + "${primeMod}+${secMod}+s" = ''exec rofiscripts --scratchpads''; + "${primeMod}+${secMod}+r" = ''exec rofiscripts --resolutions''; + + # Mod + Key + "${primeMod}+s" = ''exec rofi -show run -p Command''; + "${primeMod}+c" = ''exec clipman pick -t rofi''; + "${primeMod}+x" = ''exec rofiscripts --power''; + "${primeMod}+b" = ''exec pkill -USR1 waybar''; + "${primeMod}+Return" = ''exec foot''; + "${primeMod}+Escape" = ''exec ${swayTools} --kill''; + "${primeMod}+Delete" = ''exec foot ranger /etc/nixos | ${sendNotif} "Nix Config"''; + + # Mod + shift + key + "${primeMod}+Shift+t" = ''exec pcmanfm-qt''; + "${primeMod}+Shift+e" = ''exec BEMOJI_PICKER_CMD="rofi -dmenu -i -p Emoji" bemoji -n -P 0''; + "${primeMod}+Shift+s" = ''exec rofi -show drun -modi drun -drun-display-format {name} -show-icons -disable-history''; + "${primeMod}+Shift+b" = ''exec rofi-bluetooth''; + "${primeMod}+Shift+Return" = ''exec foot ranger''; + + # Mod + ctrl + key + "${primeMod}+Ctrl+x" = ''exec ${swayTools} --prop''; + "${primeMod}+Ctrl+c" = ''exec ${pkgs.hyprpicker}/bin/hyprpicker -an && ${sendNotif} "Color copied to clipboard"''; + "${primeMod}+Ctrl+Prior" = ''exec ${pkgs.obs-cmd}/bin/obs-cmd scene switch "Main"''; + "${primeMod}+Ctrl+Next" = ''exec ${pkgs.obs-cmd}/bin/obs-cmd scene switch "Guest"''; + + ## Media keys + + # Volume control + "${secMod}+j" = ''exec wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-''; + "${secMod}+k" = ''exec wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+''; + + # MPD Controls + "${primeMod}+Backslash" = ''exec mpc toggle''; + "${secMod}+Shift+h" = ''exec mpc prev''; + "${secMod}+Shift+j" = ''exec mpc volume -3''; + "${secMod}+Shift+k" = ''exec mpc volume +3''; + "${secMod}+Shift+l" = ''exec mpc next''; + + ## Notification keys + + # Toggle mako + "${primeMod}+n" = ''exec makotoggle''; + "${primeMod}+Shift+n" = ''exec makoctl restore''; + "${primeMod}+Ctrl+n" = ''exec makoctl dismiss -a''; + + ## Miscellaneous keys + + # Screenshots + "${secMod}+f" = ''exec swayshot --swappy''; + "${secMod}+Shift+f" = ''exec swayshot --screen''; + + # SSH + "${primeMod}+${secMod}+Return" = ''exec foot ssh ${config.ips.server}''; + + # Display Brightness and Keyboard Brightness + "${primeMod}+equal" = ''exec light -A 5''; + "${primeMod}+minus" = ''exec light -U 5''; + "${primeMod}+Shift+equal" = ''exec light -A 1''; + "${primeMod}+Shift+minus" = ''exec light -U 1''; + "XF86KbdBrightnessUp" = ''exec light -s sysfs/leds/smc::kbd_backlight -A 5''; + "XF86KbdBrightnessDown" = ''exec light -s sysfs/leds/smc::kbd_backlight -U 5''; + + ## Window manager keys + "${primeMod}+q" = ''kill''; + "${primeMod}+Shift+r" = ''reload''; + + # Switch to workspaces + "${primeMod}+grave" = ''workspace ${config.ws.w0}''; + "${primeMod}+1" = ''workspace ${config.ws.w1}''; + "${primeMod}+2" = ''workspace ${config.ws.w2}''; + "${primeMod}+3" = ''workspace ${config.ws.w3}''; + "${primeMod}+4" = ''workspace ${config.ws.w4}''; + "${primeMod}+5" = ''workspace ${config.ws.w5}''; + "${primeMod}+6" = ''workspace ${config.ws.w6}''; + "${primeMod}+7" = ''workspace ${config.ws.w7}''; + "${primeMod}+8" = ''workspace ${config.ws.w8}''; + "${primeMod}+9" = ''workspace ${config.ws.w9}''; + + # Switch to alternate workspaces + "${secMod}+F1" = ''workspace ${config.ws.w1a}''; + "${secMod}+F2" = ''workspace ${config.ws.w2a}''; + "${secMod}+F3" = ''workspace ${config.ws.w3a}''; + "${secMod}+F4" = ''workspace ${config.ws.w4a}''; + "${secMod}+F5" = ''workspace ${config.ws.w5a}''; + "${secMod}+F6" = ''workspace ${config.ws.w6a}''; + "${secMod}+F7" = ''workspace ${config.ws.w7a}''; + "${secMod}+F8" = ''workspace ${config.ws.w8a}''; + "${secMod}+F9" = ''workspace ${config.ws.w9a}''; + + # Move window to and focus new workspace + "${primeMod}+Shift+grave" = ''move container to workspace ${config.ws.w0}; workspace ${config.ws.w0}''; + "${primeMod}+Shift+1" = ''move container to workspace ${config.ws.w1}; workspace ${config.ws.w1}''; + "${primeMod}+Shift+2" = ''move container to workspace ${config.ws.w2}; workspace ${config.ws.w2}''; + "${primeMod}+Shift+3" = ''move container to workspace ${config.ws.w3}; workspace ${config.ws.w3}''; + "${primeMod}+Shift+4" = ''move container to workspace ${config.ws.w4}; workspace ${config.ws.w4}''; + "${primeMod}+Shift+5" = ''move container to workspace ${config.ws.w5}; workspace ${config.ws.w5}''; + "${primeMod}+Shift+6" = ''move container to workspace ${config.ws.w6}; workspace ${config.ws.w6}''; + "${primeMod}+Shift+7" = ''move container to workspace ${config.ws.w7}; workspace ${config.ws.w7}''; + "${primeMod}+Shift+8" = ''move container to workspace ${config.ws.w8}; workspace ${config.ws.w8}''; + "${primeMod}+Shift+9" = ''move container to workspace ${config.ws.w9}; workspace ${config.ws.w9}''; + + # Move window to and focus new alternate workspace + "${secMod}+Shift+F1" = ''move container to workspace ${config.ws.w1a}; workspace ${config.ws.w1a}''; + "${secMod}+Shift+F2" = ''move container to workspace ${config.ws.w2a}; workspace ${config.ws.w2a}''; + "${secMod}+Shift+F3" = ''move container to workspace ${config.ws.w3a}; workspace ${config.ws.w3a}''; + "${secMod}+Shift+F4" = ''move container to workspace ${config.ws.w4a}; workspace ${config.ws.w4a}''; + "${secMod}+Shift+F5" = ''move container to workspace ${config.ws.w5a}; workspace ${config.ws.w5a}''; + "${secMod}+Shift+F6" = ''move container to workspace ${config.ws.w6a}; workspace ${config.ws.w6a}''; + "${secMod}+Shift+F7" = ''move container to workspace ${config.ws.w7a}; workspace ${config.ws.w7a}''; + "${secMod}+Shift+F8" = ''move container to workspace ${config.ws.w8a}; workspace ${config.ws.w8a}''; + "${secMod}+Shift+F9" = ''move container to workspace ${config.ws.w9a}; workspace ${config.ws.w9a}''; + + # Change focus across windows + "${primeMod}+h" = ''focus left''; + "${primeMod}+j" = ''focus down''; + "${primeMod}+k" = ''focus up''; + "${primeMod}+l" = ''focus right''; + + # Resize windows + "${primeMod}+${secMod}+h" = ''resize shrink width ${resizeAmount} px or 5 ppt''; + "${primeMod}+${secMod}+j" = ''resize shrink height ${resizeAmount} px or 5 ppt''; + "${primeMod}+${secMod}+k" = ''resize grow height ${resizeAmount} px or 5 ppt''; + "${primeMod}+${secMod}+l" = ''resize grow width ${resizeAmount} px or 5 ppt''; + + # Move focused window + "${primeMod}+Shift+h" = ''move left ${resizeAmount} px''; + "${primeMod}+Shift+j" = ''move down ${resizeAmount} px''; + "${primeMod}+Shift+k" = ''move up ${resizeAmount} px''; + "${primeMod}+Shift+l" = ''move right ${resizeAmount} px''; + + # Change focus between floating/tiled, toggle floating + "${primeMod}+space" = ''focus mode_toggle''; + "${primeMod}+Shift+space" = ''floating toggle''; + + # Allow a window to be visible on all workspaces, toggle border + "${primeMod}+0" = ''exec ${pinWindow}''; + + # Toggle fullscreen + "${primeMod}+f" = ''fullscreen toggle''; + "${primeMod}+${secMod}+Ctrl+f" = ''fullscreen toggle global''; + + # Change container layout + "${primeMod}+w" = ''layout toggle split''; + "${primeMod}+e" = ''layout toggle tabbed stacking''; + + # Change split direction + "${primeMod}+v" = ''split v''; + + # Focus parent / child + "${primeMod}+a" = ''focus parent''; + "${primeMod}+shift+a" = ''focus child''; + + # Scratchpads + "Shift+Ctrl+Delete" = ''[app_id="gotop"] scratchpad show, move position center, resize set 1216 888''; + "${primeMod}+Shift+m" = ''[app_id="music"] scratchpad show, move position center, resize set 1006 657''; + "${primeMod}+Shift+v" = ''[app_id="sound"] scratchpad show, move position center, resize set 1000 800''; + "${primeMod}+Shift+Backslash" = ''[app_id="com.github.wwmm.easyeffects"] scratchpad show, move position center, resize set 1000 800''; + }; + }; + }; +} diff --git a/modules/home/sway/programs/default.nix b/modules/home/sway/programs/default.nix new file mode 100644 index 00000000..9e0d6e63 --- /dev/null +++ b/modules/home/sway/programs/default.nix @@ -0,0 +1,14 @@ +{ pkgs, ... }: +{ + home.packages = with pkgs; [ + wl-clipboard + wdisplays + clipman + libnotify + grim + slurp + swappy + jq + lm_sensors + ]; +} diff --git a/home/sway/rules.nix b/modules/home/sway/rules/default.nix similarity index 62% rename from home/sway/rules.nix rename to modules/home/sway/rules/default.nix index 992619af..ff080f6d 100644 --- a/home/sway/rules.nix +++ b/modules/home/sway/rules/default.nix @@ -1,33 +1,33 @@ -{config, pkgs, outputs, ...}: { - # Enable Sway and write some scripts +{ config, ... }: +{ wayland.windowManager.sway = { config = { - # Assign workspaces to outputs + # Assign workspaces to config workspaceOutputAssign = let workspaces1 = [ - "${outputs.ws.w0}" - "${outputs.ws.w1}" - "${outputs.ws.w2}" - "${outputs.ws.w3}" - "${outputs.ws.w1a}" - "${outputs.ws.w2a}" - "${outputs.ws.w3a}" + "${config.ws.w0}" + "${config.ws.w1}" + "${config.ws.w2}" + "${config.ws.w3}" + "${config.ws.w1a}" + "${config.ws.w2a}" + "${config.ws.w3a}" ]; workspaces2 = [ - "${outputs.ws.w4}" - "${outputs.ws.w5}" - "${outputs.ws.w6}" - "${outputs.ws.w4a}" - "${outputs.ws.w5a}" - "${outputs.ws.w6a}" + "${config.ws.w4}" + "${config.ws.w5}" + "${config.ws.w6}" + "${config.ws.w4a}" + "${config.ws.w5a}" + "${config.ws.w6a}" ]; workspaces3 = [ - "${outputs.ws.w7}" - "${outputs.ws.w8}" - "${outputs.ws.w9}" - "${outputs.ws.w7a}" - "${outputs.ws.w8a}" - "${outputs.ws.w9a}" + "${config.ws.w7}" + "${config.ws.w8}" + "${config.ws.w9}" + "${config.ws.w7a}" + "${config.ws.w8a}" + "${config.ws.w9a}" ]; assign = output: workspaces: map (workspace: { @@ -36,13 +36,13 @@ }) workspaces; in - (assign "${outputs.displays.d1}" workspaces1) ++ - (assign "${outputs.displays.d2}" workspaces2) ++ - (assign "${outputs.displays.d3}" workspaces3); + (assign "${config.displays.d1}" workspaces1) ++ + (assign "${config.displays.d2}" workspaces2) ++ + (assign "${config.displays.d3}" workspaces3); # Rules window = { - border = outputs.look.border.int; + border = config.look.border.int; titlebar = false; commands = [ # Scratchpads @@ -76,7 +76,7 @@ # Give apps that don't have them borders { criteria = {con_mark = "borderless";}; - command = ''border pixel ${outputs.look.border.string}''; + command = ''border pixel ${config.look.border.string}''; } { criteria = {app_id = "com.github.wwmm.easyeffects";}; @@ -111,20 +111,20 @@ ]; }; assigns = { - # Brooutputs.wsers - "${outputs.ws.w1}" = [{app_id = "JimBrooutputs.wser";}]; - "${outputs.ws.w1a}" = [{app_id = "AltBrooutputs.wser";}]; + # Broconfig.wsers + "${config.ws.w1}" = [{app_id = "JimBrowser";}]; + "${config.ws.w1a}" = [{app_id = "AltBrowser";}]; # Communication - "${outputs.ws.w3a}" = [{class = "zoom";}]; - "${outputs.ws.w7}" = [{app_id = "MiscBrowser";} {app_id = "vesktop";} {class = "vesktop";}]; - "${outputs.ws.w8}" = [{app_id = "org.gnome.Fractal";}]; - "${outputs.ws.w9}" = [{app_id = "thunderbird";}]; + "${config.ws.w3a}" = [{class = "zoom";}]; + "${config.ws.w7}" = [{app_id = "MiscBrowser";} {app_id = "vesktop";} {class = "vesktop";}]; + "${config.ws.w8}" = [{app_id = "org.gnome.Fractal";}]; + "${config.ws.w9}" = [{app_id = "thunderbird";}]; # Else - "${outputs.ws.w2}" = [{class = "steam";} {app_id = "heroic";}]; - "${outputs.ws.w2a}" = [{app_id = "looking-glass-client";}]; - "${outputs.ws.w4a}" = [{app_id = "com.obsproject.Studio";}]; + "${config.ws.w2}" = [{class = "steam";} {app_id = "heroic";}]; + "${config.ws.w2a}" = [{app_id = "looking-glass-client";}]; + "${config.ws.w4a}" = [{app_id = "com.obsproject.Studio";}]; }; focus.newWindow = "focus"; }; diff --git a/home/sway/swaylock.nix b/modules/home/sway/swaylock/default.nix similarity index 84% rename from home/sway/swaylock.nix rename to modules/home/sway/swaylock/default.nix index 8a8fb35c..d89cbb20 100644 --- a/home/sway/swaylock.nix +++ b/modules/home/sway/swaylock/default.nix @@ -1,13 +1,14 @@ -{config, pkgs, outputs, ...}: let +{ pkgs, config, ... }: +let swayLock = pkgs.writeScriptBin "swaylock" '' # Set the lock script lockscript() { BLANK='#00000000' CLEAR='#FFFFFF22' - DEFAULT='#${outputs.look.colors.prime}FF' + DEFAULT='#${config.look.colors.prime}FF' TEXT='#FFFFFFFF' - WRONG='#${outputs.look.colors.split}FF' - VERIFYING='#${outputs.look.colors.accent}FF' + WRONG='#${config.look.colors.split}FF' + VERIFYING='#${config.look.colors.accent}FF' ${pkgs.swaylock-effects}/bin/swaylock -f -e \ --key-hl-color=$VERIFYING \ @@ -32,9 +33,9 @@ \ --indicator \ --indicator-radius=80 \ - --image=~/.wallpapers/lock.png \ + --image=~/.assets/lockscreen/lock.png \ --clock \ - --font=${outputs.look.fonts.main} \ + --font=${config.look.fonts.main} \ --font-size=30 \ --timestr="%I:%M%p" \ --datestr="%a %b %d %Y" diff --git a/home/sway/swayshot.nix b/modules/home/sway/swayshot/default.nix similarity index 89% rename from home/sway/swayshot.nix rename to modules/home/sway/swayshot/default.nix index 4d01872f..0c808638 100644 --- a/home/sway/swayshot.nix +++ b/modules/home/sway/swayshot/default.nix @@ -1,6 +1,10 @@ -{pkgs, outputs, ...}: { +{ pkgs, config, ... }: +{ + imports = [ + ./swappy + ]; + home.packages = let - # Use grim and slurp to take screenshots in multiple ways swayShot = pkgs.writeScriptBin "swayshot" '' # Swappy handle_swappy() { @@ -9,7 +13,7 @@ # Capture the screenshot of the selected area and save to a temporary file selected_area=$(swaymsg -t get_tree | jq -r '.. | select(.pid? and .visible?) | .rect | "\(.x),\(.y) \(.width)x\(.height)"'\ - | XCURSOR_SIZE=40 slurp -w ${outputs.look.border.string} -c ${outputs.look.colors.prime} -B 00000066 -b 00000099) + | XCURSOR_SIZE=40 slurp -w ${config.look.border.string} -c ${config.look.colors.prime} -B 00000066 -b 00000099) temp_file=$(mktemp -u).png grim -g "$selected_area" "$temp_file" diff --git a/modules/home/sway/swayshot/swappy/default.nix b/modules/home/sway/swayshot/swappy/default.nix new file mode 100644 index 00000000..3e82852b --- /dev/null +++ b/modules/home/sway/swayshot/swappy/default.nix @@ -0,0 +1,15 @@ +{ pkgs, ... }: +{ + home = { + packages = with pkgs; [ + swappy + ]; + file = { + ".config/swappy/config".text = '' + [Default] + early_exit=true + save_dir=$HOME/Pictures/Screenshots + ''; + }; + }; +} diff --git a/modules/home/sway/theme/default.nix b/modules/home/sway/theme/default.nix new file mode 100644 index 00000000..403497c7 --- /dev/null +++ b/modules/home/sway/theme/default.nix @@ -0,0 +1,48 @@ +{ config, ... }: +{ + wayland.windowManager.sway = { + enable = true; + wrapperFeatures.gtk = true; + checkConfig = false; + config = { + colors = { + focused = { + border = "#${config.look.colors.prime}"; + background = "#${config.look.colors.prime}"; + text = "#FFFFFF"; + indicator = "#${config.look.colors.actSplit}"; + childBorder = "#${config.look.colors.prime}"; + }; + focusedInactive = { + border = "#${config.look.colors.accent}"; + background = "#${config.look.colors.accent}"; + text = "#${config.look.colors.text}"; + indicator = "#${config.look.colors.split}"; + childBorder = "#${config.look.colors.accent}"; + }; + unfocused = { + border = "#${config.look.colors.dark}"; + background = "#${config.look.colors.dark}"; + text = "#${config.look.colors.text}"; + indicator = "#${config.look.colors.split}"; + childBorder = "#${config.look.colors.split}"; + }; + urgent = { + border = "#${config.look.colors.urgent}"; + background = "#${config.look.colors.urgent}"; + text = "#${config.look.colors.text}"; + indicator = "#${config.look.colors.urgent}"; + childBorder = "#${config.look.colors.urgent}"; + }; + }; + fonts = { + names = ["${config.look.fonts.main}"]; + size = 10.5; + }; + gaps = { + inner = 5; + smartGaps = true; + }; + }; + }; +} diff --git a/home/sway/waybar.nix b/modules/home/sway/waybar/default.nix similarity index 94% rename from home/sway/waybar.nix rename to modules/home/sway/waybar/default.nix index f4d2bd4b..c3e06294 100644 --- a/home/sway/waybar.nix +++ b/modules/home/sway/waybar/default.nix @@ -1,4 +1,5 @@ -{pkgs, outputs, ...}: { +{ pkgs, config, ... }: +{ programs.waybar = let swayWorkspacesModule = { format = "{name}"; @@ -26,7 +27,7 @@ format-icons = { headphone = "󰋋 "; headset = "󰋋 "; - default = [" " " "]; + default = [ " " " " ]; }; on-click = "wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"; on-click-middle = "wpctl set-volume @DEFAULT_AUDIO_SINK@ 100%"; @@ -261,7 +262,7 @@ name = "bar1"; position = "top"; layer = "bottom"; - output = [outputs.displays.d1 "VGA-1"]; + output = [ config.displays.d1 "VGA-1" ]; modules-left = ["sway/workspaces" "sway/window"]; modules-right = [ "pulseaudio" @@ -286,13 +287,13 @@ "sway/scratchpad" = scratchpadModule; "tray" = trayModule; "bluetooth" = bluetoothModule; - "network" = networkModule // {interface = "enp*";}; + "network" = networkModule // { interface = "enp*"; }; }; display2 = { name = "bar2"; position = "top"; layer = "bottom"; - output = [outputs.displays.d2]; + output = [ config.displays.d2 ]; modules-left = ["sway/workspaces" "sway/window"]; modules-right = [ "pulseaudio" @@ -317,7 +318,7 @@ name = "bar3"; position = "top"; layer = "bottom"; - output = [outputs.displays.d3]; + output = [ config.displays.d3 ]; modules-left = ["sway/workspaces" "sway/window"]; modules-right = [ "pulseaudio" @@ -340,8 +341,8 @@ name = "laptop"; position = "top"; layer = "bottom"; - output = ["eDP-1" "LVDS-1" "DSI-1" "HDMI-A-1"]; - modules-left = ["sway/workspaces" "sway/window"]; + output = [ "eDP-1" "LVDS-1" "DSI-1" "HDMI-A-1" ]; + modules-left = [ "sway/workspaces" "sway/window" ]; modules-right = [ "pulseaudio" "custom/media" @@ -382,12 +383,12 @@ border: 0; border-radius: 0; min-height: 0; - font-family: ${outputs.look.fonts.main}, ${outputs.look.fonts.nerd}; + font-family: ${config.look.fonts.main}, ${config.look.fonts.nerd}; font-size: 15.5px; - color: #${outputs.look.colors.text}; + color: #${config.look.colors.text}; } #waybar { - background: #${outputs.look.colors.dark}; + background: #${config.look.colors.dark}; } #workspaces { padding: 0 6px 0 0; @@ -412,15 +413,15 @@ min-width: 20px; } #workspaces button.visible { - border-bottom: 3px solid #${outputs.look.colors.prime}; - background: #${outputs.look.colors.mid}; + border-bottom: 3px solid #${config.look.colors.prime}; + background: #${config.look.colors.mid}; } #workspaces button.urgent { - border-bottom: 3px solid #${outputs.look.colors.urgent}; + border-bottom: 3px solid #${config.look.colors.urgent}; } #workspaces button:hover { box-shadow: none; - background: #${outputs.look.colors.light}; + background: #${config.look.colors.light}; } #scratchpad { margin-left: 2px; @@ -456,13 +457,13 @@ color: #888; } #custom-weather { - border-bottom: 3px solid #${outputs.look.colors.prime}; + border-bottom: 3px solid #3823C4; } #custom-weather2 { border-bottom: 3px solid #c75bd3; } #custom-notifs { - border-bottom: 3px solid #${outputs.look.colors.prime}; + border-bottom: 3px solid #3823C4; } #custom-notifs.disabled { color: #888; diff --git a/modules/home/users/default.nix b/modules/home/users/default.nix new file mode 100644 index 00000000..4f6dbf4c --- /dev/null +++ b/modules/home/users/default.nix @@ -0,0 +1,6 @@ +{ ... }: +{ + imports = [ + ./jimbo + ]; +} diff --git a/home/users/jimbo.nix b/modules/home/users/jimbo/default.nix similarity index 96% rename from home/users/jimbo.nix rename to modules/home/users/jimbo/default.nix index 0547df5c..69b73a75 100644 --- a/home/users/jimbo.nix +++ b/modules/home/users/jimbo/default.nix @@ -1,3 +1,4 @@ +{ ... }: { home = { username = "jimbo"; diff --git a/modules/home/utils/default.nix b/modules/home/utils/default.nix new file mode 100644 index 00000000..2bbeeda8 --- /dev/null +++ b/modules/home/utils/default.nix @@ -0,0 +1,8 @@ +{ ... }: +{ + imports = [ + ./gnome-keyring + ./udiskie + ./zsh + ]; +} diff --git a/modules/home/utils/gnome-keyring/default.nix b/modules/home/utils/gnome-keyring/default.nix new file mode 100644 index 00000000..2e1ad40e --- /dev/null +++ b/modules/home/utils/gnome-keyring/default.nix @@ -0,0 +1,4 @@ +{ ... }: +{ + services.gnome-keyring.enable = true; +} diff --git a/home/services/udiskie.nix b/modules/home/utils/udiskie/default.nix similarity index 71% rename from home/services/udiskie.nix rename to modules/home/utils/udiskie/default.nix index 84698048..fedeb78a 100644 --- a/home/services/udiskie.nix +++ b/modules/home/utils/udiskie/default.nix @@ -1,5 +1,5 @@ +{ ... }: { - # Mount as user with udisk2 services.udiskie = { enable = true; automount = false; diff --git a/home/utils/zsh.nix b/modules/home/utils/zsh/default.nix similarity index 96% rename from home/utils/zsh.nix rename to modules/home/utils/zsh/default.nix index 0613ca9f..dbef8a8b 100644 --- a/home/utils/zsh.nix +++ b/modules/home/utils/zsh/default.nix @@ -1,4 +1,5 @@ -{ pkgs, config, ... }: { +{ pkgs, ... }: +{ programs.zsh = { enable = true; autosuggestion.enable = true; @@ -9,6 +10,12 @@ plugins = ["git"]; }; shellAliases = { + # NixOS aliases + nixclean = "doas nix-store --gc; nix-collect-garbage -d"; + nixpurge = "doas nix-collect-garbage --delete-old"; + nixoptimize = "doas nix store optimise"; + nixscrub = "nixclean; nixpurge; nixoptimize"; + # Flake commands flakedate = "doas nix flake update /etc/nixos"; sysswitch = "doas nixos-rebuild switch --flake /etc/nixos"; @@ -16,11 +23,6 @@ nixswitch = "sysswitch; homeswitch"; nixdate = "flakedate && sysswitch; homeswitch"; - # NixOS aliases - nixclean = "doas nix-store --gc; nix-collect-garbage -d"; - nixpurge = "doas nix-collect-garbage --delete-old"; - nixoptimize = "doas nix store optimise"; - # Shortcut aliases neo = "clear && fastfetch"; ip = "ip -c"; diff --git a/modules/system/accounts/default.nix b/modules/system/accounts/default.nix new file mode 100644 index 00000000..5c525ddb --- /dev/null +++ b/modules/system/accounts/default.nix @@ -0,0 +1,6 @@ +{ ... }: { + imports = [ + ./users + ./groups + ]; +} diff --git a/modules/system/accounts/groups/default.nix b/modules/system/accounts/groups/default.nix new file mode 100644 index 00000000..29a1695d --- /dev/null +++ b/modules/system/accounts/groups/default.nix @@ -0,0 +1,6 @@ +{ ... }: +{ + imports = [ + ./nfsShare + ]; +} diff --git a/modules/system/accounts/groups/nfsShare/default.nix b/modules/system/accounts/groups/nfsShare/default.nix new file mode 100644 index 00000000..81ca4456 --- /dev/null +++ b/modules/system/accounts/groups/nfsShare/default.nix @@ -0,0 +1,6 @@ +{ ... }: +{ + users.groups.nfsShare = { + gid = 983; + }; +} diff --git a/modules/system/accounts/users/default.nix b/modules/system/accounts/users/default.nix new file mode 100644 index 00000000..f37ca733 --- /dev/null +++ b/modules/system/accounts/users/default.nix @@ -0,0 +1,9 @@ +{ ... }: +{ + imports = [ + ./jimbo + ./liquidsoap + ./nextcloud + ./nginx + ]; +} diff --git a/modules/system/accounts/users/jimbo/default.nix b/modules/system/accounts/users/jimbo/default.nix new file mode 100644 index 00000000..967ab0e0 --- /dev/null +++ b/modules/system/accounts/users/jimbo/default.nix @@ -0,0 +1,39 @@ +{ pkgs, config, ... }: +{ + users.users = { + jimbo = { + description = "Jimbo"; + hashedPassword = config.secrets.jimboAccPass; + isNormalUser = true; + openssh.authorizedKeys.keys = [ + (builtins.readFile ../../../../../hosts/firefly/id_ed25519.pub) + (builtins.readFile ../../../../../hosts/shuttleworth/id_ed25519.pub) + (builtins.readFile ../../../../../hosts/lacros/id_ed25519.pub) + (builtins.readFile ../../../../../hosts/redmond/id_ed25519.pub) + + (builtins.readFile ../../../../../hosts/cyberspark/id_ed25519.pub) + (builtins.readFile ../../../../../hosts/bomberman/id_ed25519.pub) + + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJahAoF74BY6GCTsFkt1ADKaraFgJJozW1Y1aBTLK0j9 pixel9" + ]; + extraGroups = [ + "wheel" + "audio" + "video" + "input" + "disk" + "dialout" + "networkmanager" + "rtkit" + "kvm" + "libvirtd" + "qemu-libvirtd" + "nginx" + "minecraft" + "nfsShare" + ]; + uid = 1000; + shell = pkgs.zsh; + }; + }; +} diff --git a/modules/system/accounts/users/liquidsoap/default.nix b/modules/system/accounts/users/liquidsoap/default.nix new file mode 100644 index 00000000..f83e9cc3 --- /dev/null +++ b/modules/system/accounts/users/liquidsoap/default.nix @@ -0,0 +1,12 @@ +{ ... }: +{ + users = { + users.liquidsoap = { + group = "liquidsoap"; + extraGroups = [ "nginx" ]; + isSystemUser = true; + uid = 155; + }; + groups.liquidsoap = {}; + }; +} diff --git a/modules/system/accounts/users/nextcloud/default.nix b/modules/system/accounts/users/nextcloud/default.nix new file mode 100644 index 00000000..73aba8bd --- /dev/null +++ b/modules/system/accounts/users/nextcloud/default.nix @@ -0,0 +1,12 @@ +{ ... }: +{ + users = { + users.nextcloud = { + group = "nextcloud"; + extraGroups = [ "nfsShare" ]; + isSystemUser = true; + uid = 995; + }; + groups.nextcloud = {}; + }; +} diff --git a/modules/system/accounts/users/nginx/default.nix b/modules/system/accounts/users/nginx/default.nix new file mode 100644 index 00000000..4330f100 --- /dev/null +++ b/modules/system/accounts/users/nginx/default.nix @@ -0,0 +1,12 @@ +{ ... }: +{ + users = { + users.nginx = { + group = "nginx"; + extraGroups = [ "turnserver" "virtualMail" ]; + isSystemUser = true; + uid = 60; + }; + groups.nginx = {}; + }; +} diff --git a/modules/system/default.nix b/modules/system/default.nix new file mode 100644 index 00000000..8820ac92 --- /dev/null +++ b/modules/system/default.nix @@ -0,0 +1,37 @@ +{ config, pkgs, ... }: +{ + nix = { + settings = { + experimental-features = "nix-command flakes"; + auto-optimise-store = true; + }; + gc = { + automatic = true; + dates = "weekly"; + options = "--delete-older-than 1w"; + }; + }; + + nixpkgs.config.allowUnfree = true; + + time.timeZone = "America/Toronto"; + + programs = { + zsh.enable = true; + nano.enable = false; + }; + + documentation = { + nixos.enable = false; + info.enable = false; + }; + + console = { + font = "${pkgs.terminus_font}/share/consolefonts/ter-u22n.psf.gz"; + packages = with pkgs; [ terminus_font ]; + }; + + hardware.enableRedistributableFirmware = true; + + system.stateVersion = "24.05"; +} diff --git a/modules/system/desktop/default.nix b/modules/system/desktop/default.nix new file mode 100644 index 00000000..e413a8c8 --- /dev/null +++ b/modules/system/desktop/default.nix @@ -0,0 +1,8 @@ +{ ... }: +{ + imports = [ + ./qt + ./wayland + ./sway + ]; +} diff --git a/system/desktop/qt.nix b/modules/system/desktop/qt/default.nix similarity index 90% rename from system/desktop/qt.nix rename to modules/system/desktop/qt/default.nix index bf08a3d2..c52443f8 100644 --- a/system/desktop/qt.nix +++ b/modules/system/desktop/qt/default.nix @@ -1,3 +1,4 @@ +{ ... }: { qt = { enable = true; diff --git a/system/desktop/sway.nix b/modules/system/desktop/sway/default.nix similarity index 87% rename from system/desktop/sway.nix rename to modules/system/desktop/sway/default.nix index a9f7f886..5b08f9a9 100644 --- a/system/desktop/sway.nix +++ b/modules/system/desktop/sway/default.nix @@ -1,6 +1,7 @@ -{pkgs, ...}: { +{ pkgs, ... }: +{ imports = [ - ./wayland.nix + ./greetd ]; programs.sway = { @@ -15,7 +16,6 @@ # Allow swaylock to function security.pam.services.swaylock = {}; - # Enable desktop portals for screengrab xdg.portal = { wlr = { enable = true; diff --git a/system/desktop/greetd-sway.nix b/modules/system/desktop/sway/greetd/default.nix similarity index 85% rename from system/desktop/greetd-sway.nix rename to modules/system/desktop/sway/greetd/default.nix index 11a4bead..d01635ef 100644 --- a/system/desktop/greetd-sway.nix +++ b/modules/system/desktop/sway/greetd/default.nix @@ -1,11 +1,10 @@ -{pkgs, ...}: { +{ pkgs, ... }: +{ services = { # Configure greetd for "auto" login (single user only) greetd = let startSway = pkgs.writeScript "startsway" '' - # Use NVIDIA variables if drivers are in use if lspci -k | grep "Kernel driver in use: nvidia" &> /dev/null; then - # NVIDIA/AMD variables export LIBVA_DRIVER_NAME=nvidia export GBM_BACKEND=nvidia-drm export __GLX_VENDOR_LIBRARY_NAME=nvidia @@ -14,11 +13,9 @@ : fi - # Sway/Wayland export XDG_CURRENT_DESKTOP=sway export QT_QPA_PLATFORM="wayland;xcb" - # Start Sway sway --unsupported-gpu ''; in { diff --git a/modules/system/desktop/wayland/default.nix b/modules/system/desktop/wayland/default.nix new file mode 100644 index 00000000..7b446aee --- /dev/null +++ b/modules/system/desktop/wayland/default.nix @@ -0,0 +1,13 @@ +{ pkgs, ... }: +{ + programs = { + dconf.enable = true; + light.enable = true; + xwayland.enable = true; + }; + + services = { + dbus.enable = true; + tlp.enable = true; + }; +} diff --git a/system/desktop/bluetooth.nix b/modules/system/devices/bluetooth/default.nix similarity index 79% rename from system/desktop/bluetooth.nix rename to modules/system/devices/bluetooth/default.nix index b519c76f..6b600319 100644 --- a/system/desktop/bluetooth.nix +++ b/modules/system/devices/bluetooth/default.nix @@ -1,5 +1,5 @@ +{ ... }: { - # Enable Bluetooth hardware.bluetooth = { enable = true; settings = { @@ -8,7 +8,7 @@ }; }; - # Enable lingering for Bluetooth + # Lingering helps keep headphones connected systemd.tmpfiles.rules = [ "f /var/lib/systemd/linger/jimbo" ]; diff --git a/system/modules/extlinux.nix b/modules/system/devices/boot/extlinux/default.nix similarity index 82% rename from system/modules/extlinux.nix rename to modules/system/devices/boot/extlinux/default.nix index 01b0299f..f32c3f87 100644 --- a/system/modules/extlinux.nix +++ b/modules/system/devices/boot/extlinux/default.nix @@ -1,5 +1,5 @@ +{ ... }: { - # For ARM machines boot.loader = { generic-extlinux-compatible.enable = true; grub.enable = false; diff --git a/modules/system/devices/boot/lanzaboote/default.nix b/modules/system/devices/boot/lanzaboote/default.nix new file mode 100644 index 00000000..dbe8e403 --- /dev/null +++ b/modules/system/devices/boot/lanzaboote/default.nix @@ -0,0 +1,15 @@ +{ lanzaboote, pkgs, ... }: +{ + imports = [ + lanzaboote.nixosModules.lanzaboote + ]; + + boot.lanzaboote = { + enable = true; + pkiBundle = "/etc/secureboot"; + }; + + environment.systemPackages = with pkgs; [ + sbctl + ]; +} diff --git a/system/modules/systemdboot.nix b/modules/system/devices/boot/systemd/default.nix similarity index 53% rename from system/modules/systemdboot.nix rename to modules/system/devices/boot/systemd/default.nix index 31fd278e..a2c9a5db 100644 --- a/system/modules/systemdboot.nix +++ b/modules/system/devices/boot/systemd/default.nix @@ -1,7 +1,7 @@ +{ ... }: { - # For UEFI machines boot.loader.systemd-boot = { enable = true; - netbootxyz.enable = true; + editor = false; }; } diff --git a/modules/system/devices/default.nix b/modules/system/devices/default.nix new file mode 100644 index 00000000..64ae8098 --- /dev/null +++ b/modules/system/devices/default.nix @@ -0,0 +1,12 @@ +{ ... }: +{ + imports = [ + ./bluetooth + ./filesystems + ./networking + ./pipewire + ./printing + ./udev + ./video + ]; +} diff --git a/system/modules/filesystems.nix b/modules/system/devices/filesystems/default.nix similarity index 87% rename from system/modules/filesystems.nix rename to modules/system/devices/filesystems/default.nix index 0777d8c8..522fb9f6 100644 --- a/system/modules/filesystems.nix +++ b/modules/system/devices/filesystems/default.nix @@ -1,4 +1,5 @@ -{lib, ...}: { +{ lib, ... }: +{ boot.supportedFilesystems = { ntfs = true; zfs = lib.mkForce false; diff --git a/system/modules/networking.nix b/modules/system/devices/networking/default.nix similarity index 68% rename from system/modules/networking.nix rename to modules/system/devices/networking/default.nix index a5b22f2d..1abbd400 100644 --- a/system/modules/networking.nix +++ b/modules/system/devices/networking/default.nix @@ -1,7 +1,8 @@ +{ ... }: { - # Networking settings networking = { wireless.enable = false; dhcpcd.enable = true; + nftables.enable = true; }; } diff --git a/modules/system/devices/networking/firewall/pc/default.nix b/modules/system/devices/networking/firewall/pc/default.nix new file mode 100644 index 00000000..156c2d65 --- /dev/null +++ b/modules/system/devices/networking/firewall/pc/default.nix @@ -0,0 +1,9 @@ +{ config, ... }: +{ + networking.firewall = { + allowPing = false; + extraInputRules = '' + ip saddr { ${config.ips.server}, ${config.ips.wgSpan}.1 } accept comment "Accept Server" + ''; + }; +} diff --git a/modules/system/devices/networking/firewall/server/default.nix b/modules/system/devices/networking/firewall/server/default.nix new file mode 100644 index 00000000..8c0a376d --- /dev/null +++ b/modules/system/devices/networking/firewall/server/default.nix @@ -0,0 +1,50 @@ +{ config, ... }: +{ + # Allow forwarding + boot.kernel.sysctl."net.ipv4.ip_forward" = 1; + + # Configure firewall + networking = { + firewall = { + allowPing = false; + extraInputRules = '' + ip saddr { ${config.ips.localSpan}.0/24, ${config.ips.wgSpan}.0/24 } tcp dport 2049 accept comment "Accept NFS" + ip saddr { ${config.ips.pc}, ${config.secrets.lunaIP}, ${config.secrets.cornIP} } tcp dport { 1935, 1945 } accept comment "Accept RTMP" + ''; + }; + + # Enable nftables and forwarding + nftables = { + tables = { + forwarding = { + family = "ip"; + content = '' + chain PREROUTING { + type nat hook prerouting priority dstnat; policy accept; + tcp dport 2211 dnat to ${config.ips.pc}:22 comment "SSH to PC" + tcp dport 2222 dnat to ${config.ips.wgSpan}.19:22 comment "SSH to Oracle VM" + + udp dport { 27005, 27015, 7777 } dnat to ${config.ips.pc} comment "PC Hosted Games" + + tcp dport { 58010, 57989, 57984 } dnat to ${config.ips.pc} comment "PC Sunshine TCP" + udp dport { 57998, 57999, 58000 } dnat to ${config.ips.pc} comment "PC Sunshine UDP" + + tcp dport { 38010, 37989, 37984 } dnat to ${config.ips.vm} comment "VM Sunshine TCP" + udp dport { 37998, 37999, 38000 } dnat to ${config.ips.vm} comment "VM Sunshine UDP" + + udp dport { 7790, 7791, 7792 } dnat to ${config.ips.hx} comment "Deus Ex" + + ip saddr ${config.secrets.cornIP} tcp dport { 9943, 9944 } dnat to ${config.ips.vm} comment "VM ALVR TCP" + ip saddr ${config.secrets.cornIP} udp dport { 9943, 9944 } dnat to ${config.ips.vm} comment "VM ALVR UDP" + } + + chain POSTROUTING { + type nat hook postrouting priority 100; policy accept; + oifname "${config.ips.netInt}" masquerade + } + ''; + }; + }; + }; + }; +} diff --git a/modules/system/devices/networking/wireguard/pc/default.nix b/modules/system/devices/networking/wireguard/pc/default.nix new file mode 100644 index 00000000..5a4e5310 --- /dev/null +++ b/modules/system/devices/networking/wireguard/pc/default.nix @@ -0,0 +1,22 @@ +{ config, ... }: +{ + networking.firewall = { + allowedUDPPorts = [ 51820 ]; + }; + + networking.wireguard.interfaces = { + "${config.ips.wgInt}" = { + # Define IP of client in per device config + listenPort = 51820; + privateKey = config.secrets.wgClientPriv; + peers = [ + { + publicKey = config.secrets.wgServerPub; + allowedIPs = [ "${config.ips.wgSpan}.0/24" ]; + endpoint = "sv.${config.secrets.jimDomain}:51820"; + persistentKeepalive = 25; + } + ]; + }; + }; +} diff --git a/modules/system/devices/networking/wireguard/server/default.nix b/modules/system/devices/networking/wireguard/server/default.nix new file mode 100644 index 00000000..89ac7462 --- /dev/null +++ b/modules/system/devices/networking/wireguard/server/default.nix @@ -0,0 +1,32 @@ +{ config, ... }: +{ + networking = { + nat = { + enable = true; + externalInterface = "${config.ips.netInt}"; + internalInterfaces = [ "${config.ips.wgInt}" ]; + }; + firewall.allowedUDPPorts = [ 51820 ]; + }; + + networking.wireguard = { + enable = true; + interfaces = { + "${config.ips.wgInt}" = { + ips = [ "${config.ips.wgSpan}.1/24" ]; + listenPort = 51820; + privateKey = config.secrets.wgServerPriv; + peers = [ + { # Jimbo Pixel 9 + publicKey = config.secrets.wgPixel9Pub; + allowedIPs = [ "${config.ips.wgSpan}.2/32" ]; + } + { # General Nix + publicKey = config.secrets.wgClientPub; + allowedIPs = [ "${config.ips.wgSpan}.16/28" ]; + } + ]; + }; + }; + }; +} diff --git a/modules/system/devices/networking/wireless/default.nix b/modules/system/devices/networking/wireless/default.nix new file mode 100644 index 00000000..73f6087b --- /dev/null +++ b/modules/system/devices/networking/wireless/default.nix @@ -0,0 +1,11 @@ +{ pkgs, ... }: +{ + networking = { + wireless.iwd.enable = true; + enableB43Firmware = true; + }; + + environment.systemPackages = with pkgs; [ + unstable.impala + ]; +} diff --git a/system/desktop/pipewire.nix b/modules/system/devices/pipewire/default.nix similarity index 66% rename from system/desktop/pipewire.nix rename to modules/system/devices/pipewire/default.nix index 1a5af4ee..2b2a50d5 100644 --- a/system/desktop/pipewire.nix +++ b/modules/system/devices/pipewire/default.nix @@ -1,16 +1,16 @@ -{pkgs, ...}: { - # Enable Pipewire +{ pkgs, ... }: +{ services = { pipewire = { enable = true; audio.enable = true; wireplumber = { enable = true; - configPackages = [ - (pkgs.writeTextDir "share/wireplumber/wireplumber.conf.d/11-bluetooth-policy.conf" '' + configPackages = [( + pkgs.writeTextDir "share/wireplumber/wireplumber.conf.d/11-bluetooth-policy.conf" '' wireplumber.settings = { bluetooth.autoswitch-to-headset-profile = false } - '') - ]; + '' + )]; }; alsa = { enable = true; diff --git a/system/desktop/printing.nix b/modules/system/devices/printing/default.nix similarity index 81% rename from system/desktop/printing.nix rename to modules/system/devices/printing/default.nix index 842609a0..5c509dab 100644 --- a/system/desktop/printing.nix +++ b/modules/system/devices/printing/default.nix @@ -1,5 +1,5 @@ -{pkgs, ...}: { - # Enable printing +{ pkgs, ... }: +{ services = { printing = { enable = true; @@ -13,7 +13,6 @@ }; }; - # Install programs system-wide environment.systemPackages = with pkgs; [ system-config-printer ]; diff --git a/modules/system/devices/udev/default.nix b/modules/system/devices/udev/default.nix new file mode 100644 index 00000000..3c5941a9 --- /dev/null +++ b/modules/system/devices/udev/default.nix @@ -0,0 +1,7 @@ +{ ... }: +{ + imports = [ + ./pdp + ./oculus + ]; +} diff --git a/modules/system/devices/udev/oculus/default.nix b/modules/system/devices/udev/oculus/default.nix new file mode 100644 index 00000000..db869029 --- /dev/null +++ b/modules/system/devices/udev/oculus/default.nix @@ -0,0 +1,14 @@ +{ pkgs, ... }: +{ + services.udev = let + oculusRules = pkgs.writeTextFile { + name = "10-oculus.rules"; + text = ''KERNEL=="hidraw*", ATTRS{idVendor}=="0e6f", ATTRS{idProduct}=="0184", MODE="0660", TAG+="uaccess"''; + destination = "/etc/udev/rules.d/10-oculus.rules"; + }; + in { + packages = [ + oculusRules + ]; + }; +} diff --git a/modules/system/devices/udev/pdp/default.nix b/modules/system/devices/udev/pdp/default.nix new file mode 100644 index 00000000..652309f2 --- /dev/null +++ b/modules/system/devices/udev/pdp/default.nix @@ -0,0 +1,14 @@ +{ pkgs, ... }: +{ + services.udev = let + pdpRules = pkgs.writeTextFile { + name = "10-pdp.rules"; + text = ''SUBSYSTEM=="usb", ATTR{idVendor}=="2833", MODE="0666"''; + destination = "/etc/udev/rules.d/10-pdp.rules"; + }; + in { + packages = [ + pdpRules + ]; + }; +} diff --git a/system/modules/opengl.nix b/modules/system/devices/video/default.nix similarity index 85% rename from system/modules/opengl.nix rename to modules/system/devices/video/default.nix index a68615fe..34ef10a7 100644 --- a/system/modules/opengl.nix +++ b/modules/system/devices/video/default.nix @@ -1,5 +1,5 @@ -{pkgs, ...}: { - # Enable OpenGL +{ pkgs, ... }: +{ hardware.opengl = { enable = true; driSupport32Bit = true; diff --git a/modules/system/devices/video/nouveau/default.nix b/modules/system/devices/video/nouveau/default.nix new file mode 100644 index 00000000..41aeb2ca --- /dev/null +++ b/modules/system/devices/video/nouveau/default.nix @@ -0,0 +1,4 @@ +{ config, lib, ... }: +{ + services.xserver.videoDrivers = [ "nouveau" ]; +} diff --git a/modules/system/devices/video/nvidia/default.nix b/modules/system/devices/video/nvidia/default.nix new file mode 100644 index 00000000..03ceb165 --- /dev/null +++ b/modules/system/devices/video/nvidia/default.nix @@ -0,0 +1,10 @@ +{ pkgs, config, lib, ... }: +{ + services.xserver.videoDrivers = [ "nvidia" ]; + hardware.nvidia = { + modesetting.enable = true; + nvidiaSettings = false; + package = config.boot.kernelPackages.nvidiaPackages.latest; + open = false; + }; +} diff --git a/modules/system/programs/appimage/default.nix b/modules/system/programs/appimage/default.nix new file mode 100644 index 00000000..a890a255 --- /dev/null +++ b/modules/system/programs/appimage/default.nix @@ -0,0 +1,7 @@ +{ ... }: +{ + programs.appimage = { + enable = true; + binfmt = true; + }; +} diff --git a/modules/system/programs/default.nix b/modules/system/programs/default.nix new file mode 100644 index 00000000..cbc336a4 --- /dev/null +++ b/modules/system/programs/default.nix @@ -0,0 +1,9 @@ +{ ... }: +{ + imports = [ + ./appimage + ./gaming + ./git + ./security + ]; +} diff --git a/system/desktop/gaming.nix b/modules/system/programs/gaming/default.nix similarity index 56% rename from system/desktop/gaming.nix rename to modules/system/programs/gaming/default.nix index 7e9d492f..87b879f9 100644 --- a/system/desktop/gaming.nix +++ b/modules/system/programs/gaming/default.nix @@ -1,10 +1,9 @@ -{pkgs, ...}: { - # Enable Gamemode to boost games +{ ... }: +{ programs.gamemode = { enable = true; settings.general.renice = 10; }; - # Enable hardware like the Steam Controller hardware.steam-hardware.enable = true; } diff --git a/modules/system/programs/git/default.nix b/modules/system/programs/git/default.nix new file mode 100644 index 00000000..42a3d3c1 --- /dev/null +++ b/modules/system/programs/git/default.nix @@ -0,0 +1,11 @@ +{ ... }: +{ + imports = [ + ./gpg + ]; + + programs.git = { + enable = true; + lfs.enable = true; + }; +} diff --git a/system/modules/gpg.nix b/modules/system/programs/git/gpg/default.nix similarity index 59% rename from system/modules/gpg.nix rename to modules/system/programs/git/gpg/default.nix index 917bf207..7fbd7dd4 100644 --- a/system/modules/gpg.nix +++ b/modules/system/programs/git/gpg/default.nix @@ -1,8 +1,10 @@ -{pkgs, ...}: { +{ pkgs, ... }: +{ programs.gnupg.agent = { - enable = true; - enableSSHSupport = true; + enable = true; + enableSSHSupport = true; }; + environment.systemPackages = with pkgs; [ git-crypt ]; diff --git a/modules/system/programs/security/apparmor/default.nix b/modules/system/programs/security/apparmor/default.nix new file mode 100644 index 00000000..d2475784 --- /dev/null +++ b/modules/system/programs/security/apparmor/default.nix @@ -0,0 +1,4 @@ +{ ... }: +{ + security.apparmor.enable = true; +} diff --git a/modules/system/programs/security/default.nix b/modules/system/programs/security/default.nix new file mode 100644 index 00000000..d9e18715 --- /dev/null +++ b/modules/system/programs/security/default.nix @@ -0,0 +1,7 @@ +{ ... }: +{ + imports = [ + ./apparmor + ./doas + ]; +} diff --git a/system/modules/security.nix b/modules/system/programs/security/doas/default.nix similarity index 83% rename from system/modules/security.nix rename to modules/system/programs/security/doas/default.nix index 98565be8..f182327b 100644 --- a/system/modules/security.nix +++ b/modules/system/programs/security/doas/default.nix @@ -1,5 +1,5 @@ +{ ... }: { - # Enable AppArmor security = { sudo.enable = false; doas = { @@ -12,6 +12,5 @@ } ]; }; - apparmor.enable = true; }; } diff --git a/modules/system/services/common/default.nix b/modules/system/services/common/default.nix new file mode 100644 index 00000000..837aa1ed --- /dev/null +++ b/modules/system/services/common/default.nix @@ -0,0 +1,6 @@ +{ ... }: +{ + imports = [ + ./ssh + ]; +} diff --git a/modules/system/services/common/ssh/default.nix b/modules/system/services/common/ssh/default.nix new file mode 100644 index 00000000..03b5dc31 --- /dev/null +++ b/modules/system/services/common/ssh/default.nix @@ -0,0 +1,16 @@ +{ ... }: +{ + imports = [ + ./fail2ban + ]; + + services.openssh = { + enable = true; + settings = { + PermitRootLogin = "no"; + PrintLastLog = "no"; + PasswordAuthentication = false; + UsePAM = false; + }; + }; +} diff --git a/modules/system/services/common/ssh/fail2ban/default.nix b/modules/system/services/common/ssh/fail2ban/default.nix new file mode 100644 index 00000000..48e494fd --- /dev/null +++ b/modules/system/services/common/ssh/fail2ban/default.nix @@ -0,0 +1,8 @@ +{ ... }: +{ + services.fail2ban = { + enable = true; + maxretry = 5; + bantime = "5m"; + }; +} diff --git a/modules/system/services/default.nix b/modules/system/services/default.nix new file mode 100644 index 00000000..4c94199b --- /dev/null +++ b/modules/system/services/default.nix @@ -0,0 +1,7 @@ +{ ... }: +{ + imports = [ + ./common + ./pc + ]; +} diff --git a/modules/system/services/pc/default.nix b/modules/system/services/pc/default.nix new file mode 100644 index 00000000..8eb00444 --- /dev/null +++ b/modules/system/services/pc/default.nix @@ -0,0 +1,11 @@ +{ ... }: +{ + imports = [ + ./fwupd + ./gnome-keyring + ./keyd + ./mpd + ./networkfs + ./polkit + ]; +} diff --git a/modules/system/services/pc/fwupd/default.nix b/modules/system/services/pc/fwupd/default.nix new file mode 100644 index 00000000..9052a1d8 --- /dev/null +++ b/modules/system/services/pc/fwupd/default.nix @@ -0,0 +1,8 @@ +{ pkgs, ... }: +{ + services.fwupd.enable = true; + + environment.systemPackages = with pkgs; [ + fwupd + ]; +} diff --git a/system/services/gnome-keyring.nix b/modules/system/services/pc/gnome-keyring/default.nix similarity index 84% rename from system/services/gnome-keyring.nix rename to modules/system/services/pc/gnome-keyring/default.nix index 9dd1656e..081985ce 100644 --- a/system/services/gnome-keyring.nix +++ b/modules/system/services/pc/gnome-keyring/default.nix @@ -1,3 +1,4 @@ +{ ... }: { services.gnome.gnome-keyring.enable = true; } diff --git a/modules/system/services/pc/keyd/default.nix b/modules/system/services/pc/keyd/default.nix new file mode 100644 index 00000000..2af12884 --- /dev/null +++ b/modules/system/services/pc/keyd/default.nix @@ -0,0 +1,28 @@ +{ ... }: +{ + services.keyd = { + enable = true; + keyboards.default = { + ids = [ "*" ]; + settings = { + main = { + capslock = "overload(control,esc)"; + esc = "capslock"; + rightcontrol = "esc"; + leftcontrol = "noop"; + left = "noop"; + down = "noop"; + up = "noop"; + right = "noop"; + }; + control = { + h = "left"; + j = "down"; + k = "up"; + l = "right"; + semicolon = "macro(C-l)"; + }; + }; + }; + }; +} diff --git a/system/services/mpd.nix b/modules/system/services/pc/mpd/default.nix similarity index 68% rename from system/services/mpd.nix rename to modules/system/services/pc/mpd/default.nix index 9f441969..e91251c3 100644 --- a/system/services/mpd.nix +++ b/modules/system/services/pc/mpd/default.nix @@ -1,10 +1,11 @@ -{config, pkgs, ...}: { +{ config, ... }: +{ services.mpd = { enable = true; user = "jimbo"; group = "users"; - musicDirectory = "/home/jimbo/JimboNFS/Music"; - playlistDirectory = "/home/jimbo/JimboNFS/Music/Playlists"; + musicDirectory = "/home/jimbo/JimboNFS/Music/Synced"; + playlistDirectory = "/home/jimbo/JimboNFS/Music/Synced/Playlists"; extraConfig = '' audio_output { type "pipewire" @@ -12,6 +13,7 @@ } ''; }; + systemd.services.mpd.environment = { XDG_RUNTIME_DIR = "/run/user/${toString config.users.users.jimbo.uid}"; }; diff --git a/modules/system/services/pc/networkfs/default.nix b/modules/system/services/pc/networkfs/default.nix new file mode 100644 index 00000000..1681237f --- /dev/null +++ b/modules/system/services/pc/networkfs/default.nix @@ -0,0 +1,7 @@ +{ ... }: +{ + services = { + gvfs.enable = true; + udisks2.enable = true; + }; +} diff --git a/modules/system/services/pc/polkit/default.nix b/modules/system/services/pc/polkit/default.nix new file mode 100644 index 00000000..b8b850ee --- /dev/null +++ b/modules/system/services/pc/polkit/default.nix @@ -0,0 +1,7 @@ +{ ... }: +{ + security = { + polkit.enable = true; + rtkit.enable = true; + }; +} diff --git a/modules/system/services/pc/school/default.nix b/modules/system/services/pc/school/default.nix new file mode 100644 index 00000000..e5756bd5 --- /dev/null +++ b/modules/system/services/pc/school/default.nix @@ -0,0 +1,6 @@ +{ ... }: +{ + imports = [ + ./globalprotect + ]; +} diff --git a/modules/system/services/pc/school/globalprotect/default.nix b/modules/system/services/pc/school/globalprotect/default.nix new file mode 100644 index 00000000..a124cad8 --- /dev/null +++ b/modules/system/services/pc/school/globalprotect/default.nix @@ -0,0 +1,4 @@ +{ ... }: +{ + services.globalprotect.enable = true; +} diff --git a/system/services/sunshine.nix b/modules/system/services/pc/sunshine/default.nix similarity index 75% rename from system/services/sunshine.nix rename to modules/system/services/pc/sunshine/default.nix index e1f23879..e73dccba 100644 --- a/system/services/sunshine.nix +++ b/modules/system/services/pc/sunshine/default.nix @@ -1,5 +1,5 @@ +{ ... }: { - # Enable Sunshine as a service services.sunshine = { enable = true; settings.port = 57989; diff --git a/system/services/qemukvm.nix b/modules/system/services/pc/virtualization/qemu/default.nix similarity index 96% rename from system/services/qemukvm.nix rename to modules/system/services/pc/virtualization/qemu/default.nix index f50caa92..4b5db05d 100644 --- a/system/services/qemukvm.nix +++ b/modules/system/services/pc/virtualization/qemu/default.nix @@ -1,4 +1,5 @@ -{config, pkgs, ...}: { +{ config, pkgs, ... }: +{ virtualisation = { libvirtd = { enable = true; diff --git a/system/services/waydroid.nix b/modules/system/services/pc/virtualization/waydroid/default.nix similarity index 67% rename from system/services/waydroid.nix rename to modules/system/services/pc/virtualization/waydroid/default.nix index 00ff0d98..521a802c 100644 --- a/system/services/waydroid.nix +++ b/modules/system/services/pc/virtualization/waydroid/default.nix @@ -1,3 +1,4 @@ +{ config, lib, ... }: { virtualisation.waydroid.enable = true; } diff --git a/modules/system/services/server/acme/default.nix b/modules/system/services/server/acme/default.nix new file mode 100644 index 00000000..ab2c23c1 --- /dev/null +++ b/modules/system/services/server/acme/default.nix @@ -0,0 +1,7 @@ +{ config, ... }: +{ + security.acme = { + acceptTerms = true; + defaults.email = "jimjam4real@gmail.com"; + }; +} diff --git a/modules/system/services/server/ddclient/default.nix b/modules/system/services/server/ddclient/default.nix new file mode 100644 index 00000000..ab66c912 --- /dev/null +++ b/modules/system/services/server/ddclient/default.nix @@ -0,0 +1,23 @@ +{ pkgs, config, ... }: +{ + services.ddclient = { + enable = true; + protocol = "cloudflare"; + use = "web, web=https://ipinfo.io/ip"; + zone = "${config.domains.jim1}"; + username = "token"; + passwordFile = "${pkgs.writeText "cloudflareapikey" config.secrets.flareApiKey}"; + domains = [ + "${config.domains.jim1}" + "*.${config.domains.jim1}" + "sv.${config.domains.jim1}" + "git.${config.domains.jim1}" + "rtmp.${config.domains.jim1}" + "turn.${config.domains.jim1}" + "dew.${config.domains.jim1}" + "john.${config.domains.jim1}" + "beta.${config.domains.jim1}" + "rogue.${config.domains.jim1}" + ]; + }; +} diff --git a/modules/system/services/server/default.nix b/modules/system/services/server/default.nix new file mode 100644 index 00000000..c5b5f710 --- /dev/null +++ b/modules/system/services/server/default.nix @@ -0,0 +1,17 @@ +{ ... }: +{ + imports = [ + ./acme + ./ddclient + ./fileserver + ./forgejo + ./icecast + ./minecraft + ./misc + ./mysql + ./social + ./transmission + ./vaultwarden + ./webhost + ]; +} diff --git a/modules/system/services/server/fileserver/default.nix b/modules/system/services/server/fileserver/default.nix new file mode 100644 index 00000000..5db3fb2c --- /dev/null +++ b/modules/system/services/server/fileserver/default.nix @@ -0,0 +1,7 @@ +{ ... }: +{ + imports = [ + ./local + ./public + ]; +} diff --git a/modules/system/services/server/fileserver/local/default.nix b/modules/system/services/server/fileserver/local/default.nix new file mode 100644 index 00000000..c10f4f66 --- /dev/null +++ b/modules/system/services/server/fileserver/local/default.nix @@ -0,0 +1,7 @@ +{ ... }: +{ + imports = [ + ./nfs + ./samba + ]; +} diff --git a/modules/system/services/server/fileserver/local/nfs/default.nix b/modules/system/services/server/fileserver/local/nfs/default.nix new file mode 100644 index 00000000..ce8f7214 --- /dev/null +++ b/modules/system/services/server/fileserver/local/nfs/default.nix @@ -0,0 +1,17 @@ +{ ... }: +{ + services.nfs.server = { + enable = true; + exports = '' + /export/JimboNFS/Downloads *(rw,sync,no_subtree_check) + /export/JimboNFS/Documents *(rw,sync,no_subtree_check) + /export/JimboNFS/Photos *(rw,sync,no_subtree_check) + /export/JimboNFS/Videos/Random *(rw,sync,no_subtree_check) + /export/JimboNFS/Videos/Media *(rw,sync,no_subtree_check) + /export/JimboNFS/Music/Synced *(rw,sync,no_subtree_check) + /export/JimboNFS/Music/Unsynced *(rw,sync,no_subtree_check) + /export/JimboNFS/Projects *(rw,sync,no_subtree_check) + /export/JimboNFS/School *(rw,sync,no_subtree_check) + ''; + }; +} diff --git a/system/server/samba.nix b/modules/system/services/server/fileserver/local/samba/default.nix similarity index 89% rename from system/server/samba.nix rename to modules/system/services/server/fileserver/local/samba/default.nix index 2c0da8ae..7236f2d7 100644 --- a/system/server/samba.nix +++ b/modules/system/services/server/fileserver/local/samba/default.nix @@ -1,4 +1,5 @@ -{outputs, ...}: { +{ config, ... }: +{ services = { samba = { enable = true; @@ -8,7 +9,7 @@ workgroup = WORKGROUP server string = JimSMB security = user - hosts allow = ${outputs.ips.localSpan}. 127.0.0.1 localhost + hosts allow = ${config.ips.localSpan}. 127.0.0.1 localhost hosts deny = 0.0.0.0/0 guest account = nobody map to guest = bad user diff --git a/modules/system/services/server/fileserver/public/default.nix b/modules/system/services/server/fileserver/public/default.nix new file mode 100644 index 00000000..252fe217 --- /dev/null +++ b/modules/system/services/server/fileserver/public/default.nix @@ -0,0 +1,7 @@ +{ ... }: +{ + imports = [ + ./nextcloud + ./photoprism + ]; +} diff --git a/system/server/nextcloud.nix b/modules/system/services/server/fileserver/public/nextcloud/default.nix similarity index 64% rename from system/server/nextcloud.nix rename to modules/system/services/server/fileserver/public/nextcloud/default.nix index 644bcb22..7c2129ea 100644 --- a/system/server/nextcloud.nix +++ b/modules/system/services/server/fileserver/public/nextcloud/default.nix @@ -1,9 +1,10 @@ -{pkgs, outputs, ...}: { +{ pkgs, config, ... }: +{ services = { nextcloud = { enable = true; package = pkgs.nextcloud29; - hostName = "cloud.${outputs.secrets.jimDomain}"; + hostName = "cloud.${config.domains.jim1}"; datadir = "/mnt/nextcloud"; https = true; config = { @@ -12,21 +13,20 @@ }; settings = { trusted_proxies = [ "127.0.0.1" ]; - trusted_domains = [ "cloud.${outputs.secrets.jimDomain}" ]; + trusted_domains = [ "cloud.${config.domains.jim1}" ]; overwriteprotocol = "https"; - - # Mailserver settings - mail_smtphost = "mx.${outputs.secrets.jimDomain}"; - mail_domain = "${outputs.secrets.jimDomain}"; + mail_smtphost = "mx.${config.domains.jim1}"; + mail_domain = "${config.domains.jim1}"; mail_from_address = "noreply"; mail_smtpauth = "true"; - mail_smtpname = "noreply@${outputs.secrets.jimDomain}"; - mail_smtppassword = outputs.secrets.noreplyPassword; + mail_smtpname = "noreply@${config.domains.jim1}"; + mail_smtppassword = config.secrets.noreplyPassword; mail_smtpmode = "smtp"; mail_smtpport = 587; }; }; - nginx.virtualHosts."cloud.${outputs.secrets.jimDomain}" = { + + nginx.virtualHosts."cloud.${config.domains.jim1}" = { enableACME = true; addSSL = true; locations."/" = { diff --git a/system/server/photoprism.nix b/modules/system/services/server/fileserver/public/photoprism/default.nix similarity index 75% rename from system/server/photoprism.nix rename to modules/system/services/server/fileserver/public/photoprism/default.nix index 4e8283dd..59b01efa 100644 --- a/system/server/photoprism.nix +++ b/modules/system/services/server/fileserver/public/photoprism/default.nix @@ -1,4 +1,5 @@ -{outputs, ...}: { +{ config, ... }: +{ services = { photoprism = { enable = true; @@ -7,17 +8,17 @@ address = "0.0.0.0"; settings = { PHOTOPRISM_ADMIN_USER = "jimbo"; - PHOTOPRISM_ADMIN_PASSWORD = "${outputs.secrets.prismAdminPass}"; + PHOTOPRISM_ADMIN_PASSWORD = "${config.secrets.prismAdminPass}"; PHOTOPRISM_DEFAULT_LOCALE = "en"; PHOTOPRISM_DATABASE_DRIVER = "mysql"; PHOTOPRISM_DATABASE_NAME = "photoprism"; PHOTOPRISM_DATABASE_SERVER = "/run/mysqld/mysqld.sock"; PHOTOPRISM_DATABASE_USER = "photoprism"; - PHOTOPRISM_SITE_URL = "https://gallery.${outputs.secrets.jimDomain}"; + PHOTOPRISM_SITE_URL = "https://gallery.${config.domains.jim1}"; PHOTOPRISM_SITE_TITLE = "Jimbo's PhotoPrism"; }; }; - nginx.virtualHosts."gallery.${outputs.secrets.jimDomain}" = { + nginx.virtualHosts."gallery.${config.domains.jim1}" = { enableACME = true; forceSSL = true; locations."/" = { diff --git a/modules/system/services/server/forgejo/default.nix b/modules/system/services/server/forgejo/default.nix new file mode 100644 index 00000000..e03ca36a --- /dev/null +++ b/modules/system/services/server/forgejo/default.nix @@ -0,0 +1,39 @@ +{ config, ... }: +{ + imports = [ + ./nginx + ]; + + services = { + forgejo = { + enable = true; + settings = { + server = { + DOMAIN = "git.${config.domains.jim1}"; + ROOT_URL = "https://git.${config.domains.jim1}:443"; + HTTP_PORT = 3110; + SSH_PORT = 2299; + START_SSH_SERVER = true; + }; + ui = { + DEFAULT_THEME = "forgejo-dark"; + }; + mailer = { + ENABLED = true; + SMTP_ADDR = "mx.${config.domains.jim1}"; + FROM = "Jimbo's Git "; + USER = "noreply@${config.domains.jim1}"; + PASSWD = config.secrets.noreplyPassword; + PROTOCOL = "smtps"; + }; + service = { + REGISTER_EMAIL_CONFIRM = true; + DISABLE_REGISTRATION = true; + }; + }; + }; + }; + + # Allow Forgejo's SSH to work + networking.firewall.allowedTCPPorts = [ 2299 ]; +} diff --git a/modules/system/services/server/forgejo/nginx/default.nix b/modules/system/services/server/forgejo/nginx/default.nix new file mode 100644 index 00000000..23354d71 --- /dev/null +++ b/modules/system/services/server/forgejo/nginx/default.nix @@ -0,0 +1,11 @@ +{ config, ... }: +{ + services.nginx.virtualHosts."git.${config.domains.jim1}" = { + enableACME = true; + forceSSL = true; + locations."/" = { + proxyPass = "http://127.0.0.1:3110"; + proxyWebsockets = true; + }; + }; +} diff --git a/system/server/icecast.nix b/modules/system/services/server/icecast/default.nix similarity index 65% rename from system/server/icecast.nix rename to modules/system/services/server/icecast/default.nix index c33bac3e..f2aff00d 100644 --- a/system/server/icecast.nix +++ b/modules/system/services/server/icecast/default.nix @@ -1,23 +1,26 @@ -{pkgs, outputs, ...}: { - # Icecast, replacing Azuracast maybe +{ pkgs, config, ... }: +{ + imports = [ + ./nginx + ]; + services = { - # The host service icecast = { enable = true; listen.port = 265; - hostname = "icecast.${outputs.secrets.jimDomain}"; + hostname = "icecast.${config.domains.jim1}"; admin = { user = "jimbo"; - password = "${outputs.secrets.castAdminPass}"; + password = "${config.secrets.castAdminPass}"; }; extraConf = '' - ${outputs.secrets.castSourcePass} + ${config.secrets.castSourcePass} - - Canada - jimbo@jimbosfiles.com - + + Canada + jimbo@${config.domains.jim2} + /jimbops.opus JimBops Radio @@ -31,9 +34,8 @@ }; # The audio stream - liquidsoap.streams = let - JimBops = '' - # CONFIGURATION + liquidsoap.streams = { + jimbops = pkgs.writeText "liquidjim" '' settings.log.stdout.set(true) settings.init.allow_root.set(true) settings.scheduler.fast_queues.set(2) @@ -50,7 +52,7 @@ %ffmpeg(format="ogg", %audio(codec="libvorbis", samplerate=48000, b="256k", channels=2)), host="127.0.0.1", port=265, - password="${outputs.secrets.castSourcePass}", + password="${config.secrets.castSourcePass}", public=true, icy_metadata=["artist", "title"], mount="jimbops.opus", @@ -58,21 +60,6 @@ jimbops_fallback ) ''; - in { - jimbops = pkgs.writeText "liquidjim" JimBops; - }; - - # The web frontend - nginx.virtualHosts."icecast.${outputs.secrets.jimDomain}" = { - enableACME = true; - forceSSL = true; - locations."/" = { - proxyPass = "http://127.0.0.1:265"; - proxyWebsockets = true; - extraConfig = '' - add_header Ice-Public "1"; - ''; - }; }; }; } diff --git a/modules/system/services/server/icecast/nginx/default.nix b/modules/system/services/server/icecast/nginx/default.nix new file mode 100644 index 00000000..ba97eab3 --- /dev/null +++ b/modules/system/services/server/icecast/nginx/default.nix @@ -0,0 +1,14 @@ +{ config, ... }: +{ + services.nginx.virtualHosts."icecast.${config.domains.jim1}" = { + enableACME = true; + forceSSL = true; + locations."/" = { + proxyPass = "http://127.0.0.1:265"; + proxyWebsockets = true; + extraConfig = '' + add_header Ice-Public "1"; + ''; + }; + }; +} diff --git a/modules/system/services/server/mailserver/default.nix b/modules/system/services/server/mailserver/default.nix new file mode 100644 index 00000000..0c37f912 --- /dev/null +++ b/modules/system/services/server/mailserver/default.nix @@ -0,0 +1,7 @@ +{ ... }: +{ + imports = [ + ./simplenix + ./roundcube + ]; +} diff --git a/modules/system/services/server/mailserver/roundcube/default.nix b/modules/system/services/server/mailserver/roundcube/default.nix new file mode 100644 index 00000000..e986536d --- /dev/null +++ b/modules/system/services/server/mailserver/roundcube/default.nix @@ -0,0 +1,12 @@ +{ pkgs, config, ... }: +{ + services.roundcube = { + enable = true; + hostName = "mail.${config.domains.jim1}"; + extraConfig = '' + $config['smtp_server'] = "tls://mx.${config.domains.jim1}"; + $config['smtp_user'] = "%u"; + $config['smtp_pass'] = "%p"; + ''; + }; +} diff --git a/modules/system/services/server/mailserver/simplenix/default.nix b/modules/system/services/server/mailserver/simplenix/default.nix new file mode 100644 index 00000000..69c425bf --- /dev/null +++ b/modules/system/services/server/mailserver/simplenix/default.nix @@ -0,0 +1,58 @@ +{ mailserver, pkgs, config, ... }: +{ + imports = [ + ./nginx + mailserver.nixosModule + ]; + + mailserver = rec { + enable = true; + domains = [ + "${config.domains.jim1}" + "${config.domains.jim2}" + "${config.domains.luna}" + "${config.domains.corn}" + ]; + fqdn = "mx.${config.domains.jim1}"; + certificateScheme = "acme-nginx"; + localDnsResolver = false; + redis.port = 1515; + + dmarcReporting = { + enable = true; + domain = "${config.domains.jim1}"; + localpart = "noreply"; + organizationName = "Jimbo's Files"; + }; + + # A list of accounts, passwords generated with nix-shell -p mkpasswd --run 'mkpasswd -sm bcrypt' + loginAccounts = { + "noreply@${config.domains.jim1}" = { + hashedPasswordFile = pkgs.writeText "noreply" config.secrets.noreplyMailHash; + sendOnly = true; + }; + "jimbo@${config.domains.jim2}" = { + hashedPasswordFile = pkgs.writeText "jimbo" config.secrets.jimboMailHash; + aliases = [ + "jimbo@${config.domains.jim1}" + "james@${config.domains.jim1}" + "james@${config.domains.jim2}" + "contact@${config.domains.jim1}" + "contact@${config.domains.jim2}" + ]; + }; + "luna@${config.domains.luna}" = { + hashedPasswordFile = pkgs.writeText "luna" config.secrets.lunaMailHash; + }; + "corn@${config.domains.corn}" = { + hashedPasswordFile = pkgs.writeText "corn" config.secrets.cornMailHash; + }; + "tiny@${config.domains.corn}" = { + hashedPasswordFile = pkgs.writeText "tiny" config.secrets.tinyMailHash; + }; + }; + }; + + # Assign the correct port + services.redis.servers.rspamd.port = 1515; +} diff --git a/modules/system/services/server/mailserver/simplenix/nginx/default.nix b/modules/system/services/server/mailserver/simplenix/nginx/default.nix new file mode 100644 index 00000000..e0a30d5f --- /dev/null +++ b/modules/system/services/server/mailserver/simplenix/nginx/default.nix @@ -0,0 +1,11 @@ +{ pkgs, config, ... }: +{ + services.nginx.virtualHosts."mx.${config.domains.jim1}" = { + enableACME = true; + forceSSL = true; + locations."/" = { + proxyPass = "http://127.0.0.1:1390"; + proxyWebsockets = true; + }; + }; +} diff --git a/system/server/minecraft/common.nix b/modules/system/services/server/minecraft/common/default.nix similarity index 85% rename from system/server/minecraft/common.nix rename to modules/system/services/server/minecraft/common/default.nix index b46489bc..a432b530 100644 --- a/system/server/minecraft/common.nix +++ b/modules/system/services/server/minecraft/common/default.nix @@ -1,4 +1,5 @@ -{pkgs, ...}: { +{ pkgs, ... }: +{ # Common properties serverProperties = { enforce-secure-profile = false; @@ -26,10 +27,6 @@ # Common plugins paperSymlinks = { - "plugins/Backuper.jar" = builtins.fetchurl { - url = "https://cdn.modrinth.com/data/7cMAqMND/versions/DqtME18V/Backuper-3.1.0.jar"; - sha256 = "0lml9mz8ky2g9iy5xb61s15biwlbxfi5w4mfamxfin2kl4w6ggq9"; - }; "plugins/BungeeGuard.jar" = builtins.fetchurl { url = "https://github.com/lucko/BungeeGuard/releases/download/v1.3.3/BungeeGuard.jar"; sha256 = "0cackavwk7kl71hn1i78hcvkdp7q81srq35nranpvysbmm8v34vk"; @@ -47,8 +44,8 @@ sha256 = "02ad0dl34vdk6b1wyflqa6wq440xrh5w7yf3z3w1x1g089myddw4"; }; "plugins/ProtocolLib.jar" = builtins.fetchurl { - url = "https://ci.dmulloy2.net/job/ProtocolLib/lastSuccessfulBuild/artifact/build/libs/ProtocolLib.jar"; - sha256 = "16krc7pyav4khnaxkyg27i5yxsgcdkildrn4nm5bhzh1f0ngqv2s"; + url = "https://ci.dmulloy2.net/job/ProtocolLib/733/artifact/build/libs/ProtocolLib.jar"; + sha256 = "1gslh24kk7dcqiqxphzy8x2nrqa58f8gl5ah0iyg1ndx3pvr4z9m"; }; "plugins/Vault.jar" = builtins.fetchurl { url = "https://github.com/MilkBowl/Vault/releases/download/1.7.3/Vault.jar"; diff --git a/system/server/minecraft/essentialsconfig.yml b/modules/system/services/server/minecraft/common/essentialsconfig.yml similarity index 100% rename from system/server/minecraft/essentialsconfig.yml rename to modules/system/services/server/minecraft/common/essentialsconfig.yml diff --git a/system/server/minecraft/vcserver.properties b/modules/system/services/server/minecraft/common/vcserver.properties similarity index 100% rename from system/server/minecraft/vcserver.properties rename to modules/system/services/server/minecraft/common/vcserver.properties diff --git a/modules/system/services/server/minecraft/default.nix b/modules/system/services/server/minecraft/default.nix new file mode 100644 index 00000000..22ca6900 --- /dev/null +++ b/modules/system/services/server/minecraft/default.nix @@ -0,0 +1,19 @@ +{ minecraft, ... }: +{ + imports = [ + minecraft.nixosModules.minecraft-servers + ./servers/velocity + ./servers/dewdemolisher + ./servers/johnside + ./servers/roguecraft + #./servers/blockworld + #./servers/uberbeta + ]; + + nixpkgs.overlays = [ minecraft.overlay ]; + + services.minecraft-servers = { + enable = true; + eula = true; + }; +} diff --git a/system/server/minecraft/servers/blockworld.nix b/modules/system/services/server/minecraft/servers/blockworld/default.nix similarity index 87% rename from system/server/minecraft/servers/blockworld.nix rename to modules/system/services/server/minecraft/servers/blockworld/default.nix index 7f3e96dd..0aa81827 100644 --- a/system/server/minecraft/servers/blockworld.nix +++ b/modules/system/services/server/minecraft/servers/blockworld/default.nix @@ -1,5 +1,6 @@ -{pkgs, ...}: let - common = import ../common.nix { inherit pkgs; }; +{ pkgs, ... }: +let + common = import ../../common { inherit pkgs; }; in { services.minecraft-servers.servers.blockworld = { enable = true; diff --git a/system/server/minecraft/servers/dewdemolisher.nix b/modules/system/services/server/minecraft/servers/dewdemolisher/default.nix similarity index 86% rename from system/server/minecraft/servers/dewdemolisher.nix rename to modules/system/services/server/minecraft/servers/dewdemolisher/default.nix index 2c975754..c1b59e0c 100644 --- a/system/server/minecraft/servers/dewdemolisher.nix +++ b/modules/system/services/server/minecraft/servers/dewdemolisher/default.nix @@ -1,5 +1,6 @@ -{pkgs, ...}: let - common = import ../common.nix { inherit pkgs; }; +{ pkgs, ... }: +let + common = import ../../common { inherit pkgs; }; in { services.minecraft-servers.servers.dewdemolisher = { enable = true; diff --git a/system/server/minecraft/servers/johnside.nix b/modules/system/services/server/minecraft/servers/johnside/default.nix similarity index 84% rename from system/server/minecraft/servers/johnside.nix rename to modules/system/services/server/minecraft/servers/johnside/default.nix index 6baea7d7..4a26847b 100644 --- a/system/server/minecraft/servers/johnside.nix +++ b/modules/system/services/server/minecraft/servers/johnside/default.nix @@ -1,5 +1,6 @@ -{pkgs, outputs, ...}: let - common = import ../common.nix { inherit pkgs; }; +{ pkgs, config, ... }: +let + common = import ../../common { inherit pkgs; }; in { services = { minecraft-servers.servers.johnside = { @@ -42,7 +43,7 @@ in { }; # BlueMap webhost - nginx.virtualHosts."john.${outputs.secrets.jimDomain}" = { + nginx.virtualHosts."john.${config.domains.jim1}" = { enableACME = true; forceSSL = true; locations."/" = { @@ -51,16 +52,4 @@ in { }; }; }; - - # Allow Nginx to read and write to paths - systemd.services.nginx.serviceConfig = { - ReadWritePaths = [ "/var/www/Jimbo-Landing-Page/streams/hls/" ]; - }; - - # Open HTTP and HTTPs ports - networking.firewall = { - allowedTCPPorts = [ - 80 443 # Nginx - ]; - }; } diff --git a/system/server/minecraft/servers/roguecraft.nix b/modules/system/services/server/minecraft/servers/roguecraft/default.nix similarity index 70% rename from system/server/minecraft/servers/roguecraft.nix rename to modules/system/services/server/minecraft/servers/roguecraft/default.nix index 64b66b8e..a3b5537c 100644 --- a/system/server/minecraft/servers/roguecraft.nix +++ b/modules/system/services/server/minecraft/servers/roguecraft/default.nix @@ -1,5 +1,6 @@ -{pkgs, outputs, ...}: let - common = import ../common.nix { inherit pkgs; }; +{ pkgs, config, ... }: +let + common = import ../../common { inherit pkgs; }; in { services = { minecraft-servers.servers.roguecraft = { @@ -10,20 +11,20 @@ in { difficulty = 3; server-port = 30014; motd = "\\u00A7l\\u00A7bJimbo's \\u00A7cRoguecraft \\u00A7bserver."; - require-resource-pack = true; - resource-pack = "https://${outputs.secrets.jimDomain}/roguecraftresourcepackredir"; - resource-pack-sha1 = "b540c0562aba90c3ead2356bb9cb74fcf0db36b3"; + require-resource-pack = true; + resource-pack = "https://${config.domains.jim1}/roguecraftresourcepackredir"; + resource-pack-sha1 = "b540c0562aba90c3ead2356bb9cb74fcf0db36b3"; }; whitelist = common.whitelist; symlinks = common.paperSymlinks; files = common.configFiles // { "world/datapacks/roguecraft.zip" = builtins.fetchurl { - url = "https://${outputs.secrets.jimDomain}/roguecraftdatapackredir"; + url = "https://${config.domains.jim1}/roguecraftdatapackredir"; sha256 = "04zrkvzvi1i898al45fh9j3k635sf9qhwca7phbv4ynkfl8bz3q3"; }; }; }; - nginx.virtualHosts."${outputs.secrets.jimDomain}".locations = { + nginx.virtualHosts."${config.domains.jim1}".locations = { "/roguecraftdatapackredir" = { return = "301 https://cdn.modrinth.com/data/HtKjVijx/versions/Rme4c23R/Roguecraft%201.2.6%20-%20Data%20Pack.zip"; }; diff --git a/system/server/minecraft/servers/uberbeta.nix b/modules/system/services/server/minecraft/servers/uberbeta/default.nix similarity index 89% rename from system/server/minecraft/servers/uberbeta.nix rename to modules/system/services/server/minecraft/servers/uberbeta/default.nix index b9004dd3..3bbcbaf6 100644 --- a/system/server/minecraft/servers/uberbeta.nix +++ b/modules/system/services/server/minecraft/servers/uberbeta/default.nix @@ -1,5 +1,6 @@ -{pkgs, ...}: let - common = import ../common.nix { inherit pkgs; }; +{ pkgs, ... }: +let + common = import ../../common { inherit pkgs; }; uberBukkitZip = pkgs.fetchzip { url = "https://github.com/Moresteck/Project-Poseidon-Uberbukkit/releases/download/2.0.0/uberbukkit-2.0.0-java17.zip"; sha256 = "m4hgcqXJ43SnBGn6qNBGeEcXFv5Q8f/VFYJmx3aJ9PE="; diff --git a/system/server/minecraft/servers/velocity.nix b/modules/system/services/server/minecraft/servers/velocity/default.nix similarity index 79% rename from system/server/minecraft/servers/velocity.nix rename to modules/system/services/server/minecraft/servers/velocity/default.nix index b02b657d..48a3ca75 100644 --- a/system/server/minecraft/servers/velocity.nix +++ b/modules/system/services/server/minecraft/servers/velocity/default.nix @@ -1,5 +1,6 @@ -{pkgs, ...}: let - common = import ../common.nix { inherit pkgs; }; +{ pkgs, ... }: +let + common = import ../../common { inherit pkgs; }; in { services.minecraft-servers.servers.velocity = { enable = true; @@ -7,12 +8,12 @@ in { jvmOpts = "-Xmx512M"; symlinks = { "plugins/Geyser.jar" = builtins.fetchurl { - url = "https://download.geysermc.org/v2/projects/geyser/versions/2.4.3/builds/688/downloads/velocity"; - sha256 = "0gmsr2pspjklnshrrm7ril8c669gsac4v9ck4n6j85p0dp6aizql"; + url = "https://download.geysermc.org/v2/projects/geyser/versions/2.4.2/builds/660/downloads/velocity"; + sha256 = "09z938v6xrgbiba8rxgi7cdh3xxkv9fdampy15k6fmwddmj9y4a2"; }; "plugins/Floodgate.jar" = builtins.fetchurl { - url = "https://download.geysermc.org/v2/projects/floodgate/versions/2.2.3/builds/112/downloads/velocity"; - sha256 = "1cbb9qdlk9nw2q1vchq4fq553qxqi49268pg46b426wsa1yxjqa9"; + url = "https://download.geysermc.org/v2/projects/floodgate/versions/2.2.3/builds/109/downloads/velocity"; + sha256 = "1hxdf38qzpzdnyn2gn1152fyd54bi37i0ayc82dgcjf0qrcbmv0c"; }; "plugins/LuckPerms.jar" = builtins.fetchurl { url = "https://download.luckperms.net/1556/velocity/LuckPerms-Velocity-5.4.141.jar"; @@ -39,11 +40,18 @@ in { # Open ports for proxy networking.firewall = { + # Server and info allowedTCPPorts = [ - 25565 19132 30013 5657 # Minecraft server info + 25565 + 19132 + 30013 + 5657 ]; + # Server, VC, and Bedrock allowedUDPPorts = [ - 25565 19132 30013 # Minecraft server, VC, and Bedrock + 25565 + 19132 + 30013 ]; }; } diff --git a/modules/system/services/server/misc/default.nix b/modules/system/services/server/misc/default.nix new file mode 100644 index 00000000..e976caf1 --- /dev/null +++ b/modules/system/services/server/misc/default.nix @@ -0,0 +1,7 @@ +{ ... }: +{ + services = { + snowflake-proxy.enable = true; + logrotate.checkConfig = false; + }; +} diff --git a/system/server/mariadb.nix b/modules/system/services/server/mysql/default.nix similarity index 96% rename from system/server/mariadb.nix rename to modules/system/services/server/mysql/default.nix index 8848e802..5e999b98 100644 --- a/system/server/mariadb.nix +++ b/modules/system/services/server/mysql/default.nix @@ -1,4 +1,5 @@ -{pkgs, ...}: { +{ pkgs, ... }: +{ services.mysql = { enable = true; package = pkgs.mariadb; diff --git a/modules/system/services/server/social/default.nix b/modules/system/services/server/social/default.nix new file mode 100644 index 00000000..7177cce1 --- /dev/null +++ b/modules/system/services/server/social/default.nix @@ -0,0 +1,10 @@ +{ ... }: +{ + imports = [ + ./matrix + ./mastodon + ./lemmy + ./pixelfed + ./owncast + ]; +} diff --git a/modules/system/services/server/social/lemmy/default.nix b/modules/system/services/server/social/lemmy/default.nix new file mode 100644 index 00000000..17041653 --- /dev/null +++ b/modules/system/services/server/social/lemmy/default.nix @@ -0,0 +1,22 @@ +{ config, ... }: +{ + imports = [ + ./nginx + ]; + + services.lemmy = { + enable = true; + nginx.enable = true; + database.createLocally = true; + settings = { + hostname = "lemmy.${config.domains.jim1}"; + email = { + smtp_server = "mx.${config.domains.jim1}:587"; + smtp_login = "noreply@${config.domains.jim1}"; + smtp_from_address = "Jimbo's Lemmy "; + smtp_password = config.secrets.noreplyPassword; + tls_type = "starttls"; + }; + }; + }; +} diff --git a/modules/system/services/server/social/lemmy/nginx/default.nix b/modules/system/services/server/social/lemmy/nginx/default.nix new file mode 100644 index 00000000..60d6c032 --- /dev/null +++ b/modules/system/services/server/social/lemmy/nginx/default.nix @@ -0,0 +1,7 @@ +{ config, ... }: +{ + services.nginx.virtualHosts."lemmy.${config.domains.jim1}" = { + enableACME = true; + forceSSL = true; + }; +} diff --git a/modules/system/services/server/social/mastodon/default.nix b/modules/system/services/server/social/mastodon/default.nix new file mode 100644 index 00000000..eedc2905 --- /dev/null +++ b/modules/system/services/server/social/mastodon/default.nix @@ -0,0 +1,18 @@ +{ pkgs, config, ... }: +{ + services.mastodon = { + enable = true; + localDomain = "social.${config.domains.jim1}"; + streamingProcesses = 4; + configureNginx = true; + smtp = { + createLocally = false; + host = "mx.${config.domains.jim1}"; + port = 587; + authenticate = true; + fromAddress = "Jimbo's Mastodon "; + user = "noreply@${config.domains.jim1}"; + passwordFile = pkgs.writeText "smtp_pass.txt" config.secrets.noreplyPassword; + }; + }; +} diff --git a/modules/system/services/server/social/matrix/default.nix b/modules/system/services/server/social/matrix/default.nix new file mode 100644 index 00000000..daef3a94 --- /dev/null +++ b/modules/system/services/server/social/matrix/default.nix @@ -0,0 +1,7 @@ +{ ... }: +{ + imports = [ + ./synapse + ./element + ]; +} diff --git a/modules/system/services/server/social/matrix/element/default.nix b/modules/system/services/server/social/matrix/element/default.nix new file mode 100644 index 00000000..30188169 --- /dev/null +++ b/modules/system/services/server/social/matrix/element/default.nix @@ -0,0 +1,25 @@ +{ pkgs, config, ... }: +{ + imports = [ + ./nginx + ]; + + nixpkgs.config.element-web.conf = { + default_server_config = { + "m.homeserver" = { + base_url = "https://matrix.${config.domains.jim1}"; + server_name = "matrix.${config.domains.jim1}"; + }; + }; + branding = { + #welcome_background_url = "https://staging.${config.domains.jim1}/images/backgrounds/template-background.png"; + #auth_header_logo_url = "https://staging.${config.domains.jim1}/images/logos/template-logo.png"; + }; + embedded_pages = { + home_url = "https://www.${config.domains.jim1}/"; + }; + disable_custom_urls = true; + disable_guests = true; + default_theme = "dark"; + }; +} diff --git a/modules/system/services/server/social/matrix/element/nginx/default.nix b/modules/system/services/server/social/matrix/element/nginx/default.nix new file mode 100644 index 00000000..4308c4c4 --- /dev/null +++ b/modules/system/services/server/social/matrix/element/nginx/default.nix @@ -0,0 +1,8 @@ +{ pkgs, config, ... }: +{ + services.nginx.virtualHosts."chat.${config.domains.jim1}" = { + enableACME = true; + addSSL = true; + root = "${pkgs.element-web}"; + }; +} diff --git a/modules/system/services/server/social/matrix/synapse/coturn/default.nix b/modules/system/services/server/social/matrix/synapse/coturn/default.nix new file mode 100644 index 00000000..01c19134 --- /dev/null +++ b/modules/system/services/server/social/matrix/synapse/coturn/default.nix @@ -0,0 +1,41 @@ +{ config, ... }: +{ + imports = [ + ./nginx + ]; + + services = { + coturn = { + enable = true; + no-cli = true; + no-tcp-relay = true; + min-port = 49000; + max-port = 50000; + use-auth-secret = true; + static-auth-secret = "will be world readable for local users :("; + realm = "turn.${config.domains.jim1}"; + cert = "/var/lib/acme/turn.${config.domains.jim1}.com/fullchain.pem"; + pkey = "/var/lib/acme/turn.${config.domains.jim1}.com/key.pem"; + }; + + # Enable coturn on Synapse + matrix-synapse.settings = { + turn_uris = [ + "turn:turn.${config.domains.jim1}:3478?transport=udp" + "turn:turn.${config.domains.jim1}:3478?transport=tcp" + ]; + turn_shared_secret = config.services.coturn.static-auth-secret; + turn_user_lifetime = "1h"; + }; + }; + + # Open coturn ports + networking.firewall = { + allowedUDPPorts = [ + 3478 5349 + ]; + allowedUDPPortRanges = [ + { from = 49000; to = 50000; } + ]; + }; +} diff --git a/modules/system/services/server/social/matrix/synapse/coturn/nginx/default.nix b/modules/system/services/server/social/matrix/synapse/coturn/nginx/default.nix new file mode 100644 index 00000000..ffb9884b --- /dev/null +++ b/modules/system/services/server/social/matrix/synapse/coturn/nginx/default.nix @@ -0,0 +1,20 @@ +{ config, ... }: +{ + services.nginx.virtualHosts."turn.${config.domains.jim1}" = { + enableACME = true; + forceSSL = true; + listen = [{ + addr = "0.0.0.0"; + port = 80; + ssl = false; + }]; + locations."/".proxyPass = "http://127.0.0.1:1380"; + }; + + security.acme.certs = { + "turn.${config.domains.jim1}" = { + group = "turnserver"; + postRun = "systemctl restart coturn.service"; + }; + }; +} diff --git a/modules/system/services/server/social/matrix/synapse/default.nix b/modules/system/services/server/social/matrix/synapse/default.nix new file mode 100644 index 00000000..d889c869 --- /dev/null +++ b/modules/system/services/server/social/matrix/synapse/default.nix @@ -0,0 +1,71 @@ +{ pkgs, config, ... }: +{ + imports = [ + ./coturn + ./slidingsync + ./nginx + ]; + + services.matrix-synapse = { + enable = true; + settings = { + server_name = "${config.domains.jim1}"; + public_baseurl = "https://matrix.${config.domains.jim1}"; + suppress_key_server_warning = true; + + listeners = [{ + port = 8008; + bind_addresses = [ "::" "0.0.0.0" ]; + resources = [ { compress = false; names = [ "client" "federation" ]; } ]; + type = "http"; + tls = false; + x_forwarded = true; + }]; + + email = { + notif_from = "Jimbo's Matrix "; + smtp_host = "mx.${config.domains.jim1}"; + smtp_user = "noreply@${config.domains.jim1}"; + smtp_pass = config.secrets.noreplyPassword; + enable_tls = true; + smtp_port = 587; + require_transport_security = true; + }; + + # Disable registration without email + registrations_require_3pid = [ "email" ]; + + # Allow only this range of emails + allowed_local_3pids = [ + { + medium = "email"; + pattern = ''^[^@]+@jimbosfiles\.com$''; + } + { + medium = "email"; + pattern = ''^[^@]+@nixfox\.ca$''; + } + { + medium = "email"; + pattern = ''^[^@]+@freecorn1854\.win$''; + } + { + medium = "email"; + pattern = ''^[^@]+@lunamoonlight\.xyz$''; + } + ]; + + # Set the type of database + database.name = "sqlite3"; + + # Allow account registration + enable_registration = true; + + # General settings + url_preview_enabled = true; + max_upload_size = "50M"; + report_stats = false; + burst_count = 15; + }; + }; +} diff --git a/modules/system/services/server/social/matrix/synapse/nginx/default.nix b/modules/system/services/server/social/matrix/synapse/nginx/default.nix new file mode 100644 index 00000000..74ebb8db --- /dev/null +++ b/modules/system/services/server/social/matrix/synapse/nginx/default.nix @@ -0,0 +1,14 @@ +{ config, ... }: +{ + services.nginx.virtualHosts."matrix.${config.domains.jim1}" = { + enableACME = true; + forceSSL = true; + locations = { + "/".extraConfig = ''return 403;''; + "/client".proxyPass = "http://127.0.0.1:8009"; + "/_matrix".proxyPass = "http://127.0.0.1:8008"; + "/_matrix/client/unstable/org.matrix.msc3575/sync".proxyPass = "http://127.0.0.1:8009"; + "/_synapse/client".proxyPass = "http://127.0.0.1:8008"; + }; + }; +} diff --git a/modules/system/services/server/social/matrix/synapse/slidingsync/default.nix b/modules/system/services/server/social/matrix/synapse/slidingsync/default.nix new file mode 100644 index 00000000..bad4f598 --- /dev/null +++ b/modules/system/services/server/social/matrix/synapse/slidingsync/default.nix @@ -0,0 +1,13 @@ +{ pkgs, config, ... }: +{ + services.matrix-sliding-sync = { + enable = true; + settings = { + SYNCV3_SERVER = "https://matrix.${config.domains.jim1}"; + SYNCV3_BINDADDR = "0.0.0.0:8009"; + }; + environmentFile = "${pkgs.writeText "matrixsecret" '' + SYNCV3_SECRET=${config.secrets.matrixSecret} + ''}"; + }; +} diff --git a/modules/system/services/server/social/owncast/default.nix b/modules/system/services/server/social/owncast/default.nix new file mode 100644 index 00000000..495e8333 --- /dev/null +++ b/modules/system/services/server/social/owncast/default.nix @@ -0,0 +1,13 @@ +{ ... }: +{ + imports = [ + ./nginx + ]; + + services.owncast = { + enable = true; + port = 8060; + rtmp-port = 1945; + listen = "0.0.0.0"; + }; +} diff --git a/modules/system/services/server/social/owncast/nginx/default.nix b/modules/system/services/server/social/owncast/nginx/default.nix new file mode 100644 index 00000000..01b6e59b --- /dev/null +++ b/modules/system/services/server/social/owncast/nginx/default.nix @@ -0,0 +1,11 @@ +{ config, ... }: +{ + services.nginx.virtualHosts."live.${config.domains.jim1}" = { + enableACME = true; + forceSSL = true; + locations."/" = { + proxyPass = "http://127.0.0.1:8060"; + proxyWebsockets = true; + }; + }; +} diff --git a/modules/system/services/server/social/pixelfed/default.nix b/modules/system/services/server/social/pixelfed/default.nix new file mode 100644 index 00000000..62fdfe69 --- /dev/null +++ b/modules/system/services/server/social/pixelfed/default.nix @@ -0,0 +1,32 @@ +{ pkgs, config, ... }: +{ + services.pixelfed = { + enable = true; + domain = "pics.${config.domains.jim1}"; + secretFile = pkgs.writeText "appkey" config.secrets.pixelfedKey; + settings = { + APP_NAME = ''"Jimbo's Pixelfed"''; + INSTANCE_DESCRIPTION = ''"The Jimbosfiles Pixelfed Instance"''; + INSTANCE_CONTACT_EMAIL = "jimbo@${config.domains.jim1}"; + OPEN_REGISTRATION = true; + APP_LOCALE = "en"; + INSTANCE_DISCOVER_PUBLIC = false; + STORIES_ENABLED = true; + + # Mail config + ENFORCE_EMAIL_VERIFICATION = true; + MAIL_FROM_ADDRESS = "noreply@${config.domains.jim1}"; + MAIL_FROM_NAME = ''"Jimbo's Pixelfed "''; + MAIL_ENCRYPTION = "tls"; + MAIL_DRIVER = "smtp"; + MAIL_HOST = "mx.${config.domains.jim1}"; + MAIL_PORT = 587; + MAIL_USERNAME = "noreply@${config.domains.jim1}"; + MAIL_PASSWORD = "${config.secrets.noreplyPassword}"; + }; + nginx = { + enableACME = true; + forceSSL = true; + }; + }; +} diff --git a/modules/system/services/server/transmission/default.nix b/modules/system/services/server/transmission/default.nix new file mode 100644 index 00000000..b8d7b052 --- /dev/null +++ b/modules/system/services/server/transmission/default.nix @@ -0,0 +1,15 @@ +{ pkgs, config, ... }: +{ + imports = [ + ./nginx + ]; + + services.transmission = { + enable = true; + credentialsFile = pkgs.writeText "credentials" config.secrets.transmissionCredFile; + openPeerPorts = true; + settings = { + rpc-authentication-required = true; + }; + }; +} diff --git a/modules/system/services/server/transmission/nginx/default.nix b/modules/system/services/server/transmission/nginx/default.nix new file mode 100644 index 00000000..a980c61c --- /dev/null +++ b/modules/system/services/server/transmission/nginx/default.nix @@ -0,0 +1,11 @@ +{ config, ... }: +{ + services.nginx.virtualHosts."torrent.${config.domains.jim1}" = { + enableACME = true; + forceSSL = true; + locations."/" = { + proxyPass = "http://127.0.0.1:9091"; + proxyWebsockets = true; + }; + }; +} diff --git a/modules/system/services/server/vaultwarden/default.nix b/modules/system/services/server/vaultwarden/default.nix new file mode 100644 index 00000000..af70c23e --- /dev/null +++ b/modules/system/services/server/vaultwarden/default.nix @@ -0,0 +1,27 @@ +{ config, ... }: +{ + imports = [ + ./nginx + ]; + + services.vaultwarden = { + enable = true; + config = { + DOMAIN = "https://warden.${config.domains.jim1}"; + SIGNUPS_ALLOWED = false; + ROCKET_ADDRESS = "127.0.0.1"; + ROCKET_PORT = 8222; + ROCKET_LOG = "critical"; + + # Smtp email + SMTP_HOST = "mx.${config.domains.jim1}"; + SMTP_FROM = "noreply@${config.domains.jim1}"; + SMTP_FROM_NAME = "Vaultwarden"; + SMTP_USERNAME = "noreply@${config.domains.jim1}"; + SMTP_PASSWORD = config.secrets.noreplyPassword; + SMTP_SECURITY = "starttls"; + SMTP_PORT = 587; + SMTP_TIMEOUT = 15; + }; + }; +} diff --git a/modules/system/services/server/vaultwarden/nginx/default.nix b/modules/system/services/server/vaultwarden/nginx/default.nix new file mode 100644 index 00000000..cec70c55 --- /dev/null +++ b/modules/system/services/server/vaultwarden/nginx/default.nix @@ -0,0 +1,11 @@ +{ config, ... }: +{ + services.nginx.virtualHosts."warden.${config.domains.jim1}" = { + enableACME = true; + forceSSL = true; + locations."/" = { + proxyPass = "http://127.0.0.1:8222"; + proxyWebsockets = true; + }; + }; +} diff --git a/modules/system/services/server/webhost/default.nix b/modules/system/services/server/webhost/default.nix new file mode 100644 index 00000000..a34929f9 --- /dev/null +++ b/modules/system/services/server/webhost/default.nix @@ -0,0 +1,8 @@ +{ ... }: +{ + imports = [ + ./nginx + ./rtmp + ./virtualhosts + ]; +} diff --git a/modules/system/services/server/webhost/nginx/default.nix b/modules/system/services/server/webhost/nginx/default.nix new file mode 100644 index 00000000..a84c14d8 --- /dev/null +++ b/modules/system/services/server/webhost/nginx/default.nix @@ -0,0 +1,14 @@ +{ pkgs, config, ... }: +{ + services.nginx = { + enable = true; + recommendedTlsSettings = true; + recommendedOptimisation = true; + recommendedGzipSettings = true; + recommendedProxySettings = true; + }; + + networking.firewall.allowedTCPPorts = [ + 80 443 + ]; +} diff --git a/modules/system/services/server/webhost/rtmp/default.nix b/modules/system/services/server/webhost/rtmp/default.nix new file mode 100644 index 00000000..547b327d --- /dev/null +++ b/modules/system/services/server/webhost/rtmp/default.nix @@ -0,0 +1,27 @@ +{ pkgs, config, ... }: +{ + services.nginx = { + package = (pkgs.nginx.override { + modules = with pkgs.nginxModules; [ rtmp ]; + }); + appendConfig = '' + rtmp { + server { + listen 1935; + chunk_size 4096; + allow publish all; + application stream { + record off; + live on; + allow play all; + hls on; + hls_path /var/www/Jimbo-Landing-Page/streams/hls/; + hls_fragment_naming system; + hls_fragment 3; + hls_playlist_length 40; + } + } + } + ''; + }; +} diff --git a/modules/system/services/server/webhost/virtualhosts/default.nix b/modules/system/services/server/webhost/virtualhosts/default.nix new file mode 100644 index 00000000..33e6bd37 --- /dev/null +++ b/modules/system/services/server/webhost/virtualhosts/default.nix @@ -0,0 +1,6 @@ +{ ... }: +{ + imports = [ + ./jimDomain + ]; +} diff --git a/modules/system/services/server/webhost/virtualhosts/jimDomain/default.nix b/modules/system/services/server/webhost/virtualhosts/jimDomain/default.nix new file mode 100644 index 00000000..be8e6e52 --- /dev/null +++ b/modules/system/services/server/webhost/virtualhosts/jimDomain/default.nix @@ -0,0 +1,39 @@ +{ pkgs, config, ... }: +{ + services.nginx.virtualHosts = { + "${config.domains.jim1}" = { + enableACME = true; + addSSL = true; + root = "/var/www/Jimbo-Landing-Page"; + locations = { + "/.well-known/matrix/client" = { + extraConfig = '' + default_type application/json; + return 200 ' + { + "m.homeserver": { + "base_url": "https://matrix.${config.domains.jim1}" + }, + "m.identity_server": { + "base_url": "https://matrix.org" + }, + "org.matrix.msc3575.proxy": { + "url": "https://matrix.${config.domains.jim1}" + } + }'; + ''; + }; + "/.well-known/matrix/server" = { + extraConfig = '' + default_type application/json; + return 200 '{"m.server": "matrix.${config.domains.jim1}:443"}'; + ''; + }; + }; + }; + }; + + systemd.services.nginx.serviceConfig = { + ReadWritePaths = [ "/var/www/Jimbo-Landing-Page/streams/hls/" ]; + }; +} diff --git a/overlays/default.nix b/overlays/default.nix new file mode 100644 index 00000000..69ca9f82 --- /dev/null +++ b/overlays/default.nix @@ -0,0 +1,8 @@ +{ pkgs, ... }: +{ + imports = [ + ./unstable + ./packages + ./mpv + ]; +} diff --git a/overlays/mpv/default.nix b/overlays/mpv/default.nix new file mode 100644 index 00000000..a98eb9c5 --- /dev/null +++ b/overlays/mpv/default.nix @@ -0,0 +1,14 @@ +{ unstable, ... }: +{ + nixpkgs.overlays = [ + (self: super: { + mpv = super.mpv.override { + scripts = with self.mpvScripts; [ + mpris + sponsorblock + thumbnail + ]; + }; + }) + ]; +} diff --git a/overlays/packages/default.nix b/overlays/packages/default.nix new file mode 100644 index 00000000..a9e3e727 --- /dev/null +++ b/overlays/packages/default.nix @@ -0,0 +1,9 @@ +{ pkgs, ... }: +{ + nixpkgs.overlays = [ + (final: _prev: { + xash3d = pkgs.callPackage ./xash3d {}; + hlsdk = pkgs.callPackage ./hlsdk {}; + }) + ]; +} diff --git a/extras/pkgs/xash/hlsdk.nix b/overlays/packages/hlsdk/default.nix similarity index 100% rename from extras/pkgs/xash/hlsdk.nix rename to overlays/packages/hlsdk/default.nix diff --git a/extras/pkgs/xash/change-zip-date.patch b/overlays/packages/xash3d/change-zip-date.patch similarity index 100% rename from extras/pkgs/xash/change-zip-date.patch rename to overlays/packages/xash3d/change-zip-date.patch diff --git a/extras/pkgs/xash/xash3d.nix b/overlays/packages/xash3d/default.nix similarity index 100% rename from extras/pkgs/xash/xash3d.nix rename to overlays/packages/xash3d/default.nix diff --git a/overlays/unstable/default.nix b/overlays/unstable/default.nix new file mode 100644 index 00000000..cdd4a8c2 --- /dev/null +++ b/overlays/unstable/default.nix @@ -0,0 +1,11 @@ +{ unstable, ... }: +{ + nixpkgs.overlays = [ + (final: prev: { + unstable = import unstable { + system = final.system; + config.allowUnfree = true; + }; + }) + ]; +} diff --git a/system/base.nix b/system/base.nix deleted file mode 100644 index 3e1ce6ee..00000000 --- a/system/base.nix +++ /dev/null @@ -1,68 +0,0 @@ -# This is your system's configuration file (it replaces /etc/nixos/configuration.nix) -{inputs, outputs, lib, config, pkgs, ...}: { - # You can import other NixOS modules here - imports = [ - ./modules/networking.nix - ./modules/gpg.nix - ]; - - nixpkgs = { - # You can add overlays here - overlays = [ - outputs.overlays.additions - outputs.overlays.selfsuper - outputs.overlays.finalprev - ]; - - # Allow unfree apps - config.allowUnfree = true; - }; - - # Enable flakes and garbage collection - nix = { - settings = { - experimental-features = "nix-command flakes"; - auto-optimise-store = true; - }; - gc = { - automatic = true; - dates = "weekly"; - options = "--delete-older-than 1w"; - }; - }; - - # Set timezone - time.timeZone = outputs.secrets.timeZone; - - # Select a terminal font - console = { - earlySetup = true; - font = "${pkgs.terminus_font}/share/consolefonts/ter-u22n.psf.gz"; - packages = with pkgs; [ terminus_font ]; - keyMap = "us"; - }; - - # Enable git - programs.git = { - enable = true; - lfs.enable = true; - }; - - # Basic firewall settings - networking.nftables.enable = true; - - # Enable the ZSH shell - programs.zsh.enable = true; - - # Disable Nano - programs.nano.enable = false; - - # Disable the HTML documentation link - documentation = { - nixos.enable = false; - info.enable = false; - }; - - # Allow binary firmware - hardware.enableRedistributableFirmware = true; -} diff --git a/system/desktop/firewall.nix b/system/desktop/firewall.nix deleted file mode 100644 index 0bb92183..00000000 --- a/system/desktop/firewall.nix +++ /dev/null @@ -1,12 +0,0 @@ -{outputs, ...}: { - # Networking settings - networking = { - # Enable firewall - firewall = { - allowPing = false; - extraInputRules = '' - ip saddr { ${outputs.ips.server}, ${outputs.ips.wgSpan}.1 } accept comment "Accept Server" - ''; - }; - }; -} diff --git a/system/desktop/misc.nix b/system/desktop/misc.nix deleted file mode 100644 index 34cc267b..00000000 --- a/system/desktop/misc.nix +++ /dev/null @@ -1,24 +0,0 @@ -{pkgs, ...}: { - # Enable AppImages - programs.appimage = { - enable = true; - binfmt = true; - }; - - # Network mounts, automounts, and battery saver - services = { - gvfs.enable = true; - udisks2.enable = true; - }; - - # Security that only makes sense with a GUI - security = { - polkit.enable = true; - rtkit.enable = true; - }; - - # Install programs system-wide - environment.systemPackages = with pkgs; [ - cifs-utils - ]; -} diff --git a/system/desktop/school.nix b/system/desktop/school.nix deleted file mode 100644 index 3a0993bf..00000000 --- a/system/desktop/school.nix +++ /dev/null @@ -1,13 +0,0 @@ -{pkgs, ...}: { - # Install programs system-wide - environment.systemPackages = with pkgs; [ - remmina - freerdp - python3 - zoom-us - globalprotect-openconnect - ]; - - # Enable Globalprotect VPN - services.globalprotect.enable = true; -} diff --git a/system/desktop/wayland.nix b/system/desktop/wayland.nix deleted file mode 100644 index 12798ad1..00000000 --- a/system/desktop/wayland.nix +++ /dev/null @@ -1,25 +0,0 @@ -{pkgs, ...}: { - programs = { - dconf.enable = true; - light.enable = true; - xwayland.enable = true; - }; - - # Battery saver and dbus - services = { - tlp.enable = true; - dbus.enable = true; - }; - - environment.systemPackages = with pkgs; [ - wl-clipboard - wdisplays - clipman - libnotify - grim - slurp - swappy - jq - lm_sensors - ]; -} diff --git a/system/desktop/wireguard.nix b/system/desktop/wireguard.nix deleted file mode 100644 index 9a08f57d..00000000 --- a/system/desktop/wireguard.nix +++ /dev/null @@ -1,21 +0,0 @@ -{outputs, ...}: { - networking.firewall = { - allowedUDPPorts = [ 51820 ]; - }; - - networking.wireguard.interfaces = { - "${outputs.ips.wgInt}" = { - # Define IP of client in per device config - listenPort = 51820; - privateKey = outputs.secrets.wgClientPriv; - peers = [ - { # 0.0.0.0 makes wg act like a traditional VPN - publicKey = outputs.secrets.wgServerPub; - allowedIPs = [ "0.0.0.0/0" ]; - endpoint = "sv.${outputs.secrets.jimDomain}:51820"; - persistentKeepalive = 25; - } - ]; - }; - }; -} diff --git a/system/hosts/JimDesktop/configuration.nix b/system/hosts/JimDesktop/configuration.nix deleted file mode 100644 index 1308fdca..00000000 --- a/system/hosts/JimDesktop/configuration.nix +++ /dev/null @@ -1,50 +0,0 @@ -{ - imports = [ - # Base configs - ./../../base.nix - - # Import users and groups - ./../../users/jimbo.nix - ./../../users/groups.nix - - # Desktop - ./../../desktop/misc.nix - ./../../desktop/sway.nix - ./../../desktop/greetd-sway.nix - ./../../desktop/printing.nix - ./../../desktop/gaming.nix - ./../../desktop/pipewire.nix - ./../../desktop/bluetooth.nix - ./../../desktop/firewall.nix - ./../../desktop/qt.nix - - # Modules - ./../../modules/security.nix - - # Hardware - ./hardware-configuration.nix - ./../../modules/lanzaboote.nix - ./../../modules/opengl.nix - ./../../modules/filesystems.nix - ./../../modules/nvidia.nix - #./../../modules/nouveau.nix - - # Services - ./../../services/openssh.nix - ./../../services/gnome-keyring.nix - ./../../services/qemukvm.nix - ./../../services/udev.nix - ./../../services/sunshine.nix - ./../../services/mpd.nix - #./../../services/waydroid.nix - ]; - - # Set hostname - networking.hostName = "JimDesktop"; - - # Force Electron to use Wayland - environment.sessionVariables.NIXOS_OZONE_WL = "1"; - - # https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion - system.stateVersion = "24.05"; -} diff --git a/system/hosts/JimLenovo/configuration.nix b/system/hosts/JimLenovo/configuration.nix deleted file mode 100644 index 4b975b43..00000000 --- a/system/hosts/JimLenovo/configuration.nix +++ /dev/null @@ -1,44 +0,0 @@ -{ - imports = [ - # Base configs - ./../../base.nix - - # Import users and groups - ./../../users/jimbo.nix - ./../../users/groups.nix - - # Desktop - ./../../desktop/misc.nix - ./../../desktop/sway.nix - ./../../desktop/greetd-sway.nix - ./../../desktop/printing.nix - ./../../desktop/gaming.nix - ./../../desktop/pipewire.nix - ./../../desktop/bluetooth.nix - ./../../desktop/firewall.nix - ./../../desktop/qt.nix - - # Laptop/Portable only - ./../../modules/wireless.nix - - # Modules - ./../../modules/security.nix - - # Hardware - ./hardware-configuration.nix - ./../../modules/systemdboot.nix - ./../../modules/opengl.nix - - # Services - ./../../services/openssh.nix - ./../../services/gnome-keyring.nix - ./../../services/udev.nix - ./../../services/mpd.nix - ]; - - # Set hostname - networking.hostName = "JimLenovo"; - - # https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion - system.stateVersion = "24.05"; -} diff --git a/system/hosts/JimPine/configuration.nix b/system/hosts/JimPine/configuration.nix deleted file mode 100644 index c7df43b4..00000000 --- a/system/hosts/JimPine/configuration.nix +++ /dev/null @@ -1,48 +0,0 @@ -{lib, outputs, ...}: { - imports = [ - # Base configs - ./../../base.nix - - # Import users and groups - ./../../users/jimbo.nix - ./../../users/groups.nix - - # Desktop - ./../../desktop/misc.nix - ./../../desktop/sway.nix - ./../../desktop/greetd-sway.nix - ./../../desktop/printing.nix - ./../../desktop/pipewire.nix - ./../../desktop/bluetooth.nix - ./../../desktop/firewall.nix - ./../../desktop/qt.nix - ./../../desktop/wireguard.nix - - # Modules - ./../../modules/security.nix - - # Hardware - ./hardware-configuration.nix - ./../../modules/extlinux.nix - ./../../modules/opengl.nix - ./../../modules/filesystems.nix - ./../../modules/wireless.nix - - # Services - ./../../services/openssh.nix - ./../../services/gnome-keyring.nix - ./../../services/mpd.nix - ]; - - # Set hostname - networking.hostName = "JimPine"; - - # Disable 32 bit graphics - hardware.opengl.driSupport32Bit = lib.mkForce false; - - # Set the VPN IP per machine - networking.wireguard.interfaces."${outputs.ips.wgInt}".ips = [ "${outputs.ips.wgSpan}.17/24" ]; - - # https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion - system.stateVersion = "24.05"; -} diff --git a/system/hosts/JimServer/configuration.nix b/system/hosts/JimServer/configuration.nix deleted file mode 100644 index 29a926ce..00000000 --- a/system/hosts/JimServer/configuration.nix +++ /dev/null @@ -1,63 +0,0 @@ -{ - imports = [ - # Base configs - ./../../base.nix - - # Import users and groups - ./../../users/jimbo.nix - ./../../users/nextcloud.nix - ./../../users/nginx.nix - ./../../users/liquidsoap.nix - ./../../users/groups.nix - - # Modules - ./../../modules/security.nix - - # Hardware - ./hardware-configuration.nix - ./../../modules/systemdboot.nix - - # Services - ./../../services/openssh.nix - ./../../server/acme.nix - ./../../server/ddclient.nix - ./../../server/icecast.nix - ./../../server/firewall.nix - ./../../server/forgejo.nix - ./../../server/mailserver.nix - ./../../server/mariadb.nix - ./../../server/nginx.nix - ./../../server/owncast.nix - ./../../server/photoprism.nix - ./../../server/minecraft - ./../../server/vaultwarden.nix - ./../../server/transmission.nix - ./../../server/wireguard.nix - ./../../server/misc.nix - - # File server - ./../../server/nextcloud.nix - ./../../server/nfs.nix - ./../../server/samba.nix - - # Matrix - ./../../server/synapse.nix - ./../../server/element.nix - ./../../server/coturn.nix - ./../../server/matrix-discord.nix - - # Federation - ./../../server/lemmy.nix - ./../../server/mastodon.nix - ./../../server/pixelfed.nix - ]; - - # Set custom openssh port - services.openssh.ports = [ 2222 ]; - - # Set hostname - networking.hostName = "JimServer"; - - # https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion - system.stateVersion = "24.05"; -} diff --git a/system/hosts/JimServer/hardware-configuration.nix b/system/hosts/JimServer/hardware-configuration.nix deleted file mode 100644 index 2c1f5442..00000000 --- a/system/hosts/JimServer/hardware-configuration.nix +++ /dev/null @@ -1,110 +0,0 @@ -{ config, outputs, lib, pkgs, modulesPath, ... }: - -{ - imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; - - # Set all boot options - boot = { - blacklistedKernelModules = [ - "pcspkr" - ]; - initrd = { - availableKernelModules = [ - "xhci_pci" - "ehci_pci" - "ahci" - "nvme" - "usbhid" - "sd_mod" - "sr_mod" - ]; - kernelModules = [ - "kvm-intel" - ]; - }; - swraid.mdadmConf = '' - MAILADDR jimbo@${outputs.secrets.jimDomain} - ''; - }; - - # Mounting options - fileSystems = { - "/" = { - device = "/dev/disk/by-uuid/8f81cab7-9381-4950-b77f-b85c5fdbad16"; - fsType = "ext4"; - }; - "/boot" = { - device = "/dev/disk/by-uuid/2034-754A"; - fsType = "vfat"; - }; - "/export/JimboNFS" = { - device = "/dev/disk/by-uuid/713fcd92-534c-4153-8e04-e0c6fe5f6a51"; - fsType = "ext4"; - noCheck = true; - }; - "/home/jimbo/JimboNFS" = { - device = "/export/JimboNFS"; - fsType = "none"; - options = [ "bind" ]; - }; - - # Atrocity of bindmounts - "/mnt/nextcloud/data/JimboNFS" = { - device = "/export/JimboNFS"; - fsType = "none"; - options = [ "bind" ]; - }; - "/var/lib/bitwarden_rs" = { - device = "/export/JimboNFS/System/var/lib/bitwarden_rs"; - fsType = "none"; - options = [ "bind" ]; - }; - "/var/lib/gitea" = { - device = "/export/JimboNFS/System/var/lib/gitea"; - fsType = "none"; - options = [ "bind" ]; - }; - "/var/lib/matrix-synapse" = { - device = "/export/JimboNFS/System/var/lib/matrix-synapse"; - fsType = "none"; - options = [ "bind" ]; - }; - "/var/lib/nextcloud" = { - device = "/export/JimboNFS/System/var/lib/nextcloud"; - fsType = "none"; - options = [ "bind" ]; - }; - "/var/lib/owncast" = { - device = "/export/JimboNFS/System/var/lib/owncast"; - fsType = "none"; - options = [ "bind" ]; - }; - "/var/lib/mastodon" = { - device = "/export/JimboNFS/System/var/lib/mastodon"; - fsType = "none"; - options = [ "bind" ]; - }; - "/srv/minecraft" = { - device = "/export/JimboNFS/System/srv/minecraft"; - fsType = "none"; - options = [ "bind" ]; - }; - "/var/lib/private/photoprism/originals" = { - device = "/export/JimboNFS/Photos/Galleries"; - fsType = "none"; - options = [ "bind" ]; - }; - }; - - swapDevices = [ - { device = "/dev/disk/by-uuid/ec422cad-bf93-4b15-b989-2c807f1073a4"; } - ]; - - # Enables DHCP on each ethernet and wireless interface. - networking.useDHCP = lib.mkDefault true; - - # Hardware settings - boot.swraid.enable = true; - hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; - nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; -} diff --git a/system/modules/lanzaboote.nix b/system/modules/lanzaboote.nix deleted file mode 100644 index 26dcb018..00000000 --- a/system/modules/lanzaboote.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ - boot.lanzaboote = { - enable = true; - pkiBundle = "/etc/secureboot"; - }; -} diff --git a/system/modules/nouveau.nix b/system/modules/nouveau.nix deleted file mode 100644 index bfd95046..00000000 --- a/system/modules/nouveau.nix +++ /dev/null @@ -1,4 +0,0 @@ -{pkgs, ...}: { - # Enable video drivers - services.xserver.videoDrivers = ["nouveau"]; -} diff --git a/system/modules/nvidia.nix b/system/modules/nvidia.nix deleted file mode 100644 index 7d06fae6..00000000 --- a/system/modules/nvidia.nix +++ /dev/null @@ -1,10 +0,0 @@ -{pkgs, config, ...}: { - # Enable video drivers - services.xserver.videoDrivers = ["nvidia"]; - hardware.nvidia = { - modesetting.enable = true; - nvidiaSettings = false; - package = config.boot.kernelPackages.nvidiaPackages.beta; - open = false; - }; -} diff --git a/system/modules/wireless.nix b/system/modules/wireless.nix deleted file mode 100644 index 25f1c77a..00000000 --- a/system/modules/wireless.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ - # Enable wireless networkmanager - networking = { - networkmanager.enable = true; - enableB43Firmware = true; - }; -} diff --git a/system/server/acme.nix b/system/server/acme.nix deleted file mode 100644 index 1f978c7f..00000000 --- a/system/server/acme.nix +++ /dev/null @@ -1,12 +0,0 @@ -{outputs, ...}: { - security.acme = { - acceptTerms = true; - defaults.email = outputs.secrets.jimEmail; - certs = { - "turn.${outputs.secrets.jimDomain}" = { - group = "turnserver"; - postRun = "systemctl restart coturn.service"; - }; - }; - }; -} diff --git a/system/server/archived/adguard.nix b/system/server/archived/adguard.nix deleted file mode 100644 index 7712a89a..00000000 --- a/system/server/archived/adguard.nix +++ /dev/null @@ -1,14 +0,0 @@ -{ - services = { - adguardhome.enable = true; - nginx.virtualHosts."guard.${outputs.secrets.jimDomain}" = { - enableACME = true; - forceSSL = true; - locations."/" = { - proxyPass = "http://127.0.0.1:3000"; - proxyWebsockets = true; - }; - }; - }; - networking.firewall.allowedUDPPorts = [ 53 ]; -} diff --git a/system/server/archived/gitea.nix b/system/server/archived/gitea.nix deleted file mode 100644 index b8f77b10..00000000 --- a/system/server/archived/gitea.nix +++ /dev/null @@ -1,36 +0,0 @@ -{outputs, ...}: { - services = { - gitea = { - enable = true; - settings = { - server = { - DOMAIN = "gitea.${outputs.secrets.jimDomain}"; - ROOT_URL = "https://gitea.${outputs.secrets.jimDomain}:443"; - HTTP_PORT = 3115; - SSH_PORT = 2295; - START_SSH_SERVER = true; - }; - mailer = { - ENABLED = true; - SMTP_ADDR = "mx.${outputs.secrets.jimDomain}"; - FROM = "Jimbo's Git "; - USER = "noreply@${outputs.secrets.jimDomain}"; - PASSWD = outputs.secrets.noreplyPassword; - PROTOCOL = "smtps"; - }; - service.REGISTER_EMAIL_CONFIRM = true; - }; - }; - nginx.virtualHosts."gitea.${outputs.secrets.jimDomain}" = { - enableACME = true; - forceSSL = true; - locations."/" = { - proxyPass = "http://127.0.0.1:3115"; - proxyWebsockets = true; - }; - }; - }; - - # Allow Gitea SSH to work - networking.firewall.allowedTCPPorts = [ 2295 ]; -} diff --git a/system/server/archived/pufferpanel.nix b/system/server/archived/pufferpanel.nix deleted file mode 100644 index b9ff0df5..00000000 --- a/system/server/archived/pufferpanel.nix +++ /dev/null @@ -1,31 +0,0 @@ -{pkgs, outputs, lib, ...}: { - services = { - pufferpanel = { - enable = true; - environment = { - PUFFER_WEB_HOST = ":5010"; - PUFFER_PANEL_SETTINGS_MASTERURL = "https://panel.${outputs.secrets.jimDomain}"; - PUFFER_PANEL_EMAIL_PROVIDER = "smtp"; - PUFFER_PANEL_EMAIL_HOST = "mx.${outputs.secrets.jimDomain}:587"; - PUFFER_PANEL_EMAIL_FROM = "noreply@${outputs.secrets.jimDomain}"; - PUFFER_PANEL_EMAIL_USERNAME = "noreply@${outputs.secrets.jimDomain}"; - PUFFER_PANEL_EMAIL_PASSWORD = outputs.secrets.noreplyPassword; - }; - extraPackages = with pkgs; [ bash curl gawk gnutar gzip ]; - package = pkgs.buildFHSEnv { - name = "pufferpanel-fhs"; - meta.mainProgram = "pufferpanel-fhs"; - runScript = lib.getExe pkgs.pufferpanel; - targetPkgs = pkgs': with pkgs'; [ icu openssl zlib ]; - }; - }; - nginx.virtualHosts."panel.${outputs.secrets.jimDomain}" = { - enableACME = true; - forceSSL = true; - locations."/" = { - proxyPass = "http://127.0.0.1:5010"; - proxyWebsockets = true; - }; - }; - }; -} diff --git a/system/server/coturn.nix b/system/server/coturn.nix deleted file mode 100644 index 4c778677..00000000 --- a/system/server/coturn.nix +++ /dev/null @@ -1,48 +0,0 @@ -{outputs, config, ...}: { - services = { - coturn = rec { - enable = true; - no-cli = true; - no-tcp-relay = true; - min-port = 49000; - max-port = 50000; - use-auth-secret = true; - static-auth-secret = "will be world readable for local users :("; - realm = "turn.${outputs.secrets.jimDomain}"; - cert = "/var/lib/acme/turn.${outputs.secrets.jimDomain}.com/fullchain.pem"; - pkey = "/var/lib/acme/turn.${outputs.secrets.jimDomain}.com/key.pem"; - }; - - # Enable coturn on Synapse - matrix-synapse.settings = { - turn_uris = [ - "turn:turn.${outputs.secrets.jimDomain}:3478?transport=udp" - "turn:turn.${outputs.secrets.jimDomain}:3478?transport=tcp" - ]; - turn_shared_secret = config.services.coturn.static-auth-secret; - turn_user_lifetime = "1h"; - }; - - # Proxy main coturn port - nginx.virtualHosts."turn.${outputs.secrets.jimDomain}" = { - enableACME = true; - forceSSL = true; - listen = [{ - addr = "0.0.0.0"; - port = 80; - ssl = false; - }]; - locations."/".proxyPass = "http://127.0.0.1:1380"; - }; - }; - - # Open coturn ports - networking.firewall = { - allowedUDPPorts = [ - 3478 5349 - ]; - allowedUDPPortRanges = [ - { from = 49000; to = 50000; } - ]; - }; -} diff --git a/system/server/ddclient.nix b/system/server/ddclient.nix deleted file mode 100644 index 35a08c65..00000000 --- a/system/server/ddclient.nix +++ /dev/null @@ -1,23 +0,0 @@ -{pkgs, outputs, ...}: { - # Dynamic IPs for Cloudflare records - services.ddclient = { - enable = true; - protocol = "cloudflare"; - use = "web, web=https://ipinfo.io/ip"; - zone = "${outputs.secrets.jimDomain}"; - username = "token"; - passwordFile = "${pkgs.writeText "cloudflareapikey" outputs.secrets.flareApiKey}"; - domains = [ - "${outputs.secrets.jimDomain}" - "*.${outputs.secrets.jimDomain}" - "sv.${outputs.secrets.jimDomain}" - "git.${outputs.secrets.jimDomain}" - "rtmp.${outputs.secrets.jimDomain}" - "turn.${outputs.secrets.jimDomain}" - "dew.${outputs.secrets.jimDomain}" - "john.${outputs.secrets.jimDomain}" - "beta.${outputs.secrets.jimDomain}" - "rogue.${outputs.secrets.jimDomain}" - ]; - }; -} diff --git a/system/server/element.nix b/system/server/element.nix deleted file mode 100644 index 3543b836..00000000 --- a/system/server/element.nix +++ /dev/null @@ -1,28 +0,0 @@ -{pkgs, outputs, ...}: { - # Configure the Element web server - nixpkgs.config.element-web.conf = { - default_server_config = { - "m.homeserver" = { - base_url = "https://matrix.${outputs.secrets.jimDomain}"; - server_name = "matrix.${outputs.secrets.jimDomain}"; - }; - }; - branding = { - #welcome_background_url = "https://staging.${outputs.secrets.jimDomain}/images/backgrounds/bloxelcom-sunset.jpg"; - #auth_header_logo_url = "https://staging.${outputs.secrets.jimDomain}/images/logos/bloxelcom.png"; - }; - embedded_pages = { - home_url = "https://www.${outputs.secrets.jimDomain}/"; - }; - disable_custom_urls = true; - disable_guests = true; - default_theme = "dark"; - }; - - # Serve the Element page over Nginx - services.nginx.virtualHosts."chat.${outputs.secrets.jimDomain}" = { - enableACME = true; - addSSL = true; - root = "${pkgs.element-web}"; - }; -} diff --git a/system/server/firewall.nix b/system/server/firewall.nix deleted file mode 100644 index 9ddf789f..00000000 --- a/system/server/firewall.nix +++ /dev/null @@ -1,56 +0,0 @@ -{outputs, ...}: { - # Allow forwarding - boot.kernel.sysctl."net.ipv4.ip_forward" = 1; - - # Configure firewall - networking = let - mailPorts = "{ 25, 143, 465, 587, 993, 4190 }"; - in { - firewall = { - allowPing = false; - - # Add extra input rules using nftables - extraInputRules = '' - ip saddr { ${outputs.ips.localSpan}.0/24, ${outputs.ips.wgSpan}.0/24 } tcp dport 2049 accept comment "Accept NFS" - ip saddr { ${outputs.ips.pc}, ${outputs.secrets.lunaIP}, ${outputs.secrets.cornIP} } tcp dport { 1935, 1945 } accept comment "Accept RTMP" - ip saddr ${outputs.ips.wgSpan}.3 tcp dport ${mailPorts} accept comment "Accept mail" - ''; - }; - - # Enable nftables and forwarding - nftables = { - tables = { - forwarding = { - family = "ip"; - content = '' - chain PREROUTING { - type nat hook prerouting priority dstnat; policy accept; - tcp dport 2211 dnat to ${outputs.ips.pc}:22 comment "SSH to PC" - tcp dport 2233 dnat to ${outputs.ips.wgSpan}.3:22 comment "SSH to Oracle VM" - tcp dport 2255 dnat to ${outputs.ips.vm}:22 comment "SSH to VM" - - udp dport { 27005, 27015, 7777 } dnat to ${outputs.ips.pc} comment "PC Hosted Games" - - tcp dport { 58010, 57989, 57984 } dnat to ${outputs.ips.pc} comment "PC Sunshine TCP" - udp dport { 57998, 57999, 58000 } dnat to ${outputs.ips.pc} comment "PC Sunshine UDP" - - tcp dport { 38010, 37989, 37984 } dnat to ${outputs.ips.vm} comment "VM Sunshine TCP" - udp dport { 37998, 37999, 38000 } dnat to ${outputs.ips.vm} comment "VM Sunshine UDP" - - udp dport { 7790, 7791, 7792 } dnat to ${outputs.ips.hx} comment "Deus Ex" - - ip saddr ${outputs.secrets.cornIP} tcp dport { 9943, 9944 } dnat to ${outputs.ips.vm} comment "VM ALVR TCP" - ip saddr ${outputs.secrets.cornIP} udp dport { 9943, 9944 } dnat to ${outputs.ips.vm} comment "VM ALVR UDP" - } - chain POSTROUTING { - type nat hook postrouting priority 100; policy accept; - oifname "${outputs.ips.netInt}" masquerade - iifname "${outputs.ips.netInt}" oifname "${outputs.ips.wgInt}" masquerade comment "Traffic from public to WireGuard" - tcp dport ${mailPorts} oifname != "${outputs.ips.wgInt}" drop comment "Send mail" - } - ''; - }; - }; - }; - }; -} diff --git a/system/server/forgejo.nix b/system/server/forgejo.nix deleted file mode 100644 index 3afb1b79..00000000 --- a/system/server/forgejo.nix +++ /dev/null @@ -1,43 +0,0 @@ -# This is a hard fork of Gitea. -{outputs, ...}: { - services = { - forgejo = { - enable = true; - settings = { - server = { - DOMAIN = "git.${outputs.secrets.jimDomain}"; - ROOT_URL = "https://git.${outputs.secrets.jimDomain}:443"; - HTTP_PORT = 3110; - SSH_PORT = 2299; - START_SSH_SERVER = true; - }; - ui = { - DEFAULT_THEME = "forgejo-dark"; - }; - mailer = { - ENABLED = true; - SMTP_ADDR = "mx.${outputs.secrets.jimDomain}"; - FROM = "Jimbo's Git "; - USER = "noreply@${outputs.secrets.jimDomain}"; - PASSWD = outputs.secrets.noreplyPassword; - PROTOCOL = "smtps"; - }; - service = { - REGISTER_EMAIL_CONFIRM = true; - DISABLE_REGISTRATION = true; - }; - }; - }; - nginx.virtualHosts."git.${outputs.secrets.jimDomain}" = { - enableACME = true; - forceSSL = true; - locations."/" = { - proxyPass = "http://127.0.0.1:3110"; - proxyWebsockets = true; - }; - }; - }; - - # Allow Forgejo's SSH to work - networking.firewall.allowedTCPPorts = [ 2299 ]; -} diff --git a/system/server/lemmy.nix b/system/server/lemmy.nix deleted file mode 100644 index 09a28291..00000000 --- a/system/server/lemmy.nix +++ /dev/null @@ -1,25 +0,0 @@ -{outputs, ...}: { - services = { - lemmy = { - enable = true; - nginx.enable = true; - database.createLocally = true; - settings = { - hostname = "lemmy.${outputs.secrets.jimDomain}"; - email = { - smtp_server = "mx.${outputs.secrets.jimDomain}:587"; - smtp_login = "noreply@${outputs.secrets.jimDomain}"; - smtp_from_address = "Jimbo's Lemmy "; - smtp_password = outputs.secrets.noreplyPassword; - tls_type = "starttls"; - }; - }; - }; - - # Add SSL to webpage - nginx.virtualHosts."lemmy.${outputs.secrets.jimDomain}" = { - enableACME = true; - forceSSL = true; - }; - }; -} diff --git a/system/server/mailserver.nix b/system/server/mailserver.nix deleted file mode 100644 index d6ca3ba8..00000000 --- a/system/server/mailserver.nix +++ /dev/null @@ -1,68 +0,0 @@ -{pkgs, outputs, ...}: rec { - # Mail server - mailserver = rec { - enable = true; - openFirewall = false; - domains = [ "${outputs.secrets.jimDomain}" ]; - fqdn = "mx.${outputs.secrets.jimDomain}"; - certificateScheme = "acme-nginx"; - localDnsResolver = false; - redis.port = 1515; - - # Dmarc info - dmarcReporting = { - enable = true; - domain = "${outputs.secrets.jimDomain}"; - localpart = "noreply"; - organizationName = "Jimbo's Files"; - }; - - # A list of accounts, passwords generated with nix-shell -p mkpasswd --run 'mkpasswd -sm bcrypt' - loginAccounts = { - "noreply@${outputs.secrets.jimDomain}" = { - hashedPasswordFile = pkgs.writeText "noreply" outputs.secrets.noreplyMailHash; - sendOnly = true; - }; - "jimbo@${outputs.secrets.jimDomain}" = { - hashedPasswordFile = pkgs.writeText "jimbo" outputs.secrets.jimboMailHash; - aliases = [ "james@${outputs.secrets.jimDomain}" "contact@${outputs.secrets.jimDomain}" ]; - }; - "lunamoonlight@${outputs.secrets.jimDomain}" = { - hashedPasswordFile = pkgs.writeText "luna" outputs.secrets.lunaMailHash; - }; - "freecorn1854@${outputs.secrets.jimDomain}" = { - hashedPasswordFile = pkgs.writeText "freecorn" outputs.secrets.freecornMailHash; - }; - "tinyattack09@${outputs.secrets.jimDomain}" = { - hashedPasswordFile = pkgs.writeText "tiny" outputs.secrets.tinyMailHash; - }; - }; - }; - - # Related services - services = { - # Roundcube mail server - roundcube = { - enable = true; - hostName = "mail.${outputs.secrets.jimDomain}"; - extraConfig = '' - $config['smtp_server'] = "tls://${mailserver.fqdn}"; - $config['smtp_user'] = "%u"; - $config['smtp_pass'] = "%p"; - ''; - }; - - # Force the mailserver to use a different redis port - redis.servers.rspamd.port = 1515; - - # The hostname mail ports use - nginx.virtualHosts."mx.${outputs.secrets.jimDomain}" = { - enableACME = true; - forceSSL = true; - locations."/" = { - proxyPass = "http://127.0.0.1:1390"; - proxyWebsockets = true; - }; - }; - }; -} diff --git a/system/server/mastodon.nix b/system/server/mastodon.nix deleted file mode 100644 index 77f0ff3d..00000000 --- a/system/server/mastodon.nix +++ /dev/null @@ -1,17 +0,0 @@ -{pkgs, outputs, ...}: { - services.mastodon = { - enable = true; - localDomain = "social.${outputs.secrets.jimDomain}"; - streamingProcesses = 4; - configureNginx = true; - smtp = { - createLocally = false; - host = "mx.${outputs.secrets.jimDomain}"; - port = 587; - authenticate = true; - fromAddress = "Jimbo's Mastodon "; - user = "noreply@${outputs.secrets.jimDomain}"; - passwordFile = pkgs.writeText "smtp_pass.txt" outputs.secrets.noreplyPassword; - }; - }; -} diff --git a/system/server/matrix-discord.nix b/system/server/matrix-discord.nix deleted file mode 100644 index d201dbb4..00000000 --- a/system/server/matrix-discord.nix +++ /dev/null @@ -1,16 +0,0 @@ -{outputs, ...}: { - services.matrix-appservice-discord = { - enable = true; - settings = { - auth = { - clientID = "${outputs.secrets.discordBotID}"; - botToken = "${outputs.secrets.discordBotToken}"; - usePrivilegedIntents = true; - }; - bridge = { - domain = "${outputs.secrets.jimDomain}"; - homeserverUrl = "https://matrix.${outputs.secrets.jimDomain}"; - }; - }; - }; -} diff --git a/system/server/minecraft/default.nix b/system/server/minecraft/default.nix deleted file mode 100644 index f2f4787e..00000000 --- a/system/server/minecraft/default.nix +++ /dev/null @@ -1,17 +0,0 @@ -{inputs, ...}: { - imports = [ - inputs.minecraft.nixosModules.minecraft-servers - ./servers/velocity.nix - ./servers/dewdemolisher.nix - ./servers/johnside.nix - ./servers/roguecraft.nix - #./servers/blockworld.nix - #./servers/uberbeta.nix - ]; - nixpkgs.overlays = [ inputs.minecraft.overlay ]; - - services.minecraft-servers = { - enable = true; - eula = true; - }; -} diff --git a/system/server/misc.nix b/system/server/misc.nix deleted file mode 100644 index 3fea159e..00000000 --- a/system/server/misc.nix +++ /dev/null @@ -1,10 +0,0 @@ -{pkgs, ...}: { - # Install programs system-wide - environment.systemPackages = with pkgs; [ - mdadm - ]; - services = { - snowflake-proxy.enable = true; - logrotate.checkConfig = false; - }; -} diff --git a/system/server/nfs.nix b/system/server/nfs.nix deleted file mode 100644 index fc15404f..00000000 --- a/system/server/nfs.nix +++ /dev/null @@ -1,8 +0,0 @@ -{ - services.nfs.server = { - enable = true; - exports = '' - /export/JimboNFS *(rw,no_subtree_check) - ''; - }; -} diff --git a/system/server/nginx.nix b/system/server/nginx.nix deleted file mode 100644 index 4d2b2187..00000000 --- a/system/server/nginx.nix +++ /dev/null @@ -1,74 +0,0 @@ -{pkgs, outputs, ...}: { - services.nginx = { - enable = true; - package = (pkgs.nginx.override { - modules = with pkgs.nginxModules; [ rtmp ]; - }); - recommendedTlsSettings = true; - recommendedOptimisation = true; - recommendedGzipSettings = true; - recommendedProxySettings = true; - virtualHosts = { - # Landing page - "${outputs.secrets.jimDomain}" = { - enableACME = true; - addSSL = true; - root = "/var/www/Jimbo-Landing-Page"; - locations = { - "/.well-known/matrix/client" = { - extraConfig = '' - default_type application/json; - return 200 ' - { - "m.homeserver": { - "base_url": "https://matrix.${outputs.secrets.jimDomain}" - }, - "m.identity_server": { - "base_url": "https://matrix.org" - }, - "org.matrix.msc3575.proxy": { - "url": "https://matrix.${outputs.secrets.jimDomain}" - } - }'; - ''; - }; - "/.well-known/matrix/server" = { - extraConfig = '' - default_type application/json; - return 200 '{"m.server": "matrix.${outputs.secrets.jimDomain}:443"}'; - ''; - }; - }; - }; - }; - appendConfig = '' - rtmp { - server { - listen 1935; - chunk_size 4096; - allow publish all; - application stream { - record off; - live on; - allow play all; - hls on; - hls_path /var/www/Jimbo-Landing-Page/streams/hls/; - hls_fragment_naming system; - hls_fragment 3; - hls_playlist_length 40; - } - } - } - ''; - }; - - # Allow Nginx to read and write to paths - systemd.services.nginx.serviceConfig = { - ReadWritePaths = [ "/var/www/Jimbo-Landing-Page/streams/hls/" ]; - }; - - # Open HTTP and HTTPs ports - networking.firewall.allowedTCPPorts = [ - 80 443 - ]; -} diff --git a/system/server/owncast.nix b/system/server/owncast.nix deleted file mode 100644 index 332917c7..00000000 --- a/system/server/owncast.nix +++ /dev/null @@ -1,18 +0,0 @@ -{outputs, ...}: { - services = { - owncast = { - enable = true; - port = 8060; - rtmp-port = 1945; - listen = "0.0.0.0"; - }; - nginx.virtualHosts."live.${outputs.secrets.jimDomain}" = { - enableACME = true; - forceSSL = true; - locations."/" = { - proxyPass = "http://127.0.0.1:8060"; - proxyWebsockets = true; - }; - }; - }; -} diff --git a/system/server/pixelfed.nix b/system/server/pixelfed.nix deleted file mode 100644 index bc5b62b1..00000000 --- a/system/server/pixelfed.nix +++ /dev/null @@ -1,31 +0,0 @@ -{pkgs, outputs, ...}: { - services.pixelfed = { - enable = true; - domain = "pics.${outputs.secrets.jimDomain}"; - secretFile = pkgs.writeText "appkey" outputs.secrets.pixelfedKey; - settings = { - APP_NAME = ''"Jimbo's Pixelfed"''; - INSTANCE_DESCRIPTION = ''"The Jimbosfiles Pixelfed Instance"''; - INSTANCE_CONTACT_EMAIL = "jimbo@${outputs.secrets.jimDomain}"; - OPEN_REGISTRATION = true; - APP_LOCALE = "en"; - INSTANCE_DISCOVER_PUBLIC = false; - STORIES_ENABLED = true; - - # Mail config - ENFORCE_EMAIL_VERIFICATION = true; - MAIL_FROM_ADDRESS = "noreply@${outputs.secrets.jimDomain}"; - MAIL_FROM_NAME = ''"Jimbo's Pixelfed "''; - MAIL_ENCRYPTION = "tls"; - MAIL_DRIVER = "smtp"; - MAIL_HOST = "mx.${outputs.secrets.jimDomain}"; - MAIL_PORT = 587; - MAIL_USERNAME = "noreply@${outputs.secrets.jimDomain}"; - MAIL_PASSWORD = "${outputs.secrets.noreplyPassword}"; - }; - nginx = { - enableACME = true; - forceSSL = true; - }; - }; -} diff --git a/system/server/synapse.nix b/system/server/synapse.nix deleted file mode 100644 index 303d8a87..00000000 --- a/system/server/synapse.nix +++ /dev/null @@ -1,91 +0,0 @@ -{pkgs, outputs, ...}: { - services = { - # Synapse Matrix server - matrix-synapse = { - enable = true; - settings = { - server_name = "${outputs.secrets.jimDomain}"; - public_baseurl = "https://matrix.${outputs.secrets.jimDomain}"; - suppress_key_server_warning = true; - - # Set the network config - listeners = [{ - port = 8008; - bind_addresses = [ "::" "0.0.0.0" ]; - resources = [ { compress = false; names = [ "client" "federation" ]; } ]; - type = "http"; - tls = false; - x_forwarded = true; - }]; - - # Enable smtp for password resets - email = { - notif_from = "Jimbo's Matrix "; - smtp_host = "mx.${outputs.secrets.jimDomain}"; - smtp_user = "noreply@${outputs.secrets.jimDomain}"; - smtp_pass = outputs.secrets.noreplyPassword; - enable_tls = true; - smtp_port = 587; - require_transport_security = true; - }; - - # Allows a Discord/Matrix bridge, comment on first use and copy using instructions - app_service_config_files = [ - # cp /var/lib/matrix-appservice-discord/discord-registration.yaml /var/lib/matrix-synapse/ - # chown matrix-synapse:matrix-synapse /var/lib/matrix-synapse/discord-registration.yaml - "/var/lib/matrix-synapse/discord-registration.yaml" - ]; - - # Disable registration without email - registrations_require_3pid = [ "email" ]; - - # Allow only this range of emails - allowed_local_3pids = [{ - medium = "email"; - pattern = "^[^@]+@jimbosfiles\\.com$"; - }]; - - # Set the type of database - database.name = "sqlite3"; - - # Allow account registration - enable_registration = true; - - # General settings - url_preview_enabled = true; - max_upload_size = "50M"; - report_stats = false; - - # Ratelimiting - burst_count = 15; - }; - }; - - # Sliding sync proxy for Matrix - matrix-sliding-sync = let - matrixSecretFile = pkgs.writeText "matrixsecret" '' - SYNCV3_SECRET=${outputs.secrets.matrixSecret} - ''; - in { - enable = true; - settings = { - SYNCV3_SERVER = "https://matrix.${outputs.secrets.jimDomain}"; - SYNCV3_BINDADDR = "0.0.0.0:8009"; - }; - environmentFile = "${matrixSecretFile}"; - }; - - # Proxy for both Synapse and Sliding Sync - nginx.virtualHosts."matrix.${outputs.secrets.jimDomain}" = { - enableACME = true; - forceSSL = true; - locations = { - "/".extraConfig = ''return 403;''; - "/client".proxyPass = "http://127.0.0.1:8009"; - "/_matrix".proxyPass = "http://127.0.0.1:8008"; - "/_matrix/client/unstable/org.matrix.msc3575/sync".proxyPass = "http://127.0.0.1:8009"; - "/_synapse/client".proxyPass = "http://127.0.0.1:8008"; - }; - }; - }; -} diff --git a/system/server/transmission.nix b/system/server/transmission.nix deleted file mode 100644 index 7b149f9c..00000000 --- a/system/server/transmission.nix +++ /dev/null @@ -1,20 +0,0 @@ -{pkgs, outputs, ...}: { - services = { - transmission = { - enable = true; - credentialsFile = pkgs.writeText "credentials" outputs.secrets.transmissionCredFile; - openPeerPorts = true; - settings = { - rpc-authentication-required = true; - }; - }; - nginx.virtualHosts."torrent.${outputs.secrets.jimDomain}" = { - enableACME = true; - forceSSL = true; - locations."/" = { - proxyPass = "http://127.0.0.1:9091"; - proxyWebsockets = true; - }; - }; - }; -} diff --git a/system/server/vaultwarden.nix b/system/server/vaultwarden.nix deleted file mode 100644 index fd1b8591..00000000 --- a/system/server/vaultwarden.nix +++ /dev/null @@ -1,32 +0,0 @@ -{outputs, ...}: { - services = { - vaultwarden = { - enable = true; - config = { - DOMAIN = "https://warden.${outputs.secrets.jimDomain}"; - SIGNUPS_ALLOWED = false; - ROCKET_ADDRESS = "127.0.0.1"; - ROCKET_PORT = 8222; - ROCKET_LOG = "critical"; - - # Smtp email - SMTP_HOST = "mx.${outputs.secrets.jimDomain}"; - SMTP_FROM = "Jimbo's Vaultwarden "; - SMTP_FROM_NAME = "Vaultwarden"; - SMTP_USERNAME = "noreply@${outputs.secrets.jimDomain}"; - SMTP_PASSWORD = outputs.secrets.noreplyPassword; - SMTP_SECURITY = "starttls"; - SMTP_PORT = 587; - SMTP_TIMEOUT = 15; - }; - }; - nginx.virtualHosts."warden.${outputs.secrets.jimDomain}" = { - enableACME = true; - forceSSL = true; - locations."/" = { - proxyPass = "http://127.0.0.1:8222"; - proxyWebsockets = true; - }; - }; - }; -} diff --git a/system/server/wireguard.nix b/system/server/wireguard.nix deleted file mode 100644 index f7ebfd58..00000000 --- a/system/server/wireguard.nix +++ /dev/null @@ -1,36 +0,0 @@ -{outputs, ...}: { - # Enable NAT - networking = { - nat = { - enable = true; - externalInterface = "${outputs.ips.netInt}"; - internalInterfaces = [ "${outputs.ips.wgInt}" ]; - }; - firewall.allowedUDPPorts = [ 51820 ]; - }; - - networking.wireguard = { - enable = true; - interfaces = { - "${outputs.ips.wgInt}" = { - ips = [ "${outputs.ips.wgSpan}.1/24" ]; - listenPort = 51820; - privateKey = outputs.secrets.wgServerPriv; - peers = [ - { # Jimbo Pixel 9 - publicKey = outputs.secrets.wgPixel9Pub; - allowedIPs = [ "${outputs.ips.wgSpan}.2/32" ]; - } - { # Oracle VM - publicKey = outputs.secrets.wgOraclePub; - allowedIPs = [ "${outputs.ips.wgSpan}.3/32" ]; - } - { # General Nix - publicKey = outputs.secrets.wgClientPub; - allowedIPs = [ "${outputs.ips.wgSpan}.16/28" ]; - } - ]; - }; - }; - }; -} diff --git a/system/services/openssh.nix b/system/services/openssh.nix deleted file mode 100644 index 63699acb..00000000 --- a/system/services/openssh.nix +++ /dev/null @@ -1,22 +0,0 @@ -{ - # Enable SSH - services = { - openssh = { - enable = true; - settings = { - PermitRootLogin = "no"; - PrintLastLog = "no"; - PasswordAuthentication = false; - UsePAM = false; - }; - }; - - # Block nefarious SSH connections - fail2ban = { - enable = true; - maxretry = 5; - bantime = "5m"; - ignoreIP = [ "10.0.0.0/24" ]; - }; - }; -} diff --git a/system/services/udev.nix b/system/services/udev.nix deleted file mode 100644 index 2fef6c2d..00000000 --- a/system/services/udev.nix +++ /dev/null @@ -1,21 +0,0 @@ -{pkgs, ...}: { - # Make udev rules to make PDP controller and Oculus Rift CV1 work - services.udev = let - oculusRules = pkgs.writeTextFile { - name = "10-oculus.rules"; - text = '' - KERNEL=="hidraw*", ATTRS{idVendor}=="0e6f", ATTRS{idProduct}=="0184", MODE="0660", TAG+="uaccess" - ''; - destination = "/etc/udev/rules.d/10-oculus.rules"; - }; - pdpRules = pkgs.writeTextFile { - name = "10-pdp.rules"; - text = '' - SUBSYSTEM=="usb", ATTR{idVendor}=="2833", MODE="0666" - ''; - destination = "/etc/udev/rules.d/10-pdp.rules"; - }; - in { - packages = [oculusRules pdpRules]; - }; -} diff --git a/system/users/groups.nix b/system/users/groups.nix deleted file mode 100644 index 334f839b..00000000 --- a/system/users/groups.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ - # Define custom groups - users.groups = { - nfsShare = {}; - }; -} diff --git a/system/users/jimbo.nix b/system/users/jimbo.nix deleted file mode 100644 index 21dce747..00000000 --- a/system/users/jimbo.nix +++ /dev/null @@ -1,28 +0,0 @@ -{pkgs, outputs, ...}: { - users.users = { - jimbo = { - description = "Jimbo"; - hashedPassword = outputs.secrets.jimboAccPass; - isNormalUser = true; - openssh.authorizedKeys.keys = outputs.secrets.jimKeys; - extraGroups = [ - "wheel" - "audio" - "video" - "input" - "disk" - "dialout" - "networkmanager" - "rtkit" - "kvm" - "libvirtd" - "qemu-libvirtd" - "nginx" - "minecraft" - "nfsShare" - ]; - uid = 1000; - shell = pkgs.zsh; - }; - }; -} diff --git a/system/users/liquidsoap.nix b/system/users/liquidsoap.nix deleted file mode 100644 index c1a2abd2..00000000 --- a/system/users/liquidsoap.nix +++ /dev/null @@ -1,9 +0,0 @@ -{ - # Add service users to extra groups - users.users = { - nextcloud = { - extraGroups = [ "nginx" ]; - isSystemUser = true; - }; - }; -} diff --git a/system/users/nextcloud.nix b/system/users/nextcloud.nix deleted file mode 100644 index f94c29c2..00000000 --- a/system/users/nextcloud.nix +++ /dev/null @@ -1,9 +0,0 @@ -{ - # Add service users to extra groups - users.users = { - nextcloud = { - extraGroups = [ "nfsShare" ]; - isSystemUser = true; - }; - }; -} diff --git a/system/users/nginx.nix b/system/users/nginx.nix deleted file mode 100644 index 680f8107..00000000 --- a/system/users/nginx.nix +++ /dev/null @@ -1,9 +0,0 @@ -{ - # Add service users to extra groups - users.users = { - nginx = { - extraGroups = [ "turnserver" "virtualMail" ]; - isSystemUser = true; - }; - }; -} diff --git a/variables/default.nix b/variables/default.nix new file mode 100644 index 00000000..0c75a334 --- /dev/null +++ b/variables/default.nix @@ -0,0 +1,11 @@ +{ ... }: +{ + imports = [ + ./displays + ./domains + ./ips + ./look + ./secrets + ./workspaces + ]; +} diff --git a/variables/displays/default.nix b/variables/displays/default.nix new file mode 100644 index 00000000..1fe447ac --- /dev/null +++ b/variables/displays/default.nix @@ -0,0 +1,14 @@ +{ lib, config, ... }: +{ + options.displays = lib.mkOption { + type = lib.types.attrs; + default = {}; + }; + + config.displays = { + d1 = "DP-3"; + d2 = "DP-1"; + d3 = "DP-2"; + dI = "eDP-1"; + }; +} diff --git a/variables/domains/default.nix b/variables/domains/default.nix new file mode 100644 index 00000000..966bf5b2 --- /dev/null +++ b/variables/domains/default.nix @@ -0,0 +1,14 @@ +{ lib, config, ... }: +{ + options.domains = lib.mkOption { + type = lib.types.attrs; + default = {}; + }; + + config.domains = { + jim1 = "jimbosfiles.com"; + jim2 = "nixfox.ca"; + corn = "freecorn1854.win"; + luna = "lunamoonlight.xyz"; + }; +} diff --git a/variables/ips/default.nix b/variables/ips/default.nix new file mode 100644 index 00000000..61f32e4d --- /dev/null +++ b/variables/ips/default.nix @@ -0,0 +1,19 @@ +{ lib, config, ... }: +{ + options.ips = lib.mkOption { + type = lib.types.attrs; + default = {}; + }; + + config.ips = rec { + netInt = "eno1"; + localSpan = "10.0.0"; + server = "${localSpan}.2"; + pc = "${localSpan}.3"; + vm = "${localSpan}.4"; + hx = "${localSpan}.70"; + + wgInt = "wg0"; + wgSpan = "10.100.0"; + }; +} diff --git a/variables/look/border/default.nix b/variables/look/border/default.nix new file mode 100644 index 00000000..6f707c06 --- /dev/null +++ b/variables/look/border/default.nix @@ -0,0 +1,12 @@ +{ lib, config, ... }: +{ + options.look.border = lib.mkOption { + type = lib.types.attrs; + default = {}; + }; + + config.look.border = rec { + int = 3; + string = toString int; + }; +} diff --git a/variables/look/colors/green/default.nix b/variables/look/colors/green/default.nix new file mode 100644 index 00000000..bc7fbb30 --- /dev/null +++ b/variables/look/colors/green/default.nix @@ -0,0 +1,22 @@ +{ lib, config, ... }: +{ + options.look.colors = lib.mkOption { + type = lib.types.attrs; + default = {}; + }; + + config.look.colors = { + prime = "12c949"; #12c949 + accent = "115622"; #115622 + split = "2c7250"; #2c7250 + actSplit = "457551"; #457551 + dark = "101911"; #101911 + mid = "17231c"; #17231c + light = "263327"; #263327 + urgent = "C43823"; #C43823 + text = "C7D3E3"; #C7D3E3 + + folder = "green"; + wallpapers = "leaves"; + }; +} diff --git a/variables/look/colors/orange/default.nix b/variables/look/colors/orange/default.nix new file mode 100644 index 00000000..1d4785f1 --- /dev/null +++ b/variables/look/colors/orange/default.nix @@ -0,0 +1,22 @@ +{ lib, config, ... }: +{ + options.look.colors = lib.mkOption { + type = lib.types.attrs; + default = {}; + }; + + config.look.colors = { + prime = "f4a61f"; #f4a61f + accent = "684820"; #684820 + split = "9e8955"; #9e8955 + actSplit = "c9ae68"; #c9ae68 + dark = "101419"; #101419 + mid = "191810"; #191810 + light = "332e26"; #332e26 + urgent = "C43823"; #C43823 + text = "C7D3E3"; #C7D3E3 + + folder = "orange"; + wallpapers = "hillorange"; + }; +} diff --git a/variables/look/colors/purple/default.nix b/variables/look/colors/purple/default.nix new file mode 100644 index 00000000..00d8f563 --- /dev/null +++ b/variables/look/colors/purple/default.nix @@ -0,0 +1,22 @@ +{ lib, config, ... }: +{ + options.look.colors = lib.mkOption { + type = lib.types.attrs; + default = {}; + }; + + config.look.colors = { + prime = "3823C4"; #3823C4 + accent = "1B1F59"; #1B1F59 + split = "555B9E"; #555B9E + actSplit = "5980B7"; #5980B7 + dark = "101419"; #101419 + mid = "171C23"; #171C23 + light = "272b33"; #272B33 + urgent = "C43823"; #C43823 + text = "C7D3E3"; #C7D3E3 + + folder = "indigo"; + wallpapers = "purplespace"; + }; +} diff --git a/variables/look/colors/red/default.nix b/variables/look/colors/red/default.nix new file mode 100644 index 00000000..fd647c39 --- /dev/null +++ b/variables/look/colors/red/default.nix @@ -0,0 +1,22 @@ +{ lib, config, ... }: +{ + options.look.colors = lib.mkOption { + type = lib.types.attrs; + default = {}; + }; + + config.look.colors = { + prime = "c91236"; #c91236 + accent = "56111f"; #56111f + split = "722d51"; #722d51 + actSplit = "754566"; #754566 + dark = "191016"; #191016 + mid = "23171d"; #23171d + light = "332926"; #332926 + urgent = "C43823"; #C43823 + text = "C7D3E3"; #C7D3E3 + + folder = "red"; + wallpapers = "dogmatica"; + }; +} diff --git a/variables/look/default.nix b/variables/look/default.nix new file mode 100644 index 00000000..0fd75f16 --- /dev/null +++ b/variables/look/default.nix @@ -0,0 +1,7 @@ +{ ... }: +{ + imports = [ + ./border + ./fonts + ]; +} diff --git a/variables/look/fonts/default.nix b/variables/look/fonts/default.nix new file mode 100644 index 00000000..00e764b0 --- /dev/null +++ b/variables/look/fonts/default.nix @@ -0,0 +1,12 @@ +{ lib, config, ... }: +{ + options.look.fonts = lib.mkOption { + type = lib.types.attrs; + default = {}; + }; + + config.look.fonts = { + main = ''Ubuntu''; + nerd = ''UbuntuMono Nerd Font''; + }; +} diff --git a/variables/secrets/default.nix b/variables/secrets/default.nix new file mode 100644 index 00000000..0cbd023f Binary files /dev/null and b/variables/secrets/default.nix differ diff --git a/variables/workspaces/default.nix b/variables/workspaces/default.nix new file mode 100644 index 00000000..eb613b2b --- /dev/null +++ b/variables/workspaces/default.nix @@ -0,0 +1,29 @@ +{ lib, config, ... }: +{ + options.ws = lib.mkOption { + type = lib.types.attrs; + default = {}; + }; + + config.ws = { + w0 = ''0:0''; + w1 = ''1:1''; + w2 = ''2:2''; + w3 = ''3:3''; + w4 = ''4:4''; + w5 = ''5:5''; + w6 = ''6:6''; + w7 = ''7:7''; + w8 = ''8:8''; + w9 = ''9:9''; + w1a = ''11:I''; + w2a = ''22:II''; + w3a = ''33:III''; + w4a = ''44:IV''; + w5a = ''55:V''; + w6a = ''66:VI''; + w7a = ''77:VII''; + w8a = ''88:VIII''; + w9a = ''99:IX''; + }; +}