diff --git a/.gitattributes b/.gitattributes index c028012f..8aafc71a 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1 +1 @@ -variables/secrets/** filter=git-crypt diff=git-crypt +extras/secrets.nix filter=git-crypt diff=git-crypt diff --git a/README.md b/README.md index 25610e86..6632f76c 100644 --- a/README.md +++ b/README.md @@ -1,39 +1,33 @@ -## Jimbo's Nix Systems +## My Nix files, now organized in a flake. -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. +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. ### Installation -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. +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. -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. +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. ### Usage My config uses these tools: -``Sway`` - Window manager / Desktop -``ZSH`` - Primary shell -``Foot`` - Terminal emulator -``Rofi`` - App launcher and menu system +Sway - Window manager / Desktop +Foot - Terminal emulator +Rofi - App launcher and menu system +ZSH - Primary shell -I have defined shell aliases in ZSH for rebuilding different parts of Nix, they are as follows: +I have made shell aliases in ZSH for rebuilding the system. 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 both user and system profile. +`nixswitch` = Switch to new config for both user and system. `nixdate` = Same as before, but updating flake.nix before doing so. This is essentially a full system update. -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. +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. 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 new file mode 100644 index 00000000..a407dca8 --- /dev/null +++ b/extras/cmd.nix @@ -0,0 +1,4 @@ +{ + auth = "doas"; + nixcfg = "ranger /etc/nixos"; +} diff --git a/extras/displays.nix b/extras/displays.nix new file mode 100644 index 00000000..b111d6b2 --- /dev/null +++ b/extras/displays.nix @@ -0,0 +1,6 @@ +{ + d1 = "DP-3"; + d2 = "DP-1"; + d3 = "DP-2"; + dI = "eDP-1"; +} diff --git a/extras/ips.nix b/extras/ips.nix new file mode 100644 index 00000000..0d30dfec --- /dev/null +++ b/extras/ips.nix @@ -0,0 +1,11 @@ +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 new file mode 100644 index 00000000..0a2dad55 --- /dev/null +++ b/extras/look.nix @@ -0,0 +1,21 @@ +{ + 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 new file mode 100644 index 00000000..fe3e0196 --- /dev/null +++ b/extras/overlays.nix @@ -0,0 +1,17 @@ +{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 new file mode 100644 index 00000000..3e3edab2 --- /dev/null +++ b/extras/pkgs/default.nix @@ -0,0 +1,5 @@ +# 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/overlays/packages/xash3d/change-zip-date.patch b/extras/pkgs/xash/change-zip-date.patch similarity index 100% rename from overlays/packages/xash3d/change-zip-date.patch rename to extras/pkgs/xash/change-zip-date.patch diff --git a/overlays/packages/hlsdk/default.nix b/extras/pkgs/xash/hlsdk.nix similarity index 100% rename from overlays/packages/hlsdk/default.nix rename to extras/pkgs/xash/hlsdk.nix diff --git a/overlays/packages/xash3d/default.nix b/extras/pkgs/xash/xash3d.nix similarity index 100% rename from overlays/packages/xash3d/default.nix rename to extras/pkgs/xash/xash3d.nix diff --git a/extras/secrets-template.nix b/extras/secrets-template.nix new file mode 100644 index 00000000..e1023319 --- /dev/null +++ b/extras/secrets-template.nix @@ -0,0 +1,72 @@ +{ + # 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 new file mode 100644 index 00000000..431f37f5 Binary files /dev/null and b/extras/secrets.nix differ diff --git a/extras/workspaces.nix b/extras/workspaces.nix new file mode 100644 index 00000000..4615a494 --- /dev/null +++ b/extras/workspaces.nix @@ -0,0 +1,21 @@ +{ + 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 418f8b01..2c9a6df4 100644 --- a/flake.lock +++ b/flake.lock @@ -33,30 +33,6 @@ "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": [ @@ -147,20 +123,6 @@ "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" @@ -236,27 +198,6 @@ } }, "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" @@ -277,28 +218,6 @@ "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", @@ -369,29 +288,6 @@ "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, @@ -470,17 +366,18 @@ }, "nixpkgs_4": { "locked": { - "lastModified": 1728740863, - "narHash": "sha256-u+rxA79a0lyhG+u+oPBRtTDtzz8kvkc9a6SWSt9ekVc=", - "owner": "NixOS", + "lastModified": 1727540905, + "narHash": "sha256-40J9tW7Y794J7Uw4GwcAKlMxlX2xISBl6IBigo83ih8=", + "owner": "nixos", "repo": "nixpkgs", - "rev": "a3f9ad65a0bf298ed5847629a57808b97e6e8077", + "rev": "fbca5e745367ae7632731639de5c21f29c8744ed", "type": "github" }, "original": { - "id": "nixpkgs", + "owner": "nixos", "ref": "nixos-24.05", - "type": "indirect" + "repo": "nixpkgs", + "type": "github" } }, "nur": { @@ -528,9 +425,8 @@ "root": { "inputs": { "blender-bin": "blender-bin", - "chaotic": "chaotic", "hardware": "hardware", - "home-manager": "home-manager_2", + "home-manager": "home-manager", "lanzaboote": "lanzaboote", "mailserver": "mailserver", "minecraft": "minecraft", @@ -613,15 +509,16 @@ "locked": { "lastModified": 1728492678, "narHash": "sha256-9UTxR8eukdg+XZeHgxW5hQA9fIKHsKCdOIUycTryeVw=", - "owner": "NixOS", + "owner": "nixos", "repo": "nixpkgs", "rev": "5633bcff0c6162b9e4b5f1264264611e950c8ec7", "type": "github" }, "original": { - "id": "nixpkgs", + "owner": "nixos", "ref": "nixos-unstable", - "type": "indirect" + "repo": "nixpkgs", + "type": "github" } }, "utils": { diff --git a/flake.nix b/flake.nix index b8c07ca2..46806529 100644 --- a/flake.nix +++ b/flake.nix @@ -1,91 +1,97 @@ { + description = "Jimbo's systems as a flake"; + inputs = { - 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"; - }; - + nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05"; + unstable.url = "github:nixos/nixpkgs/nixos-unstable"; nur.url = "github:nix-community/NUR"; - chaotic = { - url = "github:chaotic-cx/nyx/nyxpkgs-unstable"; - inputs.nixpkgs.follows = "unstable"; - }; - + mailserver.url = "gitlab:simple-nixos-mailserver/nixos-mailserver/nixos-24.05"; 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"; }; - mailserver.url = "gitlab:simple-nixos-mailserver/nixos-mailserver/nixos-24.05"; - minecraft.url = "github:Infinidoge/nix-minecraft"; + # Home manager + home-manager = { + url = "github:nix-community/home-manager/release-24.05"; + inputs.nixpkgs.follows = "nixpkgs"; + }; }; outputs = { + self, nixpkgs, unstable, - home-manager, nur, - chaotic, + mailserver, blender-bin, hardware, lanzaboote, - mailserver, - minecraft, + home-manager, ... - }: - let - mkNix = modules: nixpkgs.lib.nixosSystem { + }@inputs: let + mkNixos = modules: nixpkgs.lib.nixosSystem { inherit modules; - specialArgs = { - inherit - unstable - chaotic - hardware - lanzaboote - mailserver - minecraft - ; - }; + specialArgs = { inherit (self) inputs outputs; }; }; + mkHome = modules: pkgs: home-manager.lib.homeManagerConfiguration { inherit modules pkgs; - extraSpecialArgs = { - inherit - unstable - nur - blender-bin - ; - }; + extraSpecialArgs = { inherit (self) inputs outputs; }; }; in { - # nixos-rebuild switch --flake .#hostname - nixosConfigurations = { - # PCs and Laptops - firefly = mkNix [ ./hosts/firefly/system ]; - shuttleworth = mkNix [ ./hosts/shuttleworth/system ]; - lacros = mkNix [ ./hosts/lacros/system ]; - redmond = mkNix [ ./hosts/redmond/system ]; + # Your custom packages and modifications, exported as overlays + overlays = import ./extras/overlays.nix { inherit inputs; }; - # Servers - cyberspark = mkNix [ ./hosts/cyberspark/system ]; - bomberman = mkNix [ ./hosts/bomberman/system ]; + # 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' + 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 + ]; }; - # home-manager switch --flake .#username@hostname + # Home-manager configuration: 'home-manager --flake .#username@hostname' homeConfigurations = { - "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@JimDesktop" = mkHome [ + ./home/hosts/JimDesktop/home.nix + nur.nixosModules.nur + ] 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; + "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; }; }; } diff --git a/modules/home/files/assets/pfp.png b/home/assets/user-icon.png similarity index 100% rename from modules/home/files/assets/pfp.png rename to home/assets/user-icon.png diff --git a/modules/home/files/assets/wallpapers/purplespace/1.png b/home/assets/wallpapers/1.png similarity index 100% rename from modules/home/files/assets/wallpapers/purplespace/1.png rename to home/assets/wallpapers/1.png diff --git a/modules/home/files/assets/wallpapers/purplespace/2.png b/home/assets/wallpapers/2.png similarity index 100% rename from modules/home/files/assets/wallpapers/purplespace/2.png rename to home/assets/wallpapers/2.png diff --git a/modules/home/files/assets/wallpapers/purplespace/3.png b/home/assets/wallpapers/3.png similarity index 100% rename from modules/home/files/assets/wallpapers/purplespace/3.png rename to home/assets/wallpapers/3.png diff --git a/modules/home/files/assets/lockscreens/holymoly/lock.png b/home/assets/wallpapers/lock.png similarity index 100% rename from modules/home/files/assets/lockscreens/holymoly/lock.png rename to home/assets/wallpapers/lock.png diff --git a/home/base.nix b/home/base.nix new file mode 100644 index 00000000..053fdac3 --- /dev/null +++ b/home/base.nix @@ -0,0 +1,41 @@ +# 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 new file mode 100644 index 00000000..8f213a9a --- /dev/null +++ b/home/hosts/JimDesktop/home.nix @@ -0,0 +1,47 @@ +{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 new file mode 100644 index 00000000..a2090db1 --- /dev/null +++ b/home/hosts/JimLenovo/home.nix @@ -0,0 +1,40 @@ +{ + 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 new file mode 100644 index 00000000..809906ca --- /dev/null +++ b/home/hosts/JimPine/home.nix @@ -0,0 +1,43 @@ +{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 new file mode 100644 index 00000000..8f71646a --- /dev/null +++ b/home/hosts/JimServer/home.nix @@ -0,0 +1,8 @@ +{ + 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 new file mode 100644 index 00000000..d0d54aed --- /dev/null +++ b/home/hosts/JimTerminal/home.nix @@ -0,0 +1,14 @@ +{ + 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/modules/home/programs/misc/avtools/default.nix b/home/misc/avtools.nix similarity index 85% rename from modules/home/programs/misc/avtools/default.nix rename to home/misc/avtools.nix index c4d6f093..baffc4b3 100644 --- a/modules/home/programs/misc/avtools/default.nix +++ b/home/misc/avtools.nix @@ -1,5 +1,4 @@ -{ pkgs, ... }: -{ +{pkgs, ...}: { home.packages = with pkgs; [ yt-dlp spotdl diff --git a/modules/home/programs/misc/gaming/emulators/default.nix b/home/misc/emulators.nix similarity index 70% rename from modules/home/programs/misc/gaming/emulators/default.nix rename to home/misc/emulators.nix index 8acaf48a..931f46d6 100644 --- a/modules/home/programs/misc/gaming/emulators/default.nix +++ b/home/misc/emulators.nix @@ -1,11 +1,10 @@ -{ pkgs, lib, config, ... }: -{ +{pkgs, ...}: { home.packages = with pkgs; [ dolphin-emu cemu ryujinx duckstation pcsx2 - #lime3ds + unstable.lime3ds ]; } diff --git a/home/misc/filemanager.nix b/home/misc/filemanager.nix new file mode 100644 index 00000000..f6b18f95 --- /dev/null +++ b/home/misc/filemanager.nix @@ -0,0 +1,7 @@ +{pkgs, ...}: { + home.packages = with pkgs; [ + gnome.file-roller + imagemagick + poppler_utils + ]; +} diff --git a/modules/home/settings/fonts/default.nix b/home/misc/fonts.nix similarity index 100% rename from modules/home/settings/fonts/default.nix rename to home/misc/fonts.nix diff --git a/modules/home/programs/misc/gaming/launchers/default.nix b/home/misc/gaming.nix similarity index 75% rename from modules/home/programs/misc/gaming/launchers/default.nix rename to home/misc/gaming.nix index 7fc5aa9e..8bc40406 100644 --- a/modules/home/programs/misc/gaming/launchers/default.nix +++ b/home/misc/gaming.nix @@ -1,5 +1,4 @@ -{ pkgs, lib, config, ... }: -{ +{pkgs, ...}: { home.packages = with pkgs; [ steam steam-run diff --git a/home/misc/guifiles.nix b/home/misc/guifiles.nix new file mode 100644 index 00000000..dc85cc11 --- /dev/null +++ b/home/misc/guifiles.nix @@ -0,0 +1,15 @@ +{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 new file mode 100644 index 00000000..c5a89671 --- /dev/null +++ b/home/misc/production.nix @@ -0,0 +1,9 @@ +{pkgs, ...}: { + home.packages = with pkgs; [ + krita + inkscape + audacity + blender_4_2 + sunvox + ]; +} diff --git a/modules/home/programs/misc/remote-desktop/default.nix b/home/misc/remotedesktop.nix similarity index 71% rename from modules/home/programs/misc/remote-desktop/default.nix rename to home/misc/remotedesktop.nix index d7e65b62..4d18c485 100644 --- a/modules/home/programs/misc/remote-desktop/default.nix +++ b/home/misc/remotedesktop.nix @@ -1,5 +1,4 @@ -{ pkgs, lib, config, ... }: -{ +{pkgs, ...}: { home.packages = with pkgs; [ moonlight-qt rustdesk-flutter diff --git a/modules/home/programs/misc/school/default.nix b/home/misc/school.nix similarity index 77% rename from modules/home/programs/misc/school/default.nix rename to home/misc/school.nix index 10320e69..9b4630f6 100644 --- a/modules/home/programs/misc/school/default.nix +++ b/home/misc/school.nix @@ -1,9 +1,9 @@ -{ pkgs, lib, config, ... }: -{ +{pkgs, ...}: { home.packages = with pkgs; [ remmina freerdp - zoom-us globalprotect-openconnect + python3 + zoom-us ]; } diff --git a/modules/home/programs/misc/general/default.nix b/home/misc/useful.nix similarity index 79% rename from modules/home/programs/misc/general/default.nix rename to home/misc/useful.nix index 4efce085..e6f4d7f0 100644 --- a/modules/home/programs/misc/general/default.nix +++ b/home/misc/useful.nix @@ -1,9 +1,10 @@ -{ pkgs, lib, config, ... }: -{ +{pkgs, ...}: { home.packages = with pkgs; [ imv qbittorrent libreoffice-fresh + vesktop + fractal ffmpegthumbnailer thunderbird protonvpn-cli_2 diff --git a/home/misc/variables.nix b/home/misc/variables.nix new file mode 100644 index 00000000..e353e65d --- /dev/null +++ b/home/misc/variables.nix @@ -0,0 +1,30 @@ +{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/modules/home/programs/misc/gaming/xash3d/default.nix b/home/misc/xash3d.nix similarity index 62% rename from modules/home/programs/misc/gaming/xash3d/default.nix rename to home/misc/xash3d.nix index 21586063..714944ca 100644 --- a/modules/home/programs/misc/gaming/xash3d/default.nix +++ b/home/misc/xash3d.nix @@ -1,6 +1,6 @@ -{ pkgs, lib, config, ... }: -{ +{pkgs, ...}: { home.packages = with pkgs; [ xash3d + hlsdk ]; } diff --git a/home/programs/easyeffects.nix b/home/programs/easyeffects.nix new file mode 100644 index 00000000..bffaa3ed --- /dev/null +++ b/home/programs/easyeffects.nix @@ -0,0 +1,309 @@ +{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/modules/home/programs/gui/foot/default.nix b/home/programs/foot.nix similarity index 80% rename from modules/home/programs/gui/foot/default.nix rename to home/programs/foot.nix index 13d396e1..73d8a1c2 100644 --- a/modules/home/programs/gui/foot/default.nix +++ b/home/programs/foot.nix @@ -1,19 +1,19 @@ -{ config, ... }: -{ +{outputs, ...}: { + # Enable a terminal emulator programs.foot = { enable = true; server.enable = false; settings = { main = { term = "xterm-256color"; - font = "${config.look.fonts.nerd}:size=14.7"; + font = "${outputs.look.fonts.nerd}:size=14.7"; }; cursor = { style = "beam"; }; colors = { - alpha = "0.85"; - background = "${config.look.colors.dark}"; + alpha = "0.65"; + background = "${outputs.look.colors.dark}"; regular0 = "3f3f3f"; regular1 = "cc0000"; regular2 = "4e9a06"; diff --git a/modules/home/settings/gtk/default.nix b/home/programs/gtk.nix similarity index 68% rename from modules/home/settings/gtk/default.nix rename to home/programs/gtk.nix index 78a4bfc5..fcf97ed2 100644 --- a/modules/home/settings/gtk/default.nix +++ b/home/programs/gtk.nix @@ -1,9 +1,9 @@ -{ pkgs, config, ... }: -{ +{pkgs, outputs, ...}: { + # Define GTK theme settings gtk = { enable = true; font = { - name = "${config.look.fonts.main}"; + name = "${outputs.look.fonts.main}"; size = 11; }; theme = { @@ -16,7 +16,7 @@ }; }; iconTheme = { - package = pkgs.papirus-icon-theme.override { color = "${config.look.colors.folder}"; }; + package = pkgs.papirus-icon-theme.override {color = "indigo";}; name = "Papirus-Dark"; }; cursorTheme = { @@ -24,6 +24,7 @@ name = "Simp1e-Dark"; }; + # GTK app bookmarks gtk3 = { bookmarks = [ # Local @@ -33,7 +34,16 @@ "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/programs/gui/librewolf/default.nix b/home/programs/librewolf.nix similarity index 90% rename from modules/home/programs/gui/librewolf/default.nix rename to home/programs/librewolf.nix index 83f1ef29..31b9ca14 100644 --- a/modules/home/programs/gui/librewolf/default.nix +++ b/home/programs/librewolf.nix @@ -1,31 +1,30 @@ -{ pkgs, config, ... }: -let - # FireFox colors, based on https://github.com/Dook97/firefox-qutebrowser-userchrome +{pkgs, config, outputs, ...}: let + # FireFox colors themeJim = '' :root { - --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-bg-color: #${outputs.look.colors.prime}; + --tab-hover-bg-color: #${outputs.look.colors.accent}; + --tab-inactive-bg-color: #${outputs.look.colors.dark}; --tab-active-fg-fallback-color: #FFFFFF; - --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; + --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; ''; themeAlt = '' :root { - --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-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-inactive-fg-fallback-color: #FFFFFF; - --urlbar-focused-bg-color: #${config.look.colors.prime}; - --urlbar-not-focused-bg-color: #${config.look.colors.prime}; - --toolbar-bgcolor: #${config.look.colors.prime} !important; + --urlbar-focused-bg-color: #${outputs.look.colors.prime}; + --urlbar-not-focused-bg-color: #${outputs.look.colors.prime}; + --toolbar-bgcolor: #${outputs.look.colors.prime} !important; ''; quteFoxCSS = '' - --tab-font: '${config.look.fonts.main}'; - --urlbar-font: '${config.look.fonts.main}'; + --tab-font: '${outputs.look.fonts.main}'; + --urlbar-font: '${outputs.look.fonts.main}'; /* try increasing if you encounter problems */ --urlbar-height-setting: 24px; @@ -336,9 +335,9 @@ in { }; }; commonSettings = { - "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}"; + "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}"; "general.autoScroll" = true; "browser.compactmode.show" = true; "browser.uidensity" = 1; diff --git a/modules/home/programs/gui/mangohud/default.nix b/home/programs/mangohud.nix similarity index 76% rename from modules/home/programs/gui/mangohud/default.nix rename to home/programs/mangohud.nix index 4ce3b0d7..f7160d73 100644 --- a/modules/home/programs/gui/mangohud/default.nix +++ b/home/programs/mangohud.nix @@ -1,11 +1,11 @@ -{ pkgs, ... }: -{ +{pkgs, ...}: { home = { packages = with pkgs; [ mangohud ]; - file = { - ".config/MangoHud/MangoHud.conf".text = '' + file = let + # Mangohud config file + mangoConf = '' table_columns=2 frametime=0 legacy_layout=0 @@ -24,6 +24,9 @@ gpu_load_change frame_timing ''; + in { + # Mangohud config + ".config/MangoHud/MangoHud.conf".text = mangoConf; }; }; } diff --git a/modules/home/programs/gui/mpv/default.nix b/home/programs/mpv.nix similarity index 88% rename from modules/home/programs/gui/mpv/default.nix rename to home/programs/mpv.nix index 1e9e4d45..0fec58b4 100644 --- a/modules/home/programs/gui/mpv/default.nix +++ b/home/programs/mpv.nix @@ -1,5 +1,5 @@ -{ ... }: { + # MPV settings programs.mpv = { enable = true; config = { diff --git a/modules/home/programs/misc/production/obs/default.nix b/home/programs/obs.nix similarity index 86% rename from modules/home/programs/misc/production/obs/default.nix rename to home/programs/obs.nix index 164ffe23..f8da5fe9 100644 --- a/modules/home/programs/misc/production/obs/default.nix +++ b/home/programs/obs.nix @@ -1,5 +1,5 @@ -{ pkgs, lib, config, ... }: -{ +{pkgs, ...}: { + # OBS with plugins programs.obs-studio = { enable = true; plugins = with pkgs.obs-studio-plugins; [ diff --git a/modules/home/programs/gui/pcmanfm-qt/default.nix b/home/programs/pcmanfm-qt.nix similarity index 83% rename from modules/home/programs/gui/pcmanfm-qt/default.nix rename to home/programs/pcmanfm-qt.nix index ff6ee82c..e8e4838c 100644 --- a/modules/home/programs/gui/pcmanfm-qt/default.nix +++ b/home/programs/pcmanfm-qt.nix @@ -1,12 +1,12 @@ -{ pkgs, ... }: -{ +{pkgs, ...}: { + # Swappy config file home = { packages = with pkgs; [ pcmanfm-qt - gnome.file-roller ]; - file = { - ".config/pcmanfm-qt/default/settings.conf".text = '' + file = let + # File manager config + pcmanConf = '' [Behavior] BookmarkOpenMethod=current_tab ConfirmDelete=true @@ -53,6 +53,9 @@ SwitchToNewTab=true TabPaths=@Invalid() ''; + in { + # PCManFM config + ".config/pcmanfm-qt/default/settings.conf".text = pcmanConf; }; }; } diff --git a/modules/home/programs/gui/rofi/default.nix b/home/programs/rofi.nix similarity index 77% rename from modules/home/programs/gui/rofi/default.nix rename to home/programs/rofi.nix index a46ab78a..f84a2c33 100644 --- a/modules/home/programs/gui/rofi/default.nix +++ b/home/programs/rofi.nix @@ -1,10 +1,10 @@ -{ pkgs, config, ... }: -{ +{pkgs, config, outputs, ...}: { + # Enable Rofi programs.rofi = { enable = true; package = pkgs.rofi-wayland; terminal = "foot"; - font = "${config.look.fonts.main} 14"; + font = "${outputs.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 "#${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}"; + 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}"; selected-normal-foreground = mkLiteral "#FFFFFF"; - 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"; + 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"; }; "#window" = { background-color = mkLiteral "@background"; width = 500; - border = mkLiteral "${config.look.border.string}"; + border = mkLiteral "${outputs.look.border.string}"; padding = 5; }; "#message" = { @@ -124,7 +124,7 @@ }; }; home.packages = let - # A script to execute commands with Rofi + # All my rofi scripts in one file rofiScripts = pkgs.writeScriptBin "rofiscripts" '' # Scratchpad function handle_scratchpads() { @@ -155,13 +155,13 @@ case $RET in Default) swaymsg reload ;; Wide) swaymsg " - 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 + 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 ";; GPU2) swaymsg " - output ${config.displays.d2} enable pos 1680 0 mode 1920x1080@60Hz - output ${config.displays.d3} enable pos 0 0 transform 0 + output ${outputs.displays.d2} enable pos 1680 0 mode 1920x1080@60Hz + output ${outputs.displays.d3} enable pos 0 0 transform 0 ";; esac } diff --git a/home/programs/swappy.nix b/home/programs/swappy.nix new file mode 100644 index 00000000..917bc40f --- /dev/null +++ b/home/programs/swappy.nix @@ -0,0 +1,19 @@ +{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 new file mode 100644 index 00000000..9b45e0d0 --- /dev/null +++ b/home/services/gnome-keyring.nix @@ -0,0 +1,13 @@ +{pkgs, ...}: { + services.gnome-keyring = { + enable = true; + components = [ + "ssh" + ]; + }; + + home.packages = with pkgs; [ + gnome.gnome-keyring + gnome.libgnome-keyring + ]; +} diff --git a/modules/home/programs/gui/mako/default.nix b/home/services/mako.nix similarity index 76% rename from modules/home/programs/gui/mako/default.nix rename to home/services/mako.nix index c818efcf..050bdf34 100644 --- a/modules/home/programs/gui/mako/default.nix +++ b/home/services/mako.nix @@ -1,22 +1,23 @@ -{ pkgs, config, ... }: -{ +{pkgs, outputs, ...}: { + # Notification daemon services.mako = { enable = true; - borderColor = "#${config.look.colors.accent}"; - backgroundColor = "#${config.look.colors.dark}D9"; - output = "${config.displays.d1}"; + borderColor = "#${outputs.look.colors.accent}"; + backgroundColor = "#${outputs.look.colors.dark}CC"; + output = "${outputs.displays.d1}"; sort = "+time"; layer = "overlay"; padding = "8"; margin = "0"; - borderSize = config.look.border.int; + borderSize = outputs.look.border.int; maxIconSize = 40; defaultTimeout = 6000; - font = "${config.look.fonts.main} 12"; + font = "${outputs.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/services/reloadunits.nix b/home/services/reloadunits.nix new file mode 100644 index 00000000..2cd1837b --- /dev/null +++ b/home/services/reloadunits.nix @@ -0,0 +1,7 @@ +{ + # Nicely reload system units when changing configs + systemd.user = { + enable = true; + startServices = "sd-switch"; + }; +} diff --git a/modules/home/utils/udiskie/default.nix b/home/services/udiskie.nix similarity index 71% rename from modules/home/utils/udiskie/default.nix rename to home/services/udiskie.nix index fedeb78a..84698048 100644 --- a/modules/home/utils/udiskie/default.nix +++ b/home/services/udiskie.nix @@ -1,5 +1,5 @@ -{ ... }: { + # Mount as user with udisk2 services.udiskie = { enable = true; automount = false; diff --git a/modules/home/sway/hotkeys/README.md b/home/sway/README.md similarity index 100% rename from modules/home/sway/hotkeys/README.md rename to home/sway/README.md diff --git a/modules/home/sway/autostart/default.nix b/home/sway/autostart.nix similarity index 89% rename from modules/home/sway/autostart/default.nix rename to home/sway/autostart.nix index 79cf26b5..7de28dac 100644 --- a/modules/home/sway/autostart/default.nix +++ b/home/sway/autostart.nix @@ -1,7 +1,8 @@ -{ pkgs, ... }: -{ +{config, pkgs, ...}: { + # Enable Sway and write some scripts wayland.windowManager.sway = { config = { + # Use Waybar rather than Sway's bars = [{command = "waybar";}]; startup = [ diff --git a/modules/home/sway/hardware/default.nix b/home/sway/hardware.nix similarity index 74% rename from modules/home/sway/hardware/default.nix rename to home/sway/hardware.nix index bed8f286..dc0b3329 100644 --- a/modules/home/sway/hardware/default.nix +++ b/home/sway/hardware.nix @@ -1,31 +1,31 @@ -{ config, ... }: -{ +{config, pkgs, outputs, ...}: { wayland.windowManager.sway = { config = { # Define monitors output = { - ${config.displays.d1} = { + ${outputs.displays.d1} = { pos = "1920 405"; mode = "1920x1080@143.980Hz"; max_render_time = "3"; - bg = "~/.assets/wallpapers/1.png fill"; + bg = "~/.wallpapers/1.png fill"; adaptive_sync = "on"; + #tearing_allowed = "1"; }; - ${config.displays.d2} = { + ${outputs.displays.d2} = { pos = "0 405"; mode = "1920x1080@60Hz"; max_render_time = "3"; - bg = "~/.assets/wallpapers/2.png fill"; + bg = "~/.wallpapers/2.png fill"; }; - ${config.displays.d3} = { + ${outputs.displays.d3} = { pos = "3840 0"; mode = "1680x1050@59.883Hz"; transform = "270"; max_render_time = "3"; - bg = "~/.assets/wallpapers/3.png fill"; + bg = "~/.wallpapers/3.png fill"; }; "*" = { - bg = "~/.assets/wallpapers/1.png fill"; + bg = "~/.wallpapers/1.png fill"; }; }; diff --git a/home/sway/hotkeys.nix b/home/sway/hotkeys.nix new file mode 100644 index 00000000..84756dea --- /dev/null +++ b/home/sway/hotkeys.nix @@ -0,0 +1,269 @@ +{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/modules/home/sway/rules/default.nix b/home/sway/rules.nix similarity index 62% rename from modules/home/sway/rules/default.nix rename to home/sway/rules.nix index ff080f6d..992619af 100644 --- a/modules/home/sway/rules/default.nix +++ b/home/sway/rules.nix @@ -1,33 +1,33 @@ -{ config, ... }: -{ +{config, pkgs, outputs, ...}: { + # Enable Sway and write some scripts wayland.windowManager.sway = { config = { - # Assign workspaces to config + # Assign workspaces to outputs workspaceOutputAssign = let workspaces1 = [ - "${config.ws.w0}" - "${config.ws.w1}" - "${config.ws.w2}" - "${config.ws.w3}" - "${config.ws.w1a}" - "${config.ws.w2a}" - "${config.ws.w3a}" + "${outputs.ws.w0}" + "${outputs.ws.w1}" + "${outputs.ws.w2}" + "${outputs.ws.w3}" + "${outputs.ws.w1a}" + "${outputs.ws.w2a}" + "${outputs.ws.w3a}" ]; workspaces2 = [ - "${config.ws.w4}" - "${config.ws.w5}" - "${config.ws.w6}" - "${config.ws.w4a}" - "${config.ws.w5a}" - "${config.ws.w6a}" + "${outputs.ws.w4}" + "${outputs.ws.w5}" + "${outputs.ws.w6}" + "${outputs.ws.w4a}" + "${outputs.ws.w5a}" + "${outputs.ws.w6a}" ]; workspaces3 = [ - "${config.ws.w7}" - "${config.ws.w8}" - "${config.ws.w9}" - "${config.ws.w7a}" - "${config.ws.w8a}" - "${config.ws.w9a}" + "${outputs.ws.w7}" + "${outputs.ws.w8}" + "${outputs.ws.w9}" + "${outputs.ws.w7a}" + "${outputs.ws.w8a}" + "${outputs.ws.w9a}" ]; assign = output: workspaces: map (workspace: { @@ -36,13 +36,13 @@ }) workspaces; in - (assign "${config.displays.d1}" workspaces1) ++ - (assign "${config.displays.d2}" workspaces2) ++ - (assign "${config.displays.d3}" workspaces3); + (assign "${outputs.displays.d1}" workspaces1) ++ + (assign "${outputs.displays.d2}" workspaces2) ++ + (assign "${outputs.displays.d3}" workspaces3); # Rules window = { - border = config.look.border.int; + border = outputs.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 ${config.look.border.string}''; + command = ''border pixel ${outputs.look.border.string}''; } { criteria = {app_id = "com.github.wwmm.easyeffects";}; @@ -111,20 +111,20 @@ ]; }; assigns = { - # Broconfig.wsers - "${config.ws.w1}" = [{app_id = "JimBrowser";}]; - "${config.ws.w1a}" = [{app_id = "AltBrowser";}]; + # Brooutputs.wsers + "${outputs.ws.w1}" = [{app_id = "JimBrooutputs.wser";}]; + "${outputs.ws.w1a}" = [{app_id = "AltBrooutputs.wser";}]; # Communication - "${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";}]; + "${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";}]; # Else - "${config.ws.w2}" = [{class = "steam";} {app_id = "heroic";}]; - "${config.ws.w2a}" = [{app_id = "looking-glass-client";}]; - "${config.ws.w4a}" = [{app_id = "com.obsproject.Studio";}]; + "${outputs.ws.w2}" = [{class = "steam";} {app_id = "heroic";}]; + "${outputs.ws.w2a}" = [{app_id = "looking-glass-client";}]; + "${outputs.ws.w4a}" = [{app_id = "com.obsproject.Studio";}]; }; focus.newWindow = "focus"; }; diff --git a/modules/home/sway/default.nix b/home/sway/sway.nix similarity index 59% rename from modules/home/sway/default.nix rename to home/sway/sway.nix index 80f8412c..5d8d7168 100644 --- a/modules/home/sway/default.nix +++ b/home/sway/sway.nix @@ -1,24 +1,25 @@ -{ config, pkgs, ... }: -{ +{config, pkgs, outputs, ...}: { + # Import modules imports = [ - ./hardware - ./theme - ./hotkeys - ./programs - ./rules - ./autostart - ./waybar - ./swayshot - ./swaylock + #"./swayfx.nix" + ./hardware.nix + ./theme.nix + ./hotkeys.nix + ./rules.nix + ./autostart.nix + ./waybar.nix + ./swayshot.nix ]; + # Enable Sway and write some scripts wayland.windowManager.sway = { enable = true; package = null; wrapperFeatures.gtk = true; checkConfig = false; extraConfig = '' - default_floating_border pixel ${config.look.border.string} + # Options I can't find in Nix yet + default_floating_border pixel ${outputs.look.border.string} hide_edge_borders --i3 smart titlebar_padding 10 1 primary_selection disabled @@ -30,8 +31,8 @@ }} # Switch to workspace 1 - workspace ${config.ws.w7} - workspace ${config.ws.w1} + workspace ${outputs.ws.w7} + workspace ${outputs.ws.w1} ''; }; } diff --git a/home/sway/swayfx.nix b/home/sway/swayfx.nix new file mode 100644 index 00000000..53904905 --- /dev/null +++ b/home/sway/swayfx.nix @@ -0,0 +1,14 @@ +{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/modules/home/sway/swaylock/default.nix b/home/sway/swaylock.nix similarity index 84% rename from modules/home/sway/swaylock/default.nix rename to home/sway/swaylock.nix index d89cbb20..8a8fb35c 100644 --- a/modules/home/sway/swaylock/default.nix +++ b/home/sway/swaylock.nix @@ -1,14 +1,13 @@ -{ pkgs, config, ... }: -let +{config, pkgs, outputs, ...}: let swayLock = pkgs.writeScriptBin "swaylock" '' # Set the lock script lockscript() { BLANK='#00000000' CLEAR='#FFFFFF22' - DEFAULT='#${config.look.colors.prime}FF' + DEFAULT='#${outputs.look.colors.prime}FF' TEXT='#FFFFFFFF' - WRONG='#${config.look.colors.split}FF' - VERIFYING='#${config.look.colors.accent}FF' + WRONG='#${outputs.look.colors.split}FF' + VERIFYING='#${outputs.look.colors.accent}FF' ${pkgs.swaylock-effects}/bin/swaylock -f -e \ --key-hl-color=$VERIFYING \ @@ -33,9 +32,9 @@ let \ --indicator \ --indicator-radius=80 \ - --image=~/.assets/lockscreen/lock.png \ + --image=~/.wallpapers/lock.png \ --clock \ - --font=${config.look.fonts.main} \ + --font=${outputs.look.fonts.main} \ --font-size=30 \ --timestr="%I:%M%p" \ --datestr="%a %b %d %Y" diff --git a/modules/home/sway/swayshot/default.nix b/home/sway/swayshot.nix similarity index 89% rename from modules/home/sway/swayshot/default.nix rename to home/sway/swayshot.nix index 0c808638..4d01872f 100644 --- a/modules/home/sway/swayshot/default.nix +++ b/home/sway/swayshot.nix @@ -1,10 +1,6 @@ -{ pkgs, config, ... }: -{ - imports = [ - ./swappy - ]; - +{pkgs, outputs, ...}: { home.packages = let + # Use grim and slurp to take screenshots in multiple ways swayShot = pkgs.writeScriptBin "swayshot" '' # Swappy handle_swappy() { @@ -13,7 +9,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 ${config.look.border.string} -c ${config.look.colors.prime} -B 00000066 -b 00000099) + | XCURSOR_SIZE=40 slurp -w ${outputs.look.border.string} -c ${outputs.look.colors.prime} -B 00000066 -b 00000099) temp_file=$(mktemp -u).png grim -g "$selected_area" "$temp_file" diff --git a/home/sway/theme.nix b/home/sway/theme.nix new file mode 100644 index 00000000..6cf24e48 --- /dev/null +++ b/home/sway/theme.nix @@ -0,0 +1,50 @@ +{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/modules/home/sway/waybar/default.nix b/home/sway/waybar.nix similarity index 94% rename from modules/home/sway/waybar/default.nix rename to home/sway/waybar.nix index c3e06294..f4d2bd4b 100644 --- a/modules/home/sway/waybar/default.nix +++ b/home/sway/waybar.nix @@ -1,5 +1,4 @@ -{ pkgs, config, ... }: -{ +{pkgs, outputs, ...}: { programs.waybar = let swayWorkspacesModule = { format = "{name}"; @@ -27,7 +26,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%"; @@ -262,7 +261,7 @@ name = "bar1"; position = "top"; layer = "bottom"; - output = [ config.displays.d1 "VGA-1" ]; + output = [outputs.displays.d1 "VGA-1"]; modules-left = ["sway/workspaces" "sway/window"]; modules-right = [ "pulseaudio" @@ -287,13 +286,13 @@ "sway/scratchpad" = scratchpadModule; "tray" = trayModule; "bluetooth" = bluetoothModule; - "network" = networkModule // { interface = "enp*"; }; + "network" = networkModule // {interface = "enp*";}; }; display2 = { name = "bar2"; position = "top"; layer = "bottom"; - output = [ config.displays.d2 ]; + output = [outputs.displays.d2]; modules-left = ["sway/workspaces" "sway/window"]; modules-right = [ "pulseaudio" @@ -318,7 +317,7 @@ name = "bar3"; position = "top"; layer = "bottom"; - output = [ config.displays.d3 ]; + output = [outputs.displays.d3]; modules-left = ["sway/workspaces" "sway/window"]; modules-right = [ "pulseaudio" @@ -341,8 +340,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" @@ -383,12 +382,12 @@ border: 0; border-radius: 0; min-height: 0; - font-family: ${config.look.fonts.main}, ${config.look.fonts.nerd}; + font-family: ${outputs.look.fonts.main}, ${outputs.look.fonts.nerd}; font-size: 15.5px; - color: #${config.look.colors.text}; + color: #${outputs.look.colors.text}; } #waybar { - background: #${config.look.colors.dark}; + background: #${outputs.look.colors.dark}; } #workspaces { padding: 0 6px 0 0; @@ -413,15 +412,15 @@ min-width: 20px; } #workspaces button.visible { - border-bottom: 3px solid #${config.look.colors.prime}; - background: #${config.look.colors.mid}; + border-bottom: 3px solid #${outputs.look.colors.prime}; + background: #${outputs.look.colors.mid}; } #workspaces button.urgent { - border-bottom: 3px solid #${config.look.colors.urgent}; + border-bottom: 3px solid #${outputs.look.colors.urgent}; } #workspaces button:hover { box-shadow: none; - background: #${config.look.colors.light}; + background: #${outputs.look.colors.light}; } #scratchpad { margin-left: 2px; @@ -457,13 +456,13 @@ color: #888; } #custom-weather { - border-bottom: 3px solid #3823C4; + border-bottom: 3px solid #${outputs.look.colors.prime}; } #custom-weather2 { border-bottom: 3px solid #c75bd3; } #custom-notifs { - border-bottom: 3px solid #3823C4; + border-bottom: 3px solid #${outputs.look.colors.prime}; } #custom-notifs.disabled { color: #888; diff --git a/modules/home/users/jimbo/default.nix b/home/users/jimbo.nix similarity index 96% rename from modules/home/users/jimbo/default.nix rename to home/users/jimbo.nix index 69b73a75..0547df5c 100644 --- a/modules/home/users/jimbo/default.nix +++ b/home/users/jimbo.nix @@ -1,4 +1,3 @@ -{ ... }: { home = { username = "jimbo"; diff --git a/modules/home/programs/terminal/fastfetch/default.nix b/home/utils/fastfetch.nix similarity index 99% rename from modules/home/programs/terminal/fastfetch/default.nix rename to home/utils/fastfetch.nix index d5d55606..44a10136 100644 --- a/modules/home/programs/terminal/fastfetch/default.nix +++ b/home/utils/fastfetch.nix @@ -1,5 +1,4 @@ -{ pkgs, ... }: -{ +{pkgs, ...}: { home = { file = let fastConf = '' diff --git a/home/utils/git.nix b/home/utils/git.nix new file mode 100644 index 00000000..b10c56da --- /dev/null +++ b/home/utils/git.nix @@ -0,0 +1,8 @@ +{pkgs, outputs, ...}: { + programs.git = { + enable = true; + lfs.enable = true; + userName = outputs.secrets.jimUsername; + userEmail = outputs.secrets.jimEmail; + }; +} diff --git a/modules/home/programs/terminal/ncmpcpp/default.nix b/home/utils/ncmpcpp.nix similarity index 51% rename from modules/home/programs/terminal/ncmpcpp/default.nix rename to home/utils/ncmpcpp.nix index 418cb8b7..37019ac1 100644 --- a/modules/home/programs/terminal/ncmpcpp/default.nix +++ b/home/utils/ncmpcpp.nix @@ -1,21 +1,17 @@ -{ pkgs, ... }: -{ +{pkgs, ...}: { + # Enable NCMPCPP 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/modules/home/programs/terminal/neovim/default.nix b/home/utils/neovim.nix similarity index 93% rename from modules/home/programs/terminal/neovim/default.nix rename to home/utils/neovim.nix index 9573332a..e5f924a8 100644 --- a/modules/home/programs/terminal/neovim/default.nix +++ b/home/utils/neovim.nix @@ -1,5 +1,5 @@ -{ config, pkgs, ... }: -{ +{pkgs, outputs, ...}: { + # Install Neovim and plugins 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=#${config.look.colors.mid} ctermbg=238 - hi Pmenu guibg=#${config.look.colors.mid} ctermbg=238 + hi Visual guibg=#${outputs.look.colors.mid} ctermbg=238 + hi Pmenu guibg=#${outputs.look.colors.mid} ctermbg=238 hi EndOfBuffer guibg=none ctermbg=235 hi LineNr guibg=none ctermbg=none lua require'colorizer'.setup() diff --git a/modules/home/programs/terminal/ranger/default.nix b/home/utils/ranger.nix similarity index 77% rename from modules/home/programs/terminal/ranger/default.nix rename to home/utils/ranger.nix index ab41bbe5..338952c9 100644 --- a/modules/home/programs/terminal/ranger/default.nix +++ b/home/utils/ranger.nix @@ -1,5 +1,5 @@ -{ pkgs, ... }: -{ +{pkgs, ...}: { + # Enable Ranger programs.ranger = { enable = true; settings = { @@ -100,34 +100,28 @@ ''; }; - # 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 + # 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 - # 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 - ]; + # 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; }; } diff --git a/modules/home/programs/terminal/tmux/default.nix b/home/utils/tmux.nix similarity index 97% rename from modules/home/programs/terminal/tmux/default.nix rename to home/utils/tmux.nix index 471f6e2d..3ff224a2 100644 --- a/modules/home/programs/terminal/tmux/default.nix +++ b/home/utils/tmux.nix @@ -1,5 +1,5 @@ -{ ... }: { + # Enable tmux programs.tmux = { enable = true; extraConfig = '' diff --git a/modules/home/utils/zsh/default.nix b/home/utils/zsh.nix similarity index 96% rename from modules/home/utils/zsh/default.nix rename to home/utils/zsh.nix index dbef8a8b..0613ca9f 100644 --- a/modules/home/utils/zsh/default.nix +++ b/home/utils/zsh.nix @@ -1,5 +1,4 @@ -{ pkgs, ... }: -{ +{ pkgs, config, ... }: { programs.zsh = { enable = true; autosuggestion.enable = true; @@ -10,12 +9,6 @@ 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"; @@ -23,6 +16,11 @@ 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/hosts/bomberman/home/default.nix b/hosts/bomberman/home/default.nix deleted file mode 100644 index c6c69e71..00000000 --- a/hosts/bomberman/home/default.nix +++ /dev/null @@ -1,19 +0,0 @@ -{ ... }: -{ - 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 deleted file mode 100644 index 7ca55e92..00000000 --- a/hosts/bomberman/id_ed25519.pub +++ /dev/null @@ -1 +0,0 @@ -ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICtxnPjkLdUIi5mVqBHXM9rW+Mmsqx1C1XnpRusVTWhm jimbo@bomberman diff --git a/hosts/bomberman/system/default.nix b/hosts/bomberman/system/default.nix deleted file mode 100644 index fbe62ad3..00000000 --- a/hosts/bomberman/system/default.nix +++ /dev/null @@ -1,28 +0,0 @@ -{ 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 deleted file mode 100644 index d6d255ac..00000000 --- a/hosts/bomberman/system/hardware/default.nix +++ /dev/null @@ -1,61 +0,0 @@ -{ 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 deleted file mode 100644 index c6c69e71..00000000 --- a/hosts/cyberspark/home/default.nix +++ /dev/null @@ -1,19 +0,0 @@ -{ ... }: -{ - 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 deleted file mode 100644 index 1c06662a..00000000 --- a/hosts/cyberspark/id_ed25519.pub +++ /dev/null @@ -1 +0,0 @@ -ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIKC8Uqxb09V3msBgDv6lD/nETMYr/X0OgtpDo8ldcMK diff --git a/hosts/cyberspark/system/default.nix b/hosts/cyberspark/system/default.nix deleted file mode 100644 index 5979d3b6..00000000 --- a/hosts/cyberspark/system/default.nix +++ /dev/null @@ -1,25 +0,0 @@ -{ ... }: -{ - 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 deleted file mode 100644 index 7d60b9e6..00000000 --- a/hosts/cyberspark/system/hardware/default.nix +++ /dev/null @@ -1,130 +0,0 @@ -{ 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 deleted file mode 100644 index 41029b5f..00000000 --- a/hosts/firefly/home/default.nix +++ /dev/null @@ -1,27 +0,0 @@ -{ 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 deleted file mode 100644 index e36a85de..00000000 --- a/hosts/firefly/id_ed25519.pub +++ /dev/null @@ -1 +0,0 @@ -ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIC2lMkUd+BbXITE5LTg94hEzmA6UKsIIbaf5YOjGoLzl diff --git a/hosts/firefly/system/boot/default.nix b/hosts/firefly/system/boot/default.nix deleted file mode 100644 index 45430c90..00000000 --- a/hosts/firefly/system/boot/default.nix +++ /dev/null @@ -1,50 +0,0 @@ -{ 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 deleted file mode 100644 index 6511ff1f..00000000 --- a/hosts/firefly/system/default.nix +++ /dev/null @@ -1,37 +0,0 @@ -{ 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/hosts/lacros/home/default.nix b/hosts/lacros/home/default.nix deleted file mode 100644 index b51a8c87..00000000 --- a/hosts/lacros/home/default.nix +++ /dev/null @@ -1,22 +0,0 @@ -{ 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 deleted file mode 100644 index 84c223ca..00000000 --- a/hosts/lacros/id_ed25519.pub +++ /dev/null @@ -1 +0,0 @@ -ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBk6ALxn+zKrRys6/c1oYSoWJaUUEo3nAM224ElhjJQR jimbo@lacros diff --git a/hosts/lacros/system/boot/default.nix b/hosts/lacros/system/boot/default.nix deleted file mode 100644 index 8b5e01f6..00000000 --- a/hosts/lacros/system/boot/default.nix +++ /dev/null @@ -1,17 +0,0 @@ -{ ... }: -{ - 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 deleted file mode 100644 index 5e8628fc..00000000 --- a/hosts/lacros/system/default.nix +++ /dev/null @@ -1,34 +0,0 @@ -{ 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 deleted file mode 100644 index 4b3b692a..00000000 --- a/hosts/lacros/system/hardware/default.nix +++ /dev/null @@ -1,63 +0,0 @@ -{ 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 deleted file mode 100644 index b8ab842b..00000000 --- a/hosts/redmond/home/default.nix +++ /dev/null @@ -1,24 +0,0 @@ -{ 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 deleted file mode 100644 index 0978bb17..00000000 --- a/hosts/redmond/id_ed25519.pub +++ /dev/null @@ -1 +0,0 @@ -ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIG9uITpyw5WgxT7UnswueFtyWxAqQCZv4h9DfcDkr+kn jimbo@nixos diff --git a/hosts/redmond/system/boot/default.nix b/hosts/redmond/system/boot/default.nix deleted file mode 100644 index 80224164..00000000 --- a/hosts/redmond/system/boot/default.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ 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 deleted file mode 100644 index d1a1cd8a..00000000 --- a/hosts/redmond/system/default.nix +++ /dev/null @@ -1,28 +0,0 @@ -{ 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/hosts/shuttleworth/home/default.nix b/hosts/shuttleworth/home/default.nix deleted file mode 100644 index bb9098cd..00000000 --- a/hosts/shuttleworth/home/default.nix +++ /dev/null @@ -1,28 +0,0 @@ -{ 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 deleted file mode 100644 index 3d0e0ec3..00000000 --- a/hosts/shuttleworth/id_ed25519.pub +++ /dev/null @@ -1 +0,0 @@ -ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIK+L723mCLy9/9UAXwkY3+06Oq22dOj+lDnA0lMLbrsR diff --git a/hosts/shuttleworth/system/boot/default.nix b/hosts/shuttleworth/system/boot/default.nix deleted file mode 100644 index 80224164..00000000 --- a/hosts/shuttleworth/system/boot/default.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ 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 deleted file mode 100644 index 06ca1a71..00000000 --- a/hosts/shuttleworth/system/default.nix +++ /dev/null @@ -1,32 +0,0 @@ -{ 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/modules/home/default.nix b/modules/home/default.nix deleted file mode 100644 index 1feed841..00000000 --- a/modules/home/default.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ ... }: -{ - programs.home-manager.enable = true; - nixpkgs.config.allowUnfree = true; - home.stateVersion = "24.05"; -} diff --git a/modules/home/files/assets/wallpapers/dogmatica/1.png b/modules/home/files/assets/wallpapers/dogmatica/1.png deleted file mode 100644 index 40f21e79..00000000 Binary files a/modules/home/files/assets/wallpapers/dogmatica/1.png and /dev/null differ diff --git a/modules/home/files/assets/wallpapers/dogmatica/2.png b/modules/home/files/assets/wallpapers/dogmatica/2.png deleted file mode 100644 index 42d7de1e..00000000 Binary files a/modules/home/files/assets/wallpapers/dogmatica/2.png and /dev/null differ diff --git a/modules/home/files/assets/wallpapers/dogmatica/3.png b/modules/home/files/assets/wallpapers/dogmatica/3.png deleted file mode 100644 index 029ec5fb..00000000 Binary files a/modules/home/files/assets/wallpapers/dogmatica/3.png and /dev/null differ diff --git a/modules/home/files/assets/wallpapers/hillorange/1.png b/modules/home/files/assets/wallpapers/hillorange/1.png deleted file mode 100644 index 0ed3607a..00000000 Binary files a/modules/home/files/assets/wallpapers/hillorange/1.png and /dev/null differ diff --git a/modules/home/files/assets/wallpapers/hillorange/2.png b/modules/home/files/assets/wallpapers/hillorange/2.png deleted file mode 100644 index 5dfc477b..00000000 Binary files a/modules/home/files/assets/wallpapers/hillorange/2.png and /dev/null differ diff --git a/modules/home/files/assets/wallpapers/hillorange/3.png b/modules/home/files/assets/wallpapers/hillorange/3.png deleted file mode 100644 index 85dbbea7..00000000 Binary files a/modules/home/files/assets/wallpapers/hillorange/3.png and /dev/null differ diff --git a/modules/home/files/assets/wallpapers/leaves/1.png b/modules/home/files/assets/wallpapers/leaves/1.png deleted file mode 100644 index 8ec765b9..00000000 Binary files a/modules/home/files/assets/wallpapers/leaves/1.png and /dev/null differ diff --git a/modules/home/files/assets/wallpapers/leaves/2.png b/modules/home/files/assets/wallpapers/leaves/2.png deleted file mode 100644 index 69a45680..00000000 Binary files a/modules/home/files/assets/wallpapers/leaves/2.png and /dev/null differ diff --git a/modules/home/files/assets/wallpapers/leaves/3.png b/modules/home/files/assets/wallpapers/leaves/3.png deleted file mode 100644 index 3312d139..00000000 Binary files a/modules/home/files/assets/wallpapers/leaves/3.png and /dev/null differ diff --git a/modules/home/files/default.nix b/modules/home/files/default.nix deleted file mode 100644 index e640b39b..00000000 --- a/modules/home/files/default.nix +++ /dev/null @@ -1,22 +0,0 @@ -{ 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 deleted file mode 100644 index 023aaf79..00000000 --- a/modules/home/programs/default.nix +++ /dev/null @@ -1,8 +0,0 @@ -{ ... }: -{ - imports = [ - ./gui - ./terminal - ./misc - ]; -} diff --git a/modules/home/programs/gui/default.nix b/modules/home/programs/gui/default.nix deleted file mode 100644 index fefac514..00000000 --- a/modules/home/programs/gui/default.nix +++ /dev/null @@ -1,13 +0,0 @@ -{ ... }: -{ - 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 deleted file mode 100644 index 1a075ae1..00000000 --- a/modules/home/programs/gui/easyeffects/JimHeadphones.json +++ /dev/null @@ -1,294 +0,0 @@ -{ - "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 deleted file mode 100644 index 817b42d2..00000000 --- a/modules/home/programs/gui/easyeffects/default.nix +++ /dev/null @@ -1,11 +0,0 @@ -{ pkgs, ... }: -{ - home = { - packages = with pkgs; [ - easyeffects - ]; - file = { - ".config/easyeffects/output/JimHeadphones.json".source = ./JimHeadphones.json; - }; - }; -} diff --git a/modules/home/programs/misc/chat/default.nix b/modules/home/programs/misc/chat/default.nix deleted file mode 100644 index aea297b6..00000000 --- a/modules/home/programs/misc/chat/default.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ 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 deleted file mode 100644 index 52a332da..00000000 --- a/modules/home/programs/misc/default.nix +++ /dev/null @@ -1,9 +0,0 @@ -{ ... }: -{ - imports = [ - ./avtools - ./chat - ./general - ./headless - ]; -} diff --git a/modules/home/programs/misc/gaming/default.nix b/modules/home/programs/misc/gaming/default.nix deleted file mode 100644 index 9e9eaae1..00000000 --- a/modules/home/programs/misc/gaming/default.nix +++ /dev/null @@ -1,8 +0,0 @@ -{ ... }: -{ - imports = [ - ./launchers - ./emulators - ./xash3d - ]; -} diff --git a/modules/home/programs/misc/headless/default.nix b/modules/home/programs/misc/headless/default.nix deleted file mode 100644 index 9bc4853e..00000000 --- a/modules/home/programs/misc/headless/default.nix +++ /dev/null @@ -1,13 +0,0 @@ -{ 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 deleted file mode 100644 index 6f881db5..00000000 --- a/modules/home/programs/misc/production/default.nix +++ /dev/null @@ -1,16 +0,0 @@ -{ 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/modules/home/programs/terminal/default.nix b/modules/home/programs/terminal/default.nix deleted file mode 100644 index 4c16f71c..00000000 --- a/modules/home/programs/terminal/default.nix +++ /dev/null @@ -1,11 +0,0 @@ -{ ... }: -{ - imports = [ - ./fastfetch - ./git - ./ncmpcpp - ./neovim - ./ranger - ./tmux - ]; -} diff --git a/modules/home/programs/terminal/git/default.nix b/modules/home/programs/terminal/git/default.nix deleted file mode 100644 index 20638f09..00000000 --- a/modules/home/programs/terminal/git/default.nix +++ /dev/null @@ -1,8 +0,0 @@ -{ config, ... }: -{ - programs.git = { - enable = true; - userName = "Jimbo"; - userEmail = "jimbo@${config.domains.jim2}"; - }; -} diff --git a/modules/home/settings/dconf/default.nix b/modules/home/settings/dconf/default.nix deleted file mode 100644 index 54ad39da..00000000 --- a/modules/home/settings/dconf/default.nix +++ /dev/null @@ -1,12 +0,0 @@ -{ ... }: -{ - 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 deleted file mode 100644 index 23945be7..00000000 --- a/modules/home/settings/default.nix +++ /dev/null @@ -1,9 +0,0 @@ -{ ... }: -{ - imports = [ - ./dconf - ./fonts - ./gtk - ./xdg - ]; -} diff --git a/modules/home/settings/xdg/default.nix b/modules/home/settings/xdg/default.nix deleted file mode 100644 index 19869b7f..00000000 --- a/modules/home/settings/xdg/default.nix +++ /dev/null @@ -1,11 +0,0 @@ -{ ... }: -{ - 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/modules/home/sway/hotkeys/default.nix b/modules/home/sway/hotkeys/default.nix deleted file mode 100644 index 5ed34cdc..00000000 --- a/modules/home/sway/hotkeys/default.nix +++ /dev/null @@ -1,228 +0,0 @@ -{ 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 deleted file mode 100644 index 9e0d6e63..00000000 --- a/modules/home/sway/programs/default.nix +++ /dev/null @@ -1,14 +0,0 @@ -{ pkgs, ... }: -{ - home.packages = with pkgs; [ - wl-clipboard - wdisplays - clipman - libnotify - grim - slurp - swappy - jq - lm_sensors - ]; -} diff --git a/modules/home/sway/swayshot/swappy/default.nix b/modules/home/sway/swayshot/swappy/default.nix deleted file mode 100644 index 3e82852b..00000000 --- a/modules/home/sway/swayshot/swappy/default.nix +++ /dev/null @@ -1,15 +0,0 @@ -{ 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 deleted file mode 100644 index 403497c7..00000000 --- a/modules/home/sway/theme/default.nix +++ /dev/null @@ -1,48 +0,0 @@ -{ 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/modules/home/users/default.nix b/modules/home/users/default.nix deleted file mode 100644 index 4f6dbf4c..00000000 --- a/modules/home/users/default.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ ... }: -{ - imports = [ - ./jimbo - ]; -} diff --git a/modules/home/utils/default.nix b/modules/home/utils/default.nix deleted file mode 100644 index 2bbeeda8..00000000 --- a/modules/home/utils/default.nix +++ /dev/null @@ -1,8 +0,0 @@ -{ ... }: -{ - imports = [ - ./gnome-keyring - ./udiskie - ./zsh - ]; -} diff --git a/modules/home/utils/gnome-keyring/default.nix b/modules/home/utils/gnome-keyring/default.nix deleted file mode 100644 index 2e1ad40e..00000000 --- a/modules/home/utils/gnome-keyring/default.nix +++ /dev/null @@ -1,4 +0,0 @@ -{ ... }: -{ - services.gnome-keyring.enable = true; -} diff --git a/modules/system/accounts/default.nix b/modules/system/accounts/default.nix deleted file mode 100644 index 5c525ddb..00000000 --- a/modules/system/accounts/default.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ ... }: { - imports = [ - ./users - ./groups - ]; -} diff --git a/modules/system/accounts/groups/default.nix b/modules/system/accounts/groups/default.nix deleted file mode 100644 index 29a1695d..00000000 --- a/modules/system/accounts/groups/default.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ ... }: -{ - imports = [ - ./nfsShare - ]; -} diff --git a/modules/system/accounts/groups/nfsShare/default.nix b/modules/system/accounts/groups/nfsShare/default.nix deleted file mode 100644 index 81ca4456..00000000 --- a/modules/system/accounts/groups/nfsShare/default.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ ... }: -{ - users.groups.nfsShare = { - gid = 983; - }; -} diff --git a/modules/system/accounts/users/default.nix b/modules/system/accounts/users/default.nix deleted file mode 100644 index f37ca733..00000000 --- a/modules/system/accounts/users/default.nix +++ /dev/null @@ -1,9 +0,0 @@ -{ ... }: -{ - imports = [ - ./jimbo - ./liquidsoap - ./nextcloud - ./nginx - ]; -} diff --git a/modules/system/accounts/users/jimbo/default.nix b/modules/system/accounts/users/jimbo/default.nix deleted file mode 100644 index 967ab0e0..00000000 --- a/modules/system/accounts/users/jimbo/default.nix +++ /dev/null @@ -1,39 +0,0 @@ -{ 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 deleted file mode 100644 index f83e9cc3..00000000 --- a/modules/system/accounts/users/liquidsoap/default.nix +++ /dev/null @@ -1,12 +0,0 @@ -{ ... }: -{ - 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 deleted file mode 100644 index 73aba8bd..00000000 --- a/modules/system/accounts/users/nextcloud/default.nix +++ /dev/null @@ -1,12 +0,0 @@ -{ ... }: -{ - 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 deleted file mode 100644 index 4330f100..00000000 --- a/modules/system/accounts/users/nginx/default.nix +++ /dev/null @@ -1,12 +0,0 @@ -{ ... }: -{ - 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 deleted file mode 100644 index 8820ac92..00000000 --- a/modules/system/default.nix +++ /dev/null @@ -1,37 +0,0 @@ -{ 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 deleted file mode 100644 index e413a8c8..00000000 --- a/modules/system/desktop/default.nix +++ /dev/null @@ -1,8 +0,0 @@ -{ ... }: -{ - imports = [ - ./qt - ./wayland - ./sway - ]; -} diff --git a/modules/system/desktop/wayland/default.nix b/modules/system/desktop/wayland/default.nix deleted file mode 100644 index 7b446aee..00000000 --- a/modules/system/desktop/wayland/default.nix +++ /dev/null @@ -1,13 +0,0 @@ -{ pkgs, ... }: -{ - programs = { - dconf.enable = true; - light.enable = true; - xwayland.enable = true; - }; - - services = { - dbus.enable = true; - tlp.enable = true; - }; -} diff --git a/modules/system/devices/boot/lanzaboote/default.nix b/modules/system/devices/boot/lanzaboote/default.nix deleted file mode 100644 index dbe8e403..00000000 --- a/modules/system/devices/boot/lanzaboote/default.nix +++ /dev/null @@ -1,15 +0,0 @@ -{ lanzaboote, pkgs, ... }: -{ - imports = [ - lanzaboote.nixosModules.lanzaboote - ]; - - boot.lanzaboote = { - enable = true; - pkiBundle = "/etc/secureboot"; - }; - - environment.systemPackages = with pkgs; [ - sbctl - ]; -} diff --git a/modules/system/devices/default.nix b/modules/system/devices/default.nix deleted file mode 100644 index 64ae8098..00000000 --- a/modules/system/devices/default.nix +++ /dev/null @@ -1,12 +0,0 @@ -{ ... }: -{ - imports = [ - ./bluetooth - ./filesystems - ./networking - ./pipewire - ./printing - ./udev - ./video - ]; -} diff --git a/modules/system/devices/networking/firewall/pc/default.nix b/modules/system/devices/networking/firewall/pc/default.nix deleted file mode 100644 index 156c2d65..00000000 --- a/modules/system/devices/networking/firewall/pc/default.nix +++ /dev/null @@ -1,9 +0,0 @@ -{ 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 deleted file mode 100644 index 8c0a376d..00000000 --- a/modules/system/devices/networking/firewall/server/default.nix +++ /dev/null @@ -1,50 +0,0 @@ -{ 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 deleted file mode 100644 index 5a4e5310..00000000 --- a/modules/system/devices/networking/wireguard/pc/default.nix +++ /dev/null @@ -1,22 +0,0 @@ -{ 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 deleted file mode 100644 index 89ac7462..00000000 --- a/modules/system/devices/networking/wireguard/server/default.nix +++ /dev/null @@ -1,32 +0,0 @@ -{ 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 deleted file mode 100644 index 73f6087b..00000000 --- a/modules/system/devices/networking/wireless/default.nix +++ /dev/null @@ -1,11 +0,0 @@ -{ pkgs, ... }: -{ - networking = { - wireless.iwd.enable = true; - enableB43Firmware = true; - }; - - environment.systemPackages = with pkgs; [ - unstable.impala - ]; -} diff --git a/modules/system/devices/udev/default.nix b/modules/system/devices/udev/default.nix deleted file mode 100644 index 3c5941a9..00000000 --- a/modules/system/devices/udev/default.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ ... }: -{ - imports = [ - ./pdp - ./oculus - ]; -} diff --git a/modules/system/devices/udev/oculus/default.nix b/modules/system/devices/udev/oculus/default.nix deleted file mode 100644 index db869029..00000000 --- a/modules/system/devices/udev/oculus/default.nix +++ /dev/null @@ -1,14 +0,0 @@ -{ 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 deleted file mode 100644 index 652309f2..00000000 --- a/modules/system/devices/udev/pdp/default.nix +++ /dev/null @@ -1,14 +0,0 @@ -{ 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/modules/system/devices/video/nouveau/default.nix b/modules/system/devices/video/nouveau/default.nix deleted file mode 100644 index 41aeb2ca..00000000 --- a/modules/system/devices/video/nouveau/default.nix +++ /dev/null @@ -1,4 +0,0 @@ -{ config, lib, ... }: -{ - services.xserver.videoDrivers = [ "nouveau" ]; -} diff --git a/modules/system/devices/video/nvidia/default.nix b/modules/system/devices/video/nvidia/default.nix deleted file mode 100644 index 03ceb165..00000000 --- a/modules/system/devices/video/nvidia/default.nix +++ /dev/null @@ -1,10 +0,0 @@ -{ 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 deleted file mode 100644 index a890a255..00000000 --- a/modules/system/programs/appimage/default.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ ... }: -{ - programs.appimage = { - enable = true; - binfmt = true; - }; -} diff --git a/modules/system/programs/default.nix b/modules/system/programs/default.nix deleted file mode 100644 index cbc336a4..00000000 --- a/modules/system/programs/default.nix +++ /dev/null @@ -1,9 +0,0 @@ -{ ... }: -{ - imports = [ - ./appimage - ./gaming - ./git - ./security - ]; -} diff --git a/modules/system/programs/git/default.nix b/modules/system/programs/git/default.nix deleted file mode 100644 index 42a3d3c1..00000000 --- a/modules/system/programs/git/default.nix +++ /dev/null @@ -1,11 +0,0 @@ -{ ... }: -{ - imports = [ - ./gpg - ]; - - programs.git = { - enable = true; - lfs.enable = true; - }; -} diff --git a/modules/system/programs/security/apparmor/default.nix b/modules/system/programs/security/apparmor/default.nix deleted file mode 100644 index d2475784..00000000 --- a/modules/system/programs/security/apparmor/default.nix +++ /dev/null @@ -1,4 +0,0 @@ -{ ... }: -{ - security.apparmor.enable = true; -} diff --git a/modules/system/programs/security/default.nix b/modules/system/programs/security/default.nix deleted file mode 100644 index d9e18715..00000000 --- a/modules/system/programs/security/default.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ ... }: -{ - imports = [ - ./apparmor - ./doas - ]; -} diff --git a/modules/system/services/common/default.nix b/modules/system/services/common/default.nix deleted file mode 100644 index 837aa1ed..00000000 --- a/modules/system/services/common/default.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ ... }: -{ - imports = [ - ./ssh - ]; -} diff --git a/modules/system/services/common/ssh/default.nix b/modules/system/services/common/ssh/default.nix deleted file mode 100644 index 03b5dc31..00000000 --- a/modules/system/services/common/ssh/default.nix +++ /dev/null @@ -1,16 +0,0 @@ -{ ... }: -{ - 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 deleted file mode 100644 index 48e494fd..00000000 --- a/modules/system/services/common/ssh/fail2ban/default.nix +++ /dev/null @@ -1,8 +0,0 @@ -{ ... }: -{ - services.fail2ban = { - enable = true; - maxretry = 5; - bantime = "5m"; - }; -} diff --git a/modules/system/services/default.nix b/modules/system/services/default.nix deleted file mode 100644 index 4c94199b..00000000 --- a/modules/system/services/default.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ ... }: -{ - imports = [ - ./common - ./pc - ]; -} diff --git a/modules/system/services/pc/default.nix b/modules/system/services/pc/default.nix deleted file mode 100644 index 8eb00444..00000000 --- a/modules/system/services/pc/default.nix +++ /dev/null @@ -1,11 +0,0 @@ -{ ... }: -{ - 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 deleted file mode 100644 index 9052a1d8..00000000 --- a/modules/system/services/pc/fwupd/default.nix +++ /dev/null @@ -1,8 +0,0 @@ -{ pkgs, ... }: -{ - services.fwupd.enable = true; - - environment.systemPackages = with pkgs; [ - fwupd - ]; -} diff --git a/modules/system/services/pc/keyd/default.nix b/modules/system/services/pc/keyd/default.nix deleted file mode 100644 index 2af12884..00000000 --- a/modules/system/services/pc/keyd/default.nix +++ /dev/null @@ -1,28 +0,0 @@ -{ ... }: -{ - 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/modules/system/services/pc/networkfs/default.nix b/modules/system/services/pc/networkfs/default.nix deleted file mode 100644 index 1681237f..00000000 --- a/modules/system/services/pc/networkfs/default.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ ... }: -{ - 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 deleted file mode 100644 index b8b850ee..00000000 --- a/modules/system/services/pc/polkit/default.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ ... }: -{ - 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 deleted file mode 100644 index e5756bd5..00000000 --- a/modules/system/services/pc/school/default.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ ... }: -{ - imports = [ - ./globalprotect - ]; -} diff --git a/modules/system/services/pc/school/globalprotect/default.nix b/modules/system/services/pc/school/globalprotect/default.nix deleted file mode 100644 index a124cad8..00000000 --- a/modules/system/services/pc/school/globalprotect/default.nix +++ /dev/null @@ -1,4 +0,0 @@ -{ ... }: -{ - services.globalprotect.enable = true; -} diff --git a/modules/system/services/server/acme/default.nix b/modules/system/services/server/acme/default.nix deleted file mode 100644 index ab2c23c1..00000000 --- a/modules/system/services/server/acme/default.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ 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 deleted file mode 100644 index ab66c912..00000000 --- a/modules/system/services/server/ddclient/default.nix +++ /dev/null @@ -1,23 +0,0 @@ -{ 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 deleted file mode 100644 index c5b5f710..00000000 --- a/modules/system/services/server/default.nix +++ /dev/null @@ -1,17 +0,0 @@ -{ ... }: -{ - 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 deleted file mode 100644 index 5db3fb2c..00000000 --- a/modules/system/services/server/fileserver/default.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ ... }: -{ - imports = [ - ./local - ./public - ]; -} diff --git a/modules/system/services/server/fileserver/local/default.nix b/modules/system/services/server/fileserver/local/default.nix deleted file mode 100644 index c10f4f66..00000000 --- a/modules/system/services/server/fileserver/local/default.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ ... }: -{ - 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 deleted file mode 100644 index ce8f7214..00000000 --- a/modules/system/services/server/fileserver/local/nfs/default.nix +++ /dev/null @@ -1,17 +0,0 @@ -{ ... }: -{ - 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/modules/system/services/server/fileserver/public/default.nix b/modules/system/services/server/fileserver/public/default.nix deleted file mode 100644 index 252fe217..00000000 --- a/modules/system/services/server/fileserver/public/default.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ ... }: -{ - imports = [ - ./nextcloud - ./photoprism - ]; -} diff --git a/modules/system/services/server/forgejo/default.nix b/modules/system/services/server/forgejo/default.nix deleted file mode 100644 index e03ca36a..00000000 --- a/modules/system/services/server/forgejo/default.nix +++ /dev/null @@ -1,39 +0,0 @@ -{ 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 deleted file mode 100644 index 23354d71..00000000 --- a/modules/system/services/server/forgejo/nginx/default.nix +++ /dev/null @@ -1,11 +0,0 @@ -{ 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/modules/system/services/server/icecast/nginx/default.nix b/modules/system/services/server/icecast/nginx/default.nix deleted file mode 100644 index ba97eab3..00000000 --- a/modules/system/services/server/icecast/nginx/default.nix +++ /dev/null @@ -1,14 +0,0 @@ -{ 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 deleted file mode 100644 index 0c37f912..00000000 --- a/modules/system/services/server/mailserver/default.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ ... }: -{ - imports = [ - ./simplenix - ./roundcube - ]; -} diff --git a/modules/system/services/server/mailserver/roundcube/default.nix b/modules/system/services/server/mailserver/roundcube/default.nix deleted file mode 100644 index e986536d..00000000 --- a/modules/system/services/server/mailserver/roundcube/default.nix +++ /dev/null @@ -1,12 +0,0 @@ -{ 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 deleted file mode 100644 index 69c425bf..00000000 --- a/modules/system/services/server/mailserver/simplenix/default.nix +++ /dev/null @@ -1,58 +0,0 @@ -{ 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 deleted file mode 100644 index e0a30d5f..00000000 --- a/modules/system/services/server/mailserver/simplenix/nginx/default.nix +++ /dev/null @@ -1,11 +0,0 @@ -{ 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/modules/system/services/server/minecraft/default.nix b/modules/system/services/server/minecraft/default.nix deleted file mode 100644 index 22ca6900..00000000 --- a/modules/system/services/server/minecraft/default.nix +++ /dev/null @@ -1,19 +0,0 @@ -{ 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/modules/system/services/server/misc/default.nix b/modules/system/services/server/misc/default.nix deleted file mode 100644 index e976caf1..00000000 --- a/modules/system/services/server/misc/default.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ ... }: -{ - services = { - snowflake-proxy.enable = true; - logrotate.checkConfig = false; - }; -} diff --git a/modules/system/services/server/social/default.nix b/modules/system/services/server/social/default.nix deleted file mode 100644 index 7177cce1..00000000 --- a/modules/system/services/server/social/default.nix +++ /dev/null @@ -1,10 +0,0 @@ -{ ... }: -{ - 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 deleted file mode 100644 index 17041653..00000000 --- a/modules/system/services/server/social/lemmy/default.nix +++ /dev/null @@ -1,22 +0,0 @@ -{ 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 deleted file mode 100644 index 60d6c032..00000000 --- a/modules/system/services/server/social/lemmy/nginx/default.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ 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 deleted file mode 100644 index eedc2905..00000000 --- a/modules/system/services/server/social/mastodon/default.nix +++ /dev/null @@ -1,18 +0,0 @@ -{ 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 deleted file mode 100644 index daef3a94..00000000 --- a/modules/system/services/server/social/matrix/default.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ ... }: -{ - 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 deleted file mode 100644 index 30188169..00000000 --- a/modules/system/services/server/social/matrix/element/default.nix +++ /dev/null @@ -1,25 +0,0 @@ -{ 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 deleted file mode 100644 index 4308c4c4..00000000 --- a/modules/system/services/server/social/matrix/element/nginx/default.nix +++ /dev/null @@ -1,8 +0,0 @@ -{ 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 deleted file mode 100644 index 01c19134..00000000 --- a/modules/system/services/server/social/matrix/synapse/coturn/default.nix +++ /dev/null @@ -1,41 +0,0 @@ -{ 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 deleted file mode 100644 index ffb9884b..00000000 --- a/modules/system/services/server/social/matrix/synapse/coturn/nginx/default.nix +++ /dev/null @@ -1,20 +0,0 @@ -{ 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 deleted file mode 100644 index d889c869..00000000 --- a/modules/system/services/server/social/matrix/synapse/default.nix +++ /dev/null @@ -1,71 +0,0 @@ -{ 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 deleted file mode 100644 index 74ebb8db..00000000 --- a/modules/system/services/server/social/matrix/synapse/nginx/default.nix +++ /dev/null @@ -1,14 +0,0 @@ -{ 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 deleted file mode 100644 index bad4f598..00000000 --- a/modules/system/services/server/social/matrix/synapse/slidingsync/default.nix +++ /dev/null @@ -1,13 +0,0 @@ -{ 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 deleted file mode 100644 index 495e8333..00000000 --- a/modules/system/services/server/social/owncast/default.nix +++ /dev/null @@ -1,13 +0,0 @@ -{ ... }: -{ - 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 deleted file mode 100644 index 01b6e59b..00000000 --- a/modules/system/services/server/social/owncast/nginx/default.nix +++ /dev/null @@ -1,11 +0,0 @@ -{ 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 deleted file mode 100644 index 62fdfe69..00000000 --- a/modules/system/services/server/social/pixelfed/default.nix +++ /dev/null @@ -1,32 +0,0 @@ -{ 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 deleted file mode 100644 index b8d7b052..00000000 --- a/modules/system/services/server/transmission/default.nix +++ /dev/null @@ -1,15 +0,0 @@ -{ 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 deleted file mode 100644 index a980c61c..00000000 --- a/modules/system/services/server/transmission/nginx/default.nix +++ /dev/null @@ -1,11 +0,0 @@ -{ 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 deleted file mode 100644 index af70c23e..00000000 --- a/modules/system/services/server/vaultwarden/default.nix +++ /dev/null @@ -1,27 +0,0 @@ -{ 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 deleted file mode 100644 index cec70c55..00000000 --- a/modules/system/services/server/vaultwarden/nginx/default.nix +++ /dev/null @@ -1,11 +0,0 @@ -{ 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 deleted file mode 100644 index a34929f9..00000000 --- a/modules/system/services/server/webhost/default.nix +++ /dev/null @@ -1,8 +0,0 @@ -{ ... }: -{ - imports = [ - ./nginx - ./rtmp - ./virtualhosts - ]; -} diff --git a/modules/system/services/server/webhost/nginx/default.nix b/modules/system/services/server/webhost/nginx/default.nix deleted file mode 100644 index a84c14d8..00000000 --- a/modules/system/services/server/webhost/nginx/default.nix +++ /dev/null @@ -1,14 +0,0 @@ -{ 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 deleted file mode 100644 index 547b327d..00000000 --- a/modules/system/services/server/webhost/rtmp/default.nix +++ /dev/null @@ -1,27 +0,0 @@ -{ 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 deleted file mode 100644 index 33e6bd37..00000000 --- a/modules/system/services/server/webhost/virtualhosts/default.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ ... }: -{ - imports = [ - ./jimDomain - ]; -} diff --git a/modules/system/services/server/webhost/virtualhosts/jimDomain/default.nix b/modules/system/services/server/webhost/virtualhosts/jimDomain/default.nix deleted file mode 100644 index be8e6e52..00000000 --- a/modules/system/services/server/webhost/virtualhosts/jimDomain/default.nix +++ /dev/null @@ -1,39 +0,0 @@ -{ 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 deleted file mode 100644 index 69ca9f82..00000000 --- a/overlays/default.nix +++ /dev/null @@ -1,8 +0,0 @@ -{ pkgs, ... }: -{ - imports = [ - ./unstable - ./packages - ./mpv - ]; -} diff --git a/overlays/mpv/default.nix b/overlays/mpv/default.nix deleted file mode 100644 index a98eb9c5..00000000 --- a/overlays/mpv/default.nix +++ /dev/null @@ -1,14 +0,0 @@ -{ 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 deleted file mode 100644 index a9e3e727..00000000 --- a/overlays/packages/default.nix +++ /dev/null @@ -1,9 +0,0 @@ -{ pkgs, ... }: -{ - nixpkgs.overlays = [ - (final: _prev: { - xash3d = pkgs.callPackage ./xash3d {}; - hlsdk = pkgs.callPackage ./hlsdk {}; - }) - ]; -} diff --git a/overlays/unstable/default.nix b/overlays/unstable/default.nix deleted file mode 100644 index cdd4a8c2..00000000 --- a/overlays/unstable/default.nix +++ /dev/null @@ -1,11 +0,0 @@ -{ unstable, ... }: -{ - nixpkgs.overlays = [ - (final: prev: { - unstable = import unstable { - system = final.system; - config.allowUnfree = true; - }; - }) - ]; -} diff --git a/system/base.nix b/system/base.nix new file mode 100644 index 00000000..3e1ce6ee --- /dev/null +++ b/system/base.nix @@ -0,0 +1,68 @@ +# 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/modules/system/devices/bluetooth/default.nix b/system/desktop/bluetooth.nix similarity index 79% rename from modules/system/devices/bluetooth/default.nix rename to system/desktop/bluetooth.nix index 6b600319..b519c76f 100644 --- a/modules/system/devices/bluetooth/default.nix +++ b/system/desktop/bluetooth.nix @@ -1,5 +1,5 @@ -{ ... }: { + # Enable Bluetooth hardware.bluetooth = { enable = true; settings = { @@ -8,7 +8,7 @@ }; }; - # Lingering helps keep headphones connected + # Enable lingering for Bluetooth systemd.tmpfiles.rules = [ "f /var/lib/systemd/linger/jimbo" ]; diff --git a/system/desktop/firewall.nix b/system/desktop/firewall.nix new file mode 100644 index 00000000..0bb92183 --- /dev/null +++ b/system/desktop/firewall.nix @@ -0,0 +1,12 @@ +{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/modules/system/programs/gaming/default.nix b/system/desktop/gaming.nix similarity index 56% rename from modules/system/programs/gaming/default.nix rename to system/desktop/gaming.nix index 87b879f9..7e9d492f 100644 --- a/modules/system/programs/gaming/default.nix +++ b/system/desktop/gaming.nix @@ -1,9 +1,10 @@ -{ ... }: -{ +{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/desktop/sway/greetd/default.nix b/system/desktop/greetd-sway.nix similarity index 85% rename from modules/system/desktop/sway/greetd/default.nix rename to system/desktop/greetd-sway.nix index d01635ef..11a4bead 100644 --- a/modules/system/desktop/sway/greetd/default.nix +++ b/system/desktop/greetd-sway.nix @@ -1,10 +1,11 @@ -{ 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 @@ -13,9 +14,11 @@ : fi + # Sway/Wayland export XDG_CURRENT_DESKTOP=sway export QT_QPA_PLATFORM="wayland;xcb" + # Start Sway sway --unsupported-gpu ''; in { diff --git a/system/desktop/misc.nix b/system/desktop/misc.nix new file mode 100644 index 00000000..34cc267b --- /dev/null +++ b/system/desktop/misc.nix @@ -0,0 +1,24 @@ +{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/modules/system/devices/pipewire/default.nix b/system/desktop/pipewire.nix similarity index 66% rename from modules/system/devices/pipewire/default.nix rename to system/desktop/pipewire.nix index 2b2a50d5..1a5af4ee 100644 --- a/modules/system/devices/pipewire/default.nix +++ b/system/desktop/pipewire.nix @@ -1,16 +1,16 @@ -{ pkgs, ... }: -{ +{pkgs, ...}: { + # Enable Pipewire 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/modules/system/devices/printing/default.nix b/system/desktop/printing.nix similarity index 81% rename from modules/system/devices/printing/default.nix rename to system/desktop/printing.nix index 5c509dab..842609a0 100644 --- a/modules/system/devices/printing/default.nix +++ b/system/desktop/printing.nix @@ -1,5 +1,5 @@ -{ pkgs, ... }: -{ +{pkgs, ...}: { + # Enable printing services = { printing = { enable = true; @@ -13,6 +13,7 @@ }; }; + # Install programs system-wide environment.systemPackages = with pkgs; [ system-config-printer ]; diff --git a/modules/system/desktop/qt/default.nix b/system/desktop/qt.nix similarity index 90% rename from modules/system/desktop/qt/default.nix rename to system/desktop/qt.nix index c52443f8..bf08a3d2 100644 --- a/modules/system/desktop/qt/default.nix +++ b/system/desktop/qt.nix @@ -1,4 +1,3 @@ -{ ... }: { qt = { enable = true; diff --git a/system/desktop/school.nix b/system/desktop/school.nix new file mode 100644 index 00000000..3a0993bf --- /dev/null +++ b/system/desktop/school.nix @@ -0,0 +1,13 @@ +{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/modules/system/desktop/sway/default.nix b/system/desktop/sway.nix similarity index 87% rename from modules/system/desktop/sway/default.nix rename to system/desktop/sway.nix index 5b08f9a9..a9f7f886 100644 --- a/modules/system/desktop/sway/default.nix +++ b/system/desktop/sway.nix @@ -1,7 +1,6 @@ -{ pkgs, ... }: -{ +{pkgs, ...}: { imports = [ - ./greetd + ./wayland.nix ]; programs.sway = { @@ -16,6 +15,7 @@ # Allow swaylock to function security.pam.services.swaylock = {}; + # Enable desktop portals for screengrab xdg.portal = { wlr = { enable = true; diff --git a/system/desktop/wayland.nix b/system/desktop/wayland.nix new file mode 100644 index 00000000..12798ad1 --- /dev/null +++ b/system/desktop/wayland.nix @@ -0,0 +1,25 @@ +{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 new file mode 100644 index 00000000..9a08f57d --- /dev/null +++ b/system/desktop/wireguard.nix @@ -0,0 +1,21 @@ +{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 new file mode 100644 index 00000000..1308fdca --- /dev/null +++ b/system/hosts/JimDesktop/configuration.nix @@ -0,0 +1,50 @@ +{ + 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/hosts/firefly/system/hardware/default.nix b/system/hosts/JimDesktop/hardware-configuration.nix similarity index 55% rename from hosts/firefly/system/hardware/default.nix rename to system/hosts/JimDesktop/hardware-configuration.nix index 038c02ae..7dc5a62a 100644 --- a/hosts/firefly/system/hardware/default.nix +++ b/system/hosts/JimDesktop/hardware-configuration.nix @@ -1,29 +1,72 @@ -{ config, lib, modulesPath, ... }: -{ +{ 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 { 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"; @@ -45,11 +88,6 @@ 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"; @@ -91,57 +129,19 @@ }; # Network mounts - "/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"; + "/home/jimbo/JimboNFS" = { + device = "${outputs.ips.server}:/export/JimboNFS"; 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/system/hosts/JimLenovo/configuration.nix b/system/hosts/JimLenovo/configuration.nix new file mode 100644 index 00000000..4b975b43 --- /dev/null +++ b/system/hosts/JimLenovo/configuration.nix @@ -0,0 +1,44 @@ +{ + 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/hosts/redmond/system/hardware/default.nix b/system/hosts/JimLenovo/hardware-configuration.nix similarity index 55% rename from hosts/redmond/system/hardware/default.nix rename to system/hosts/JimLenovo/hardware-configuration.nix index 4b1d568d..be3a8b47 100644 --- a/hosts/redmond/system/hardware/default.nix +++ b/system/hosts/JimLenovo/hardware-configuration.nix @@ -1,24 +1,32 @@ -{ 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 = [ - "xhci_pci" - "ahci" - "ehci_pci" - "sd_mod" - "sr_mod" - "sdhci_pci" - "rtsx_usb_sdmmc" + "nvme" + "xhci_pci" + "usbhid" + "usb_storage" + "sd_mod" + "sdhci_pci" + ]; + kernelModules = [ + "kvm-amd" ]; }; - kernelModules = [ "kvm-amd" ]; }; + # Mount everything as necessary fileSystems = { "/" = { device = "/dev/disk/by-uuid/c0fe8419-88f9-48a0-8c5b-acd4c11f8037"; @@ -29,14 +37,11 @@ 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/system/hosts/JimPine/configuration.nix b/system/hosts/JimPine/configuration.nix new file mode 100644 index 00000000..c7df43b4 --- /dev/null +++ b/system/hosts/JimPine/configuration.nix @@ -0,0 +1,48 @@ +{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/hosts/shuttleworth/system/hardware/default.nix b/system/hosts/JimPine/hardware-configuration.nix similarity index 76% rename from hosts/shuttleworth/system/hardware/default.nix rename to system/hosts/JimPine/hardware-configuration.nix index 2de1890b..6dcf9420 100644 --- a/hosts/shuttleworth/system/hardware/default.nix +++ b/system/hosts/JimPine/hardware-configuration.nix @@ -1,4 +1,5 @@ -{ config, lib, pkgs, modulesPath, ... }: +{ config, outputs, lib, pkgs, modulesPath, ... }: + { imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; @@ -27,7 +28,12 @@ fsType = "btrfs"; }; "/home/jimbo/JimboNFS" = { - device = "${config.ips.wgSpan}.1:/export/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"; fsType = "nfs4"; options = ["x-systemd.automount" "_netdev" "nofail" "noauto"]; }; diff --git a/system/hosts/JimServer/configuration.nix b/system/hosts/JimServer/configuration.nix new file mode 100644 index 00000000..29a926ce --- /dev/null +++ b/system/hosts/JimServer/configuration.nix @@ -0,0 +1,63 @@ +{ + 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 new file mode 100644 index 00000000..2c1f5442 --- /dev/null +++ b/system/hosts/JimServer/hardware-configuration.nix @@ -0,0 +1,110 @@ +{ 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/modules/system/devices/boot/extlinux/default.nix b/system/modules/extlinux.nix similarity index 82% rename from modules/system/devices/boot/extlinux/default.nix rename to system/modules/extlinux.nix index f32c3f87..01b0299f 100644 --- a/modules/system/devices/boot/extlinux/default.nix +++ b/system/modules/extlinux.nix @@ -1,5 +1,5 @@ -{ ... }: { + # For ARM machines boot.loader = { generic-extlinux-compatible.enable = true; grub.enable = false; diff --git a/modules/system/devices/filesystems/default.nix b/system/modules/filesystems.nix similarity index 87% rename from modules/system/devices/filesystems/default.nix rename to system/modules/filesystems.nix index 522fb9f6..0777d8c8 100644 --- a/modules/system/devices/filesystems/default.nix +++ b/system/modules/filesystems.nix @@ -1,5 +1,4 @@ -{ lib, ... }: -{ +{lib, ...}: { boot.supportedFilesystems = { ntfs = true; zfs = lib.mkForce false; diff --git a/modules/system/programs/git/gpg/default.nix b/system/modules/gpg.nix similarity index 59% rename from modules/system/programs/git/gpg/default.nix rename to system/modules/gpg.nix index 7fbd7dd4..917bf207 100644 --- a/modules/system/programs/git/gpg/default.nix +++ b/system/modules/gpg.nix @@ -1,10 +1,8 @@ -{ pkgs, ... }: -{ +{pkgs, ...}: { programs.gnupg.agent = { - enable = true; - enableSSHSupport = true; + enable = true; + enableSSHSupport = true; }; - environment.systemPackages = with pkgs; [ git-crypt ]; diff --git a/system/modules/lanzaboote.nix b/system/modules/lanzaboote.nix new file mode 100644 index 00000000..26dcb018 --- /dev/null +++ b/system/modules/lanzaboote.nix @@ -0,0 +1,6 @@ +{ + boot.lanzaboote = { + enable = true; + pkiBundle = "/etc/secureboot"; + }; +} diff --git a/modules/system/devices/networking/default.nix b/system/modules/networking.nix similarity index 68% rename from modules/system/devices/networking/default.nix rename to system/modules/networking.nix index 1abbd400..a5b22f2d 100644 --- a/modules/system/devices/networking/default.nix +++ b/system/modules/networking.nix @@ -1,8 +1,7 @@ -{ ... }: { + # Networking settings networking = { wireless.enable = false; dhcpcd.enable = true; - nftables.enable = true; }; } diff --git a/system/modules/nouveau.nix b/system/modules/nouveau.nix new file mode 100644 index 00000000..bfd95046 --- /dev/null +++ b/system/modules/nouveau.nix @@ -0,0 +1,4 @@ +{pkgs, ...}: { + # Enable video drivers + services.xserver.videoDrivers = ["nouveau"]; +} diff --git a/system/modules/nvidia.nix b/system/modules/nvidia.nix new file mode 100644 index 00000000..7d06fae6 --- /dev/null +++ b/system/modules/nvidia.nix @@ -0,0 +1,10 @@ +{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/modules/system/devices/video/default.nix b/system/modules/opengl.nix similarity index 85% rename from modules/system/devices/video/default.nix rename to system/modules/opengl.nix index 34ef10a7..a68615fe 100644 --- a/modules/system/devices/video/default.nix +++ b/system/modules/opengl.nix @@ -1,5 +1,5 @@ -{ pkgs, ... }: -{ +{pkgs, ...}: { + # Enable OpenGL hardware.opengl = { enable = true; driSupport32Bit = true; diff --git a/modules/system/programs/security/doas/default.nix b/system/modules/security.nix similarity index 83% rename from modules/system/programs/security/doas/default.nix rename to system/modules/security.nix index f182327b..98565be8 100644 --- a/modules/system/programs/security/doas/default.nix +++ b/system/modules/security.nix @@ -1,5 +1,5 @@ -{ ... }: { + # Enable AppArmor security = { sudo.enable = false; doas = { @@ -12,5 +12,6 @@ } ]; }; + apparmor.enable = true; }; } diff --git a/modules/system/devices/boot/systemd/default.nix b/system/modules/systemdboot.nix similarity index 53% rename from modules/system/devices/boot/systemd/default.nix rename to system/modules/systemdboot.nix index a2c9a5db..31fd278e 100644 --- a/modules/system/devices/boot/systemd/default.nix +++ b/system/modules/systemdboot.nix @@ -1,7 +1,7 @@ -{ ... }: { + # For UEFI machines boot.loader.systemd-boot = { enable = true; - editor = false; + netbootxyz.enable = true; }; } diff --git a/system/modules/wireless.nix b/system/modules/wireless.nix new file mode 100644 index 00000000..25f1c77a --- /dev/null +++ b/system/modules/wireless.nix @@ -0,0 +1,7 @@ +{ + # Enable wireless networkmanager + networking = { + networkmanager.enable = true; + enableB43Firmware = true; + }; +} diff --git a/system/server/acme.nix b/system/server/acme.nix new file mode 100644 index 00000000..1f978c7f --- /dev/null +++ b/system/server/acme.nix @@ -0,0 +1,12 @@ +{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 new file mode 100644 index 00000000..7712a89a --- /dev/null +++ b/system/server/archived/adguard.nix @@ -0,0 +1,14 @@ +{ + 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 new file mode 100644 index 00000000..b8f77b10 --- /dev/null +++ b/system/server/archived/gitea.nix @@ -0,0 +1,36 @@ +{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 new file mode 100644 index 00000000..b9ff0df5 --- /dev/null +++ b/system/server/archived/pufferpanel.nix @@ -0,0 +1,31 @@ +{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 new file mode 100644 index 00000000..4c778677 --- /dev/null +++ b/system/server/coturn.nix @@ -0,0 +1,48 @@ +{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 new file mode 100644 index 00000000..35a08c65 --- /dev/null +++ b/system/server/ddclient.nix @@ -0,0 +1,23 @@ +{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 new file mode 100644 index 00000000..3543b836 --- /dev/null +++ b/system/server/element.nix @@ -0,0 +1,28 @@ +{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 new file mode 100644 index 00000000..9ddf789f --- /dev/null +++ b/system/server/firewall.nix @@ -0,0 +1,56 @@ +{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 new file mode 100644 index 00000000..3afb1b79 --- /dev/null +++ b/system/server/forgejo.nix @@ -0,0 +1,43 @@ +# 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/modules/system/services/server/icecast/default.nix b/system/server/icecast.nix similarity index 65% rename from modules/system/services/server/icecast/default.nix rename to system/server/icecast.nix index f2aff00d..c33bac3e 100644 --- a/modules/system/services/server/icecast/default.nix +++ b/system/server/icecast.nix @@ -1,26 +1,23 @@ -{ pkgs, config, ... }: -{ - imports = [ - ./nginx - ]; - +{pkgs, outputs, ...}: { + # Icecast, replacing Azuracast maybe services = { + # The host service icecast = { enable = true; listen.port = 265; - hostname = "icecast.${config.domains.jim1}"; + hostname = "icecast.${outputs.secrets.jimDomain}"; admin = { user = "jimbo"; - password = "${config.secrets.castAdminPass}"; + password = "${outputs.secrets.castAdminPass}"; }; extraConf = '' - ${config.secrets.castSourcePass} + ${outputs.secrets.castSourcePass} - - Canada - jimbo@${config.domains.jim2} - + + Canada + jimbo@jimbosfiles.com + /jimbops.opus JimBops Radio @@ -34,8 +31,9 @@ }; # The audio stream - liquidsoap.streams = { - jimbops = pkgs.writeText "liquidjim" '' + liquidsoap.streams = let + JimBops = '' + # CONFIGURATION settings.log.stdout.set(true) settings.init.allow_root.set(true) settings.scheduler.fast_queues.set(2) @@ -52,7 +50,7 @@ %ffmpeg(format="ogg", %audio(codec="libvorbis", samplerate=48000, b="256k", channels=2)), host="127.0.0.1", port=265, - password="${config.secrets.castSourcePass}", + password="${outputs.secrets.castSourcePass}", public=true, icy_metadata=["artist", "title"], mount="jimbops.opus", @@ -60,6 +58,21 @@ 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/system/server/lemmy.nix b/system/server/lemmy.nix new file mode 100644 index 00000000..09a28291 --- /dev/null +++ b/system/server/lemmy.nix @@ -0,0 +1,25 @@ +{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 new file mode 100644 index 00000000..d6ca3ba8 --- /dev/null +++ b/system/server/mailserver.nix @@ -0,0 +1,68 @@ +{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/modules/system/services/server/mysql/default.nix b/system/server/mariadb.nix similarity index 96% rename from modules/system/services/server/mysql/default.nix rename to system/server/mariadb.nix index 5e999b98..8848e802 100644 --- a/modules/system/services/server/mysql/default.nix +++ b/system/server/mariadb.nix @@ -1,5 +1,4 @@ -{ pkgs, ... }: -{ +{pkgs, ...}: { services.mysql = { enable = true; package = pkgs.mariadb; diff --git a/system/server/mastodon.nix b/system/server/mastodon.nix new file mode 100644 index 00000000..77f0ff3d --- /dev/null +++ b/system/server/mastodon.nix @@ -0,0 +1,17 @@ +{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 new file mode 100644 index 00000000..d201dbb4 --- /dev/null +++ b/system/server/matrix-discord.nix @@ -0,0 +1,16 @@ +{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/modules/system/services/server/minecraft/common/default.nix b/system/server/minecraft/common.nix similarity index 85% rename from modules/system/services/server/minecraft/common/default.nix rename to system/server/minecraft/common.nix index a432b530..b46489bc 100644 --- a/modules/system/services/server/minecraft/common/default.nix +++ b/system/server/minecraft/common.nix @@ -1,5 +1,4 @@ -{ pkgs, ... }: -{ +{pkgs, ...}: { # Common properties serverProperties = { enforce-secure-profile = false; @@ -27,6 +26,10 @@ # 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"; @@ -44,8 +47,8 @@ sha256 = "02ad0dl34vdk6b1wyflqa6wq440xrh5w7yf3z3w1x1g089myddw4"; }; "plugins/ProtocolLib.jar" = builtins.fetchurl { - url = "https://ci.dmulloy2.net/job/ProtocolLib/733/artifact/build/libs/ProtocolLib.jar"; - sha256 = "1gslh24kk7dcqiqxphzy8x2nrqa58f8gl5ah0iyg1ndx3pvr4z9m"; + url = "https://ci.dmulloy2.net/job/ProtocolLib/lastSuccessfulBuild/artifact/build/libs/ProtocolLib.jar"; + sha256 = "16krc7pyav4khnaxkyg27i5yxsgcdkildrn4nm5bhzh1f0ngqv2s"; }; "plugins/Vault.jar" = builtins.fetchurl { url = "https://github.com/MilkBowl/Vault/releases/download/1.7.3/Vault.jar"; diff --git a/system/server/minecraft/default.nix b/system/server/minecraft/default.nix new file mode 100644 index 00000000..f2f4787e --- /dev/null +++ b/system/server/minecraft/default.nix @@ -0,0 +1,17 @@ +{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/modules/system/services/server/minecraft/common/essentialsconfig.yml b/system/server/minecraft/essentialsconfig.yml similarity index 100% rename from modules/system/services/server/minecraft/common/essentialsconfig.yml rename to system/server/minecraft/essentialsconfig.yml diff --git a/modules/system/services/server/minecraft/servers/blockworld/default.nix b/system/server/minecraft/servers/blockworld.nix similarity index 87% rename from modules/system/services/server/minecraft/servers/blockworld/default.nix rename to system/server/minecraft/servers/blockworld.nix index 0aa81827..7f3e96dd 100644 --- a/modules/system/services/server/minecraft/servers/blockworld/default.nix +++ b/system/server/minecraft/servers/blockworld.nix @@ -1,6 +1,5 @@ -{ pkgs, ... }: -let - common = import ../../common { inherit pkgs; }; +{pkgs, ...}: let + common = import ../common.nix { inherit pkgs; }; in { services.minecraft-servers.servers.blockworld = { enable = true; diff --git a/modules/system/services/server/minecraft/servers/dewdemolisher/default.nix b/system/server/minecraft/servers/dewdemolisher.nix similarity index 86% rename from modules/system/services/server/minecraft/servers/dewdemolisher/default.nix rename to system/server/minecraft/servers/dewdemolisher.nix index c1b59e0c..2c975754 100644 --- a/modules/system/services/server/minecraft/servers/dewdemolisher/default.nix +++ b/system/server/minecraft/servers/dewdemolisher.nix @@ -1,6 +1,5 @@ -{ pkgs, ... }: -let - common = import ../../common { inherit pkgs; }; +{pkgs, ...}: let + common = import ../common.nix { inherit pkgs; }; in { services.minecraft-servers.servers.dewdemolisher = { enable = true; diff --git a/modules/system/services/server/minecraft/servers/johnside/default.nix b/system/server/minecraft/servers/johnside.nix similarity index 84% rename from modules/system/services/server/minecraft/servers/johnside/default.nix rename to system/server/minecraft/servers/johnside.nix index 4a26847b..6baea7d7 100644 --- a/modules/system/services/server/minecraft/servers/johnside/default.nix +++ b/system/server/minecraft/servers/johnside.nix @@ -1,6 +1,5 @@ -{ pkgs, config, ... }: -let - common = import ../../common { inherit pkgs; }; +{pkgs, outputs, ...}: let + common = import ../common.nix { inherit pkgs; }; in { services = { minecraft-servers.servers.johnside = { @@ -43,7 +42,7 @@ in { }; # BlueMap webhost - nginx.virtualHosts."john.${config.domains.jim1}" = { + nginx.virtualHosts."john.${outputs.secrets.jimDomain}" = { enableACME = true; forceSSL = true; locations."/" = { @@ -52,4 +51,16 @@ 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/modules/system/services/server/minecraft/servers/roguecraft/default.nix b/system/server/minecraft/servers/roguecraft.nix similarity index 70% rename from modules/system/services/server/minecraft/servers/roguecraft/default.nix rename to system/server/minecraft/servers/roguecraft.nix index a3b5537c..64b66b8e 100644 --- a/modules/system/services/server/minecraft/servers/roguecraft/default.nix +++ b/system/server/minecraft/servers/roguecraft.nix @@ -1,6 +1,5 @@ -{ pkgs, config, ... }: -let - common = import ../../common { inherit pkgs; }; +{pkgs, outputs, ...}: let + common = import ../common.nix { inherit pkgs; }; in { services = { minecraft-servers.servers.roguecraft = { @@ -11,20 +10,20 @@ in { difficulty = 3; server-port = 30014; motd = "\\u00A7l\\u00A7bJimbo's \\u00A7cRoguecraft \\u00A7bserver."; - require-resource-pack = true; - resource-pack = "https://${config.domains.jim1}/roguecraftresourcepackredir"; - resource-pack-sha1 = "b540c0562aba90c3ead2356bb9cb74fcf0db36b3"; + require-resource-pack = true; + resource-pack = "https://${outputs.secrets.jimDomain}/roguecraftresourcepackredir"; + resource-pack-sha1 = "b540c0562aba90c3ead2356bb9cb74fcf0db36b3"; }; whitelist = common.whitelist; symlinks = common.paperSymlinks; files = common.configFiles // { "world/datapacks/roguecraft.zip" = builtins.fetchurl { - url = "https://${config.domains.jim1}/roguecraftdatapackredir"; + url = "https://${outputs.secrets.jimDomain}/roguecraftdatapackredir"; sha256 = "04zrkvzvi1i898al45fh9j3k635sf9qhwca7phbv4ynkfl8bz3q3"; }; }; }; - nginx.virtualHosts."${config.domains.jim1}".locations = { + nginx.virtualHosts."${outputs.secrets.jimDomain}".locations = { "/roguecraftdatapackredir" = { return = "301 https://cdn.modrinth.com/data/HtKjVijx/versions/Rme4c23R/Roguecraft%201.2.6%20-%20Data%20Pack.zip"; }; diff --git a/modules/system/services/server/minecraft/servers/uberbeta/default.nix b/system/server/minecraft/servers/uberbeta.nix similarity index 89% rename from modules/system/services/server/minecraft/servers/uberbeta/default.nix rename to system/server/minecraft/servers/uberbeta.nix index 3bbcbaf6..b9004dd3 100644 --- a/modules/system/services/server/minecraft/servers/uberbeta/default.nix +++ b/system/server/minecraft/servers/uberbeta.nix @@ -1,6 +1,5 @@ -{ pkgs, ... }: -let - common = import ../../common { inherit pkgs; }; +{pkgs, ...}: let + common = import ../common.nix { 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/modules/system/services/server/minecraft/servers/velocity/default.nix b/system/server/minecraft/servers/velocity.nix similarity index 79% rename from modules/system/services/server/minecraft/servers/velocity/default.nix rename to system/server/minecraft/servers/velocity.nix index 48a3ca75..b02b657d 100644 --- a/modules/system/services/server/minecraft/servers/velocity/default.nix +++ b/system/server/minecraft/servers/velocity.nix @@ -1,6 +1,5 @@ -{ pkgs, ... }: -let - common = import ../../common { inherit pkgs; }; +{pkgs, ...}: let + common = import ../common.nix { inherit pkgs; }; in { services.minecraft-servers.servers.velocity = { enable = true; @@ -8,12 +7,12 @@ in { jvmOpts = "-Xmx512M"; symlinks = { "plugins/Geyser.jar" = builtins.fetchurl { - url = "https://download.geysermc.org/v2/projects/geyser/versions/2.4.2/builds/660/downloads/velocity"; - sha256 = "09z938v6xrgbiba8rxgi7cdh3xxkv9fdampy15k6fmwddmj9y4a2"; + url = "https://download.geysermc.org/v2/projects/geyser/versions/2.4.3/builds/688/downloads/velocity"; + sha256 = "0gmsr2pspjklnshrrm7ril8c669gsac4v9ck4n6j85p0dp6aizql"; }; "plugins/Floodgate.jar" = builtins.fetchurl { - url = "https://download.geysermc.org/v2/projects/floodgate/versions/2.2.3/builds/109/downloads/velocity"; - sha256 = "1hxdf38qzpzdnyn2gn1152fyd54bi37i0ayc82dgcjf0qrcbmv0c"; + url = "https://download.geysermc.org/v2/projects/floodgate/versions/2.2.3/builds/112/downloads/velocity"; + sha256 = "1cbb9qdlk9nw2q1vchq4fq553qxqi49268pg46b426wsa1yxjqa9"; }; "plugins/LuckPerms.jar" = builtins.fetchurl { url = "https://download.luckperms.net/1556/velocity/LuckPerms-Velocity-5.4.141.jar"; @@ -40,18 +39,11 @@ in { # Open ports for proxy networking.firewall = { - # Server and info allowedTCPPorts = [ - 25565 - 19132 - 30013 - 5657 + 25565 19132 30013 5657 # Minecraft server info ]; - # Server, VC, and Bedrock allowedUDPPorts = [ - 25565 - 19132 - 30013 + 25565 19132 30013 # Minecraft server, VC, and Bedrock ]; }; } diff --git a/modules/system/services/server/minecraft/common/vcserver.properties b/system/server/minecraft/vcserver.properties similarity index 100% rename from modules/system/services/server/minecraft/common/vcserver.properties rename to system/server/minecraft/vcserver.properties diff --git a/system/server/misc.nix b/system/server/misc.nix new file mode 100644 index 00000000..3fea159e --- /dev/null +++ b/system/server/misc.nix @@ -0,0 +1,10 @@ +{pkgs, ...}: { + # Install programs system-wide + environment.systemPackages = with pkgs; [ + mdadm + ]; + services = { + snowflake-proxy.enable = true; + logrotate.checkConfig = false; + }; +} diff --git a/modules/system/services/server/fileserver/public/nextcloud/default.nix b/system/server/nextcloud.nix similarity index 64% rename from modules/system/services/server/fileserver/public/nextcloud/default.nix rename to system/server/nextcloud.nix index 7c2129ea..644bcb22 100644 --- a/modules/system/services/server/fileserver/public/nextcloud/default.nix +++ b/system/server/nextcloud.nix @@ -1,10 +1,9 @@ -{ pkgs, config, ... }: -{ +{pkgs, outputs, ...}: { services = { nextcloud = { enable = true; package = pkgs.nextcloud29; - hostName = "cloud.${config.domains.jim1}"; + hostName = "cloud.${outputs.secrets.jimDomain}"; datadir = "/mnt/nextcloud"; https = true; config = { @@ -13,20 +12,21 @@ }; settings = { trusted_proxies = [ "127.0.0.1" ]; - trusted_domains = [ "cloud.${config.domains.jim1}" ]; + trusted_domains = [ "cloud.${outputs.secrets.jimDomain}" ]; overwriteprotocol = "https"; - mail_smtphost = "mx.${config.domains.jim1}"; - mail_domain = "${config.domains.jim1}"; + + # Mailserver settings + mail_smtphost = "mx.${outputs.secrets.jimDomain}"; + mail_domain = "${outputs.secrets.jimDomain}"; mail_from_address = "noreply"; mail_smtpauth = "true"; - mail_smtpname = "noreply@${config.domains.jim1}"; - mail_smtppassword = config.secrets.noreplyPassword; + mail_smtpname = "noreply@${outputs.secrets.jimDomain}"; + mail_smtppassword = outputs.secrets.noreplyPassword; mail_smtpmode = "smtp"; mail_smtpport = 587; }; }; - - nginx.virtualHosts."cloud.${config.domains.jim1}" = { + nginx.virtualHosts."cloud.${outputs.secrets.jimDomain}" = { enableACME = true; addSSL = true; locations."/" = { diff --git a/system/server/nfs.nix b/system/server/nfs.nix new file mode 100644 index 00000000..fc15404f --- /dev/null +++ b/system/server/nfs.nix @@ -0,0 +1,8 @@ +{ + services.nfs.server = { + enable = true; + exports = '' + /export/JimboNFS *(rw,no_subtree_check) + ''; + }; +} diff --git a/system/server/nginx.nix b/system/server/nginx.nix new file mode 100644 index 00000000..4d2b2187 --- /dev/null +++ b/system/server/nginx.nix @@ -0,0 +1,74 @@ +{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 new file mode 100644 index 00000000..332917c7 --- /dev/null +++ b/system/server/owncast.nix @@ -0,0 +1,18 @@ +{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/modules/system/services/server/fileserver/public/photoprism/default.nix b/system/server/photoprism.nix similarity index 75% rename from modules/system/services/server/fileserver/public/photoprism/default.nix rename to system/server/photoprism.nix index 59b01efa..4e8283dd 100644 --- a/modules/system/services/server/fileserver/public/photoprism/default.nix +++ b/system/server/photoprism.nix @@ -1,5 +1,4 @@ -{ config, ... }: -{ +{outputs, ...}: { services = { photoprism = { enable = true; @@ -8,17 +7,17 @@ address = "0.0.0.0"; settings = { PHOTOPRISM_ADMIN_USER = "jimbo"; - PHOTOPRISM_ADMIN_PASSWORD = "${config.secrets.prismAdminPass}"; + PHOTOPRISM_ADMIN_PASSWORD = "${outputs.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.${config.domains.jim1}"; + PHOTOPRISM_SITE_URL = "https://gallery.${outputs.secrets.jimDomain}"; PHOTOPRISM_SITE_TITLE = "Jimbo's PhotoPrism"; }; }; - nginx.virtualHosts."gallery.${config.domains.jim1}" = { + nginx.virtualHosts."gallery.${outputs.secrets.jimDomain}" = { enableACME = true; forceSSL = true; locations."/" = { diff --git a/system/server/pixelfed.nix b/system/server/pixelfed.nix new file mode 100644 index 00000000..bc5b62b1 --- /dev/null +++ b/system/server/pixelfed.nix @@ -0,0 +1,31 @@ +{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/modules/system/services/server/fileserver/local/samba/default.nix b/system/server/samba.nix similarity index 89% rename from modules/system/services/server/fileserver/local/samba/default.nix rename to system/server/samba.nix index 7236f2d7..2c0da8ae 100644 --- a/modules/system/services/server/fileserver/local/samba/default.nix +++ b/system/server/samba.nix @@ -1,5 +1,4 @@ -{ config, ... }: -{ +{outputs, ...}: { services = { samba = { enable = true; @@ -9,7 +8,7 @@ workgroup = WORKGROUP server string = JimSMB security = user - hosts allow = ${config.ips.localSpan}. 127.0.0.1 localhost + hosts allow = ${outputs.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/system/server/synapse.nix b/system/server/synapse.nix new file mode 100644 index 00000000..303d8a87 --- /dev/null +++ b/system/server/synapse.nix @@ -0,0 +1,91 @@ +{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 new file mode 100644 index 00000000..7b149f9c --- /dev/null +++ b/system/server/transmission.nix @@ -0,0 +1,20 @@ +{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 new file mode 100644 index 00000000..fd1b8591 --- /dev/null +++ b/system/server/vaultwarden.nix @@ -0,0 +1,32 @@ +{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 new file mode 100644 index 00000000..f7ebfd58 --- /dev/null +++ b/system/server/wireguard.nix @@ -0,0 +1,36 @@ +{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/modules/system/services/pc/gnome-keyring/default.nix b/system/services/gnome-keyring.nix similarity index 84% rename from modules/system/services/pc/gnome-keyring/default.nix rename to system/services/gnome-keyring.nix index 081985ce..9dd1656e 100644 --- a/modules/system/services/pc/gnome-keyring/default.nix +++ b/system/services/gnome-keyring.nix @@ -1,4 +1,3 @@ -{ ... }: { services.gnome.gnome-keyring.enable = true; } diff --git a/modules/system/services/pc/mpd/default.nix b/system/services/mpd.nix similarity index 68% rename from modules/system/services/pc/mpd/default.nix rename to system/services/mpd.nix index e91251c3..9f441969 100644 --- a/modules/system/services/pc/mpd/default.nix +++ b/system/services/mpd.nix @@ -1,11 +1,10 @@ -{ config, ... }: -{ +{config, pkgs, ...}: { services.mpd = { enable = true; user = "jimbo"; group = "users"; - musicDirectory = "/home/jimbo/JimboNFS/Music/Synced"; - playlistDirectory = "/home/jimbo/JimboNFS/Music/Synced/Playlists"; + musicDirectory = "/home/jimbo/JimboNFS/Music"; + playlistDirectory = "/home/jimbo/JimboNFS/Music/Playlists"; extraConfig = '' audio_output { type "pipewire" @@ -13,7 +12,6 @@ } ''; }; - systemd.services.mpd.environment = { XDG_RUNTIME_DIR = "/run/user/${toString config.users.users.jimbo.uid}"; }; diff --git a/system/services/openssh.nix b/system/services/openssh.nix new file mode 100644 index 00000000..63699acb --- /dev/null +++ b/system/services/openssh.nix @@ -0,0 +1,22 @@ +{ + # 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/modules/system/services/pc/virtualization/qemu/default.nix b/system/services/qemukvm.nix similarity index 96% rename from modules/system/services/pc/virtualization/qemu/default.nix rename to system/services/qemukvm.nix index 4b5db05d..f50caa92 100644 --- a/modules/system/services/pc/virtualization/qemu/default.nix +++ b/system/services/qemukvm.nix @@ -1,5 +1,4 @@ -{ config, pkgs, ... }: -{ +{config, pkgs, ...}: { virtualisation = { libvirtd = { enable = true; diff --git a/modules/system/services/pc/sunshine/default.nix b/system/services/sunshine.nix similarity index 75% rename from modules/system/services/pc/sunshine/default.nix rename to system/services/sunshine.nix index e73dccba..e1f23879 100644 --- a/modules/system/services/pc/sunshine/default.nix +++ b/system/services/sunshine.nix @@ -1,5 +1,5 @@ -{ ... }: { + # Enable Sunshine as a service services.sunshine = { enable = true; settings.port = 57989; diff --git a/system/services/udev.nix b/system/services/udev.nix new file mode 100644 index 00000000..2fef6c2d --- /dev/null +++ b/system/services/udev.nix @@ -0,0 +1,21 @@ +{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/modules/system/services/pc/virtualization/waydroid/default.nix b/system/services/waydroid.nix similarity index 67% rename from modules/system/services/pc/virtualization/waydroid/default.nix rename to system/services/waydroid.nix index 521a802c..00ff0d98 100644 --- a/modules/system/services/pc/virtualization/waydroid/default.nix +++ b/system/services/waydroid.nix @@ -1,4 +1,3 @@ -{ config, lib, ... }: { virtualisation.waydroid.enable = true; } diff --git a/system/users/groups.nix b/system/users/groups.nix new file mode 100644 index 00000000..334f839b --- /dev/null +++ b/system/users/groups.nix @@ -0,0 +1,6 @@ +{ + # Define custom groups + users.groups = { + nfsShare = {}; + }; +} diff --git a/system/users/jimbo.nix b/system/users/jimbo.nix new file mode 100644 index 00000000..21dce747 --- /dev/null +++ b/system/users/jimbo.nix @@ -0,0 +1,28 @@ +{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 new file mode 100644 index 00000000..c1a2abd2 --- /dev/null +++ b/system/users/liquidsoap.nix @@ -0,0 +1,9 @@ +{ + # 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 new file mode 100644 index 00000000..f94c29c2 --- /dev/null +++ b/system/users/nextcloud.nix @@ -0,0 +1,9 @@ +{ + # 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 new file mode 100644 index 00000000..680f8107 --- /dev/null +++ b/system/users/nginx.nix @@ -0,0 +1,9 @@ +{ + # Add service users to extra groups + users.users = { + nginx = { + extraGroups = [ "turnserver" "virtualMail" ]; + isSystemUser = true; + }; + }; +} diff --git a/variables/default.nix b/variables/default.nix deleted file mode 100644 index 0c75a334..00000000 --- a/variables/default.nix +++ /dev/null @@ -1,11 +0,0 @@ -{ ... }: -{ - imports = [ - ./displays - ./domains - ./ips - ./look - ./secrets - ./workspaces - ]; -} diff --git a/variables/displays/default.nix b/variables/displays/default.nix deleted file mode 100644 index 1fe447ac..00000000 --- a/variables/displays/default.nix +++ /dev/null @@ -1,14 +0,0 @@ -{ 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 deleted file mode 100644 index 966bf5b2..00000000 --- a/variables/domains/default.nix +++ /dev/null @@ -1,14 +0,0 @@ -{ 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 deleted file mode 100644 index 61f32e4d..00000000 --- a/variables/ips/default.nix +++ /dev/null @@ -1,19 +0,0 @@ -{ 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 deleted file mode 100644 index 6f707c06..00000000 --- a/variables/look/border/default.nix +++ /dev/null @@ -1,12 +0,0 @@ -{ 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 deleted file mode 100644 index bc7fbb30..00000000 --- a/variables/look/colors/green/default.nix +++ /dev/null @@ -1,22 +0,0 @@ -{ 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 deleted file mode 100644 index 1d4785f1..00000000 --- a/variables/look/colors/orange/default.nix +++ /dev/null @@ -1,22 +0,0 @@ -{ 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 deleted file mode 100644 index 00d8f563..00000000 --- a/variables/look/colors/purple/default.nix +++ /dev/null @@ -1,22 +0,0 @@ -{ 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 deleted file mode 100644 index fd647c39..00000000 --- a/variables/look/colors/red/default.nix +++ /dev/null @@ -1,22 +0,0 @@ -{ 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 deleted file mode 100644 index 0fd75f16..00000000 --- a/variables/look/default.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ ... }: -{ - imports = [ - ./border - ./fonts - ]; -} diff --git a/variables/look/fonts/default.nix b/variables/look/fonts/default.nix deleted file mode 100644 index 00e764b0..00000000 --- a/variables/look/fonts/default.nix +++ /dev/null @@ -1,12 +0,0 @@ -{ 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 deleted file mode 100644 index 0cbd023f..00000000 Binary files a/variables/secrets/default.nix and /dev/null differ diff --git a/variables/workspaces/default.nix b/variables/workspaces/default.nix deleted file mode 100644 index eb613b2b..00000000 --- a/variables/workspaces/default.nix +++ /dev/null @@ -1,29 +0,0 @@ -{ 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''; - }; -}