├── README.md ├── first-setup.sh ├── flake.lock ├── flake.nix ├── hosts ├── optiplex │ ├── configuration.nix │ └── hardware-configuration.nix ├── server │ └── configuration.nix └── yoga │ ├── configuration.nix │ └── hardware-configuration.nix └── modules ├── builds ├── expert.nix ├── n-m3u8dl-re.nix ├── patches │ └── lmms-rpmalloc.patch ├── xdman7.nix └── xdman8.nix ├── desktop ├── de │ ├── wayland │ │ └── gnome.nix │ └── x11 │ │ └── cinnamon.nix ├── display-manager │ └── light-dm │ │ └── lightdm.nix ├── slick-greeter │ ├── 1.jpeg │ ├── 1.jpg │ └── 1.png └── wm │ ├── wayland │ ├── hyprland.nix │ └── sway.nix │ └── x11 │ └── i3.nix ├── displaylink ├── displaylink-600.zip └── displaylink.nix ├── docker ├── Other │ ├── arch-root.nix │ └── arch-ttr-terminal-only.nix ├── arch-ttr.nix ├── docker-updates-with-rebuild.nix ├── docker-updates.nix ├── ferdium.nix ├── jackett.nix ├── jellyfin.nix ├── lidarr.nix ├── navidrome.nix ├── portainer.nix ├── rdt.nix ├── searxng.nix ├── searxng │ ├── settings.yml │ └── uwsgi.ini ├── sonarr.nix ├── syncthing.nix ├── template.nix └── vaultwarden.nix ├── flakes ├── python │ ├── flake.lock │ └── flake.nix └── template │ └── flake.nix ├── notes.md ├── scripts ├── flake-pull.sh ├── flake-push.sh ├── optiplex-flake-build.sh ├── optiplex-flake-update.sh ├── setup-casiotone.sh ├── yoga-flake-build.sh └── yoga-flake-update.sh ├── system ├── 16gb-swap.nix ├── 4gb-swap.nix ├── 8gb-swap.nix ├── audio.nix ├── canon.nix ├── cron.nix ├── cups-canon-zebra.nix ├── cups.nix ├── firewall.nix ├── samba.nix ├── services.nix ├── ssh.nix ├── template.nix ├── virtualization.nix └── xmodmap.nix ├── timers └── masterscript.nix └── users ├── family └── home-family.nix ├── muffery └── home-muffery.nix ├── ttr ├── bashrc.nix └── home-ttr.nix └── users.nix /README.md: -------------------------------------------------------------------------------- 1 | 2 | # NixOS: 3 | Just a public version of my NixOS configs with some slight alterations for security. 4 | 5 | # Directory structure: 6 | ``` 7 | /home/ttr/nixos-config 8 | ├── first-setup.sh 9 | ├── flake.lock 10 | ├── flake.nix 11 | ├── hosts 12 | │   ├── optiplex 13 | │   │   ├── configuration.nix 14 | │   │   └── hardware-configuration.nix 15 | │   ├── server 16 | │   │   └── configuration.nix 17 | │   └── yoga 18 | │   ├── configuration.nix 19 | │   └── hardware-configuration.nix 20 | ├── modules 21 | │   ├── builds 22 | │   │   ├── expert.nix 23 | │   │   ├── n-m3u8dl-re.nix 24 | │   │   ├── patches 25 | │   │   │   └── lmms-rpmalloc.patch 26 | │   │   ├── xdman7.nix 27 | │   │   └── xdman8.nix 28 | │   ├── desktop 29 | │   │   ├── de 30 | │   │   │   ├── wayland 31 | │   │   │   │   └── gnome.nix 32 | │   │   │   └── x11 33 | │   │   │   └── cinnamon.nix 34 | │   │   ├── display-manager 35 | │   │   │   └── light-dm 36 | │   │   │   └── lightdm.nix 37 | │   │   ├── slick-greeter 38 | │   │   │   ├── 1.jpeg 39 | │   │   │   ├── 1.jpg 40 | │   │   │   └── 1.png 41 | │   │   └── wm 42 | │   │   ├── wayland 43 | │   │   │   ├── hyprland.nix 44 | │   │   │   └── sway.nix 45 | │   │   └── x11 46 | │   │   └── i3.nix 47 | │   ├── displaylink 48 | │   │   ├── displaylink-600.zip 49 | │   │   └── displaylink.nix 50 | │   ├── docker 51 | │   │   ├── arch-ttr.nix 52 | │   │   ├── docker-updates.nix 53 | │   │   ├── docker-updates-with-rebuild.nix 54 | │   │   ├── ferdium.nix 55 | │   │   ├── jackett.nix 56 | │   │   ├── jellyfin.nix 57 | │   │   ├── lidarr.nix 58 | │   │   ├── navidrome.nix 59 | │   │   ├── Other 60 | │   │   │   ├── arch-root.nix 61 | │   │   │   └── arch-ttr-terminal-only.nix 62 | │   │   ├── portainer.nix 63 | │   │   ├── rdt.nix 64 | │   │   ├── searxng 65 | │   │   │   ├── settings.yml 66 | │   │   │   └── uwsgi.ini 67 | │   │   ├── searxng.nix 68 | │   │   ├── sonarr.nix 69 | │   │   ├── syncthing.nix 70 | │   │   ├── template.nix 71 | │   │   └── vaultwarden.nix 72 | │   ├── flakes 73 | │   │   ├── python 74 | │   │   │   ├── flake.lock 75 | │   │   │   ├── flake.nix 76 | │   │   │   └── flake.nix.bak 77 | │   │   └── template 78 | │   │   └── flake.nix 79 | │   ├── notes.md 80 | │   ├── scripts 81 | │   │   ├── flake-pull.sh 82 | │   │   ├── flake-push.sh 83 | │   │   ├── old 84 | │   │   │   ├── flake-build(old).sh 85 | │   │   │   └── flake-update(old).sh 86 | │   │   ├── optiplex-flake-build.sh 87 | │   │   ├── optiplex-flake-update.sh 88 | │   │   ├── setup-casiotone.sh 89 | │   │   ├── yoga-flake-build.sh 90 | │   │   └── yoga-flake-update.sh 91 | │   ├── system 92 | │   │   ├── 16gb-swap.nix 93 | │   │   ├── 4gb-swap.nix 94 | │   │   ├── 8gb-swap.nix 95 | │   │   ├── audio.nix 96 | │   │   ├── canon.nix 97 | │   │   ├── configuration(old).nix 98 | │   │   ├── cron.nix 99 | │   │   ├── cups-canon-zebra.nix 100 | │   │   ├── cups.nix 101 | │   │   ├── firewall.nix 102 | │   │   ├── samba.nix 103 | │   │   ├── services.nix 104 | │   │   ├── ssh.nix 105 | │   │   ├── template.nix 106 | │   │   ├── virtualization.nix 107 | │   │   └── xmodmap.nix 108 | │   ├── timers 109 | │   │   └── masterscript.nix 110 | │   └── users 111 | │   ├── family 112 | │   │   └── home-family.nix 113 | │   ├── muffery 114 | │   │   └── home-muffery.nix 115 | │   ├── ttr 116 | │   │   ├── bashrc.nix 117 | │   │   └── home-ttr.nix 118 | │   └── users.nix 119 | └── README.md 120 | 121 | 33 directories, 80 files 122 | 123 | ``` 124 | -------------------------------------------------------------------------------- /first-setup.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Prompt for username 4 | read -p "Enter your username: " username 5 | 6 | # Set the $user variable 7 | user="/home/$username" 8 | 9 | # git clone: 10 | cd "$user" 11 | git clone https://github.com/TheTechRun/nixos-config 12 | cd "$user/nixos-config" 13 | 14 | # Copy your hardware-config 15 | cp /etc/nixos/hardware-configuration.nix "$user/nixos-config/modules/system/hardware-configuration.nix" 16 | 17 | # Symlink your flake: 18 | ln -sf "$user/nixos-config/flake.nix" /etc/nixos/flake.nix 19 | 20 | # Make all scripts executable: 21 | chmod +x "$user/nixos-config/modules/scripts/"*.sh 22 | 23 | # Run the build script: 24 | sudo nixos-rebuild switch --flake $user/nixos-config 25 | -------------------------------------------------------------------------------- /flake.lock: -------------------------------------------------------------------------------- 1 | { 2 | "nodes": { 3 | "home-manager": { 4 | "inputs": { 5 | "nixpkgs": [ 6 | "nixpkgs" 7 | ] 8 | }, 9 | "locked": { 10 | "lastModified": 1733951607, 11 | "narHash": "sha256-CN6q6iCzxI1gkNyk4xLdwaMKi10r7n+aJkRzWj8PXwQ=", 12 | "owner": "nix-community", 13 | "repo": "home-manager", 14 | "rev": "6e5b2d9e8014b5572e3367937a329e7053458d34", 15 | "type": "github" 16 | }, 17 | "original": { 18 | "owner": "nix-community", 19 | "ref": "master", 20 | "repo": "home-manager", 21 | "type": "github" 22 | } 23 | }, 24 | "nixpkgs": { 25 | "locked": { 26 | "lastModified": 1733759999, 27 | "narHash": "sha256-463SNPWmz46iLzJKRzO3Q2b0Aurff3U1n0nYItxq7jU=", 28 | "owner": "nixos", 29 | "repo": "nixpkgs", 30 | "rev": "a73246e2eef4c6ed172979932bc80e1404ba2d56", 31 | "type": "github" 32 | }, 33 | "original": { 34 | "owner": "nixos", 35 | "ref": "nixos-unstable", 36 | "repo": "nixpkgs", 37 | "type": "github" 38 | } 39 | }, 40 | "root": { 41 | "inputs": { 42 | "home-manager": "home-manager", 43 | "nixpkgs": "nixpkgs" 44 | } 45 | } 46 | }, 47 | "root": "root", 48 | "version": 7 49 | } 50 | -------------------------------------------------------------------------------- /flake.nix: -------------------------------------------------------------------------------- 1 | { 2 | description = "NixOS configuration with system-wide packages and allowUnfree"; 3 | 4 | inputs = { 5 | nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; 6 | home-manager = { 7 | url = "github:nix-community/home-manager/master"; 8 | inputs.nixpkgs.follows = "nixpkgs"; 9 | }; 10 | }; 11 | 12 | outputs = { self, nixpkgs, home-manager, ... }@inputs: 13 | let 14 | system = "x86_64-linux"; 15 | 16 | # Define overlay for custom packages 17 | overlay = final: prev: { 18 | n-m3u8dl-re = final.callPackage ./modules/builds/n-m3u8dl-re.nix {}; 19 | xdman7 = final.callPackage ./modules/builds/xdman7.nix {}; 20 | xdman8 = final.callPackage ./modules/builds/xdman8.nix {}; 21 | 22 | # Create a pinned nixpkgs instance (get the narhash and rev from flake.lock ) 23 | pinnedPkgs = import (fetchTarball { 24 | url = "https://github.com/nixos/nixpkgs/archive/a73246e2eef4c6ed172979932bc80e1404ba2d56.tar.gz"; 25 | sha256 = "sha256-463SNPWmz46iLzJKRzO3Q2b0Aurff3U1n0nYItxq7jU="; 26 | }) { system = final.system; }; 27 | 28 | # Pin multiple packages to the same nixpkgs revision 29 | normcap = final.pinnedPkgs.normcap; 30 | vscodium = final.pinnedPkgs.vscodium; 31 | localsend = final.pinnedPkgs.localsend; 32 | }; 33 | 34 | pkgs = import nixpkgs { 35 | inherit system; 36 | config.allowUnfree = true; 37 | overlays = [ overlay ]; # Add our custom overlay 38 | }; 39 | 40 | lib = nixpkgs.lib; 41 | 42 | # Built from Source 43 | builtPackages = { 44 | n-m3u8dl-re = pkgs.callPackage ./modules/builds/n-m3u8dl-re.nix { 45 | inherit (pkgs) 46 | lib 47 | stdenv 48 | fetchurl 49 | makeWrapper 50 | icu 51 | openssl 52 | zlib; 53 | }; 54 | }; 55 | 56 | # Common system packages 57 | commonPackages = with pkgs; [ 58 | alacritty chromium curl xed-editor rofi dmenu micro 59 | xfce.thunar xfce.thunar-archive-plugin 60 | bash folder-color-switcher cups distrobox gpick 61 | haskellPackages.greenclip home-manager networkmanagerapplet polybar 62 | pyload-ng trash-cli unzip vlc wget xarchiver 63 | xorg.xmodmap xorg.setxkbmap 64 | pulseaudio pamixer pavucontrol 65 | libnotify libimobiledevice ifuse 66 | coreutils ffmpeg_7 findutils gawk moreutils perl 67 | rclone rename rsync jq neovim 68 | gcc gnumake xorg.libxcb 69 | xorg.xinit jdk maven yq solaar nomacs yt-dlp 70 | ]; 71 | 72 | # Optiplex-specific packages 73 | optiplexPackages = with pkgs; [ 74 | # Add packages specific to optiplex here 75 | # For example: 76 | # virtualbox 77 | # docker-compose 78 | ]; 79 | 80 | # Yoga-specific packages 81 | yogaPackages = with pkgs; [ 82 | libinput 83 | libinput-gestures 84 | # Add more yoga-specific packages here 85 | # For example: 86 | # powertop 87 | # tlp 88 | ]; 89 | 90 | in { 91 | nixosConfigurations = { 92 | optiplex = nixpkgs.lib.nixosSystem { 93 | inherit system; 94 | specialArgs = { inherit inputs lib pkgs; }; # Added pkgs to specialArgs 95 | modules = [ 96 | # Make overlay available system-wide 97 | { nixpkgs.overlays = [ overlay ]; } 98 | ./hosts/optiplex/configuration.nix 99 | ./modules/users/users.nix 100 | home-manager.nixosModules.home-manager 101 | { 102 | home-manager = { 103 | useGlobalPkgs = true; 104 | useUserPackages = true; 105 | extraSpecialArgs = { inherit builtPackages; }; # Pass builtPackages to all home-manager modules 106 | users = { 107 | ttr = { ... }: { 108 | imports = [ ./modules/users/ttr/home-ttr.nix ]; 109 | }; 110 | muffery = { ... }: { 111 | imports = [ ./modules/users/muffery/home-muffery.nix ]; 112 | }; 113 | family = { ... }: { 114 | imports = [ ./modules/users/family/home-family.nix ]; 115 | }; 116 | }; 117 | }; 118 | nixpkgs.config.allowUnfree = true; 119 | environment.systemPackages = commonPackages ++ optiplexPackages; 120 | } 121 | ]; 122 | }; 123 | 124 | yoga = nixpkgs.lib.nixosSystem { 125 | inherit system; 126 | specialArgs = { inherit inputs lib pkgs; }; # Added pkgs to specialArgs 127 | modules = [ 128 | # Make overlay available system-wide 129 | { nixpkgs.overlays = [ overlay ]; } 130 | ./hosts/yoga/configuration.nix 131 | ./hosts/yoga/hardware-configuration.nix 132 | ./modules/desktop/wm/x11/i3.nix 133 | ./modules/users/users.nix 134 | home-manager.nixosModules.home-manager 135 | { 136 | home-manager = { 137 | useGlobalPkgs = true; 138 | useUserPackages = true; 139 | extraSpecialArgs = { inherit builtPackages; }; # Pass builtPackages to all home-manager modules 140 | users = { 141 | ttr = { ... }: { 142 | imports = [ ./modules/users/ttr/home-ttr.nix ]; 143 | }; 144 | muffery = { ... }: { 145 | imports = [ ./modules/users/muffery/home-muffery.nix ]; 146 | }; 147 | }; 148 | }; 149 | nixpkgs.config.allowUnfree = true; 150 | environment.systemPackages = commonPackages ++ yogaPackages; 151 | } 152 | ]; 153 | }; 154 | }; 155 | }; 156 | } 157 | -------------------------------------------------------------------------------- /hosts/optiplex/configuration.nix: -------------------------------------------------------------------------------- 1 | { config, pkgs, lib, ... }: 2 | 3 | { 4 | imports = 5 | [ 6 | # Desktop Environment 7 | ../../modules/desktop/wm/x11/i3.nix 8 | ../../modules/desktop/wm/wayland/sway.nix 9 | ../../modules/desktop/display-manager/light-dm/lightdm.nix 10 | 11 | # System 12 | ./hardware-configuration.nix 13 | ../../modules/displaylink/displaylink.nix 14 | ../../modules/system/audio.nix 15 | ../../modules/system/cron.nix 16 | ../../modules/system/cups-canon-zebra.nix 17 | ../../modules/system/firewall.nix 18 | ../../modules/system/samba.nix 19 | ../../modules/system/services.nix 20 | ../../modules/system/ssh.nix 21 | ../../modules/system/virtualization.nix 22 | ../../modules/system/xmodmap.nix 23 | 24 | # Distrobox 25 | ../../modules/docker/arch-ttr.nix 26 | 27 | # Docker 28 | ../../modules/docker/docker-updates.nix 29 | ../../modules/docker/portainer.nix 30 | ../../modules/docker/sonarr.nix 31 | ../../modules/docker/jackett.nix 32 | ../../modules/docker/rdt.nix 33 | ../../modules/docker/searxng.nix 34 | ../../modules/docker/vaultwarden.nix 35 | ../../modules/docker/syncthing.nix 36 | ../../modules/docker/lidarr.nix 37 | ]; 38 | 39 | # Enable flakes 40 | nix.settings.experimental-features = [ "nix-command" "flakes" ]; 41 | 42 | # Define your hostname 43 | networking.hostName = "optiplex"; 44 | 45 | # Define your nixos version 46 | system.stateVersion = "24.05"; 47 | 48 | # Enable networking 49 | networking.networkmanager.enable = true; 50 | 51 | # Enable UID and GUID change 52 | users.mutableUsers = true; 53 | 54 | # Enable Logitech 55 | hardware.logitech.wireless.enable = true; 56 | 57 | # Kensington Expert Scrolling Button 58 | systemd.user.services.enable-scroll = { 59 | description = "Enable scrolling with Kensington Expert button"; 60 | wantedBy = [ "default.target" ]; 61 | script = "${pkgs.bash}/bin/bash ~/.scripts/TTR-Scripts/TTR-KensingtonExpert/saved-mappings/righty.sh"; 62 | }; 63 | 64 | # Set terminator as the default terminal 65 | environment.variables = { 66 | XDG_TERMINAL = "terminator"; 67 | }; 68 | 69 | # Enable programs 70 | programs.gnupg.agent = { 71 | enable = true; 72 | enableSSHSupport = true; 73 | }; 74 | 75 | # Enable Sudo 76 | security.sudo.enable = true; 77 | 78 | # Bootloader configuration 79 | boot.loader.systemd-boot.enable = true; 80 | boot.loader.systemd-boot.configurationLimit = 30; 81 | boot.loader.efi.canTouchEfiVariables = true; 82 | 83 | # Garbage collection 84 | nix.gc.automatic = true; 85 | 86 | # Enable bin files to run 87 | programs.nix-ld.enable = true; 88 | 89 | # Set time zone 90 | time.timeZone = "America/New_York"; 91 | 92 | # Locale settings 93 | i18n.defaultLocale = "en_US.UTF-8"; 94 | 95 | i18n.extraLocaleSettings = { 96 | LC_ADDRESS = "en_US.UTF-8"; 97 | LC_IDENTIFICATION = "en_US.UTF-8"; 98 | LC_MEASUREMENT = "en_US.UTF-8"; 99 | LC_MONETARY = "en_US.UTF-8"; 100 | LC_NAME = "en_US.UTF-8"; 101 | LC_NUMERIC = "en_US.UTF-8"; 102 | LC_PAPER = "en_US.UTF-8"; 103 | LC_TELEPHONE = "en_US.UTF-8"; 104 | LC_TIME = "en_US.UTF-8"; 105 | }; 106 | 107 | environment.sessionVariables = { 108 | PATH = ["${pkgs.pyload-ng}/bin"]; 109 | }; 110 | 111 | # Enable libinput 112 | services.libinput.enable = true; 113 | } -------------------------------------------------------------------------------- /hosts/optiplex/hardware-configuration.nix: -------------------------------------------------------------------------------- 1 | # Do not modify this file! It was generated by 'nixos-generate-config' 2 | # and may be overwritten by future invocations. Please make changes 3 | # to /etc/nixos/configuration.nix instead. 4 | { config, lib, pkgs, modulesPath, ... }: 5 | 6 | { 7 | imports = 8 | [ 9 | ../../modules/system/16gb-swap.nix #swap 10 | 11 | (modulesPath + "/installer/scan/not-detected.nix") 12 | ]; 13 | 14 | boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usbhid" "sd_mod" "sr_mod" ]; 15 | boot.initrd.kernelModules = [ ]; 16 | boot.kernelModules = [ "kvm-intel" ]; 17 | boot.extraModulePackages = [ ]; 18 | 19 | fileSystems."/" = 20 | { device = "/dev/disk/by-uuid/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"; 21 | fsType = "ext4"; 22 | }; 23 | 24 | fileSystems."/home" = 25 | { device = "/dev/disk/by-uuid/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"; 26 | fsType = "ext4"; 27 | }; 28 | 29 | fileSystems."/boot" = 30 | { device = "/dev/disk/by-uuid/XXXX-XXXX"; 31 | fsType = "vfat"; 32 | options = [ "fmask=0077" "dmask=0077" ]; 33 | }; 34 | 35 | fileSystems."/mnt/12tb" = 36 | { device = "/dev/disk/by-uuid/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"; 37 | fsType = "ext4"; 38 | }; 39 | 40 | fileSystems."/efi" = 41 | { device = "/dev/disk/by-uuid/XXXX-XXXX"; 42 | fsType = "vfat"; 43 | options = [ "fmask=0022" "dmask=0022" ]; 44 | }; 45 | 46 | 47 | 48 | # Enables DHCP on each ethernet and wireless interface. In case of scripted networking 49 | # (the default) this is the recommended approach. When using systemd-networkd it's 50 | # still possible to use this option, but it's recommended to use it in conjunction 51 | # with explicit per-interface declarations with `networking.interfaces..useDHCP`. 52 | networking.useDHCP = lib.mkDefault true; 53 | # networking.interfaces.docker0.useDHCP = lib.mkDefault true; 54 | # networking.interfaces.enp0s20f0u3u3c2.useDHCP = lib.mkDefault true; 55 | # networking.interfaces.enp0s31f6.useDHCP = lib.mkDefault true; 56 | # networking.interfaces.tailscale0.useDHCP = lib.mkDefault true; 57 | 58 | nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; 59 | hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; 60 | } -------------------------------------------------------------------------------- /hosts/server/configuration.nix: -------------------------------------------------------------------------------- 1 | { config, pkgs, lib, ... }: 2 | 3 | { 4 | imports = 5 | [ 6 | 7 | # System 8 | ./hardware-configuration.nix 9 | ../../modules/system/cron.nix 10 | ../../modules/system/firewall.nix 11 | ../../modules/system/services.nix 12 | ../../modules/system/ssh.nix 13 | ../../modules/system/virtualization.nix 14 | 15 | 16 | # Docker 17 | ../../modules/docker/portainer.nix 18 | ../../modules/docker/searxng.nix 19 | ../../modules/docker/ferdium.nix 20 | ../../modules/docker/syncthing.nix 21 | ]; 22 | 23 | 24 | # Enable flakes. 25 | nix.settings.experimental-features = [ "nix-command" "flakes" ]; 26 | 27 | # Define your hostname. 28 | networking.hostName = "optiplex"; 29 | 30 | # Define your nixos version. 31 | system.stateVersion = "24.05"; 32 | 33 | # Enable networking 34 | networking.networkmanager.enable = true; 35 | 36 | # Enable UID and GUID change 37 | users.mutableUsers = true; 38 | 39 | # Set terminator as the default terminal 40 | environment.variables = { 41 | XDG_TERMINAL = "terminator"; 42 | }; 43 | 44 | # Some programs need SUID wrappers, can be configured further or are 45 | # started in user sessions. 46 | # programs.mtr.enable = true; 47 | programs.gnupg.agent = { 48 | enable = true; 49 | enableSSHSupport = true; 50 | }; 51 | 52 | #Enable Sudo 53 | security.sudo.enable = true; 54 | 55 | # Bootloader. 56 | boot.loader.systemd-boot.enable = true; 57 | boot.loader.systemd-boot.configurationLimit = 30; 58 | boot.loader.efi.canTouchEfiVariables = true; 59 | 60 | # Bootloader. (Use this for grub instead especially if you're on a VM) 61 | #boot.loader.grub.enable = true; 62 | #boot.loader.grub.device = "/dev/vda"; 63 | #boot.loader.grub.useOSProber = true; 64 | 65 | # garbage collection 66 | nix.gc.automatic = true; 67 | 68 | # Enable bin files to run 69 | programs.nix-ld.enable = true; 70 | 71 | # Set your time zone. 72 | time.timeZone = "America/New_York"; 73 | 74 | # Select internationalisation properties. 75 | i18n.defaultLocale = "en_US.UTF-8"; 76 | 77 | i18n.extraLocaleSettings = { 78 | LC_ADDRESS = "en_US.UTF-8"; 79 | LC_IDENTIFICATION = "en_US.UTF-8"; 80 | LC_MEASUREMENT = "en_US.UTF-8"; 81 | LC_MONETARY = "en_US.UTF-8"; 82 | LC_NAME = "en_US.UTF-8"; 83 | LC_NUMERIC = "en_US.UTF-8"; 84 | LC_PAPER = "en_US.UTF-8"; 85 | LC_TELEPHONE = "en_US.UTF-8"; 86 | LC_TIME = "en_US.UTF-8"; 87 | }; 88 | 89 | environment.sessionVariables = { 90 | PATH = ["${pkgs.pyload-ng}/bin"]; 91 | }; 92 | 93 | # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. 94 | # Configure network proxy if necessary 95 | # networking.proxy.default = "http://user:password@proxy:port/"; 96 | # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; 97 | 98 | } 99 | -------------------------------------------------------------------------------- /hosts/yoga/configuration.nix: -------------------------------------------------------------------------------- 1 | { config, pkgs, lib, ... }: 2 | 3 | { 4 | imports = 5 | [ 6 | 7 | # Desktop Environment 8 | ../../modules/desktop/wm/x11/i3.nix 9 | 10 | # System 11 | ./hardware-configuration.nix 12 | ../../modules/system/audio.nix 13 | ../../modules/system/16gb-swap.nix 14 | #../../modules/system/cron.nix 15 | ../../modules/system/cups.nix 16 | ../../modules/system/firewall.nix 17 | ../../modules/system/samba.nix 18 | ../../modules/system/services.nix 19 | ../../modules/system/ssh.nix 20 | ../../modules/system/virtualization.nix 21 | ../../modules/system/xdomap.nix 22 | 23 | ]; 24 | 25 | 26 | # Enable flakes. 27 | nix.settings.experimental-features = [ "nix-command" "flakes" ]; 28 | 29 | # Define your hostname. 30 | networking.hostName = "yoga"; 31 | 32 | # Define your nixos version. 33 | system.stateVersion = "24.05"; 34 | 35 | # Enable networking 36 | networking.networkmanager.enable = true; 37 | 38 | # Enable UID and GUID change 39 | users.mutableUsers = true; 40 | 41 | # Set terminator as the default terminal 42 | environment.variables = { 43 | XDG_TERMINAL = "terminator"; 44 | }; 45 | 46 | # Some programs need SUID wrappers, can be configured further or are 47 | # started in user sessions. 48 | # programs.mtr.enable = true; 49 | programs.gnupg.agent = { 50 | enable = true; 51 | enableSSHSupport = true; 52 | }; 53 | 54 | #Enable Sudo 55 | security.sudo.enable = true; 56 | 57 | # Bootloader. 58 | boot.loader.systemd-boot.enable = true; 59 | boot.loader.systemd-boot.configurationLimit = 30; 60 | boot.loader.efi.canTouchEfiVariables = true; 61 | 62 | # Bootloader. (Use this for grub instead especially if you're on a VM) 63 | #boot.loader.grub.enable = true; 64 | #boot.loader.grub.device = "/dev/vda"; 65 | #boot.loader.grub.useOSProber = true; 66 | 67 | # garbage collection 68 | nix.gc.automatic = true; 69 | 70 | # Enable bin files to run 71 | programs.nix-ld.enable = true; 72 | 73 | # Set your time zone. 74 | time.timeZone = "America/New_York"; 75 | 76 | # Select internationalisation properties. 77 | i18n.defaultLocale = "en_US.UTF-8"; 78 | 79 | i18n.extraLocaleSettings = { 80 | LC_ADDRESS = "en_US.UTF-8"; 81 | LC_IDENTIFICATION = "en_US.UTF-8"; 82 | LC_MEASUREMENT = "en_US.UTF-8"; 83 | LC_MONETARY = "en_US.UTF-8"; 84 | LC_NAME = "en_US.UTF-8"; 85 | LC_NUMERIC = "en_US.UTF-8"; 86 | LC_PAPER = "en_US.UTF-8"; 87 | LC_TELEPHONE = "en_US.UTF-8"; 88 | LC_TIME = "en_US.UTF-8"; 89 | }; 90 | 91 | environment.sessionVariables = { 92 | PATH = ["${pkgs.pyload-ng}/bin"]; 93 | }; 94 | 95 | # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. 96 | # Configure network proxy if necessary 97 | # networking.proxy.default = "http://user:password@proxy:port/"; 98 | # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; 99 | 100 | } 101 | -------------------------------------------------------------------------------- /hosts/yoga/hardware-configuration.nix: -------------------------------------------------------------------------------- 1 | # Do not modify this file! It was generated by 'nixos-generate-config' 2 | # and may be overwritten by future invocations. Please make changes 3 | # to /etc/nixos/configuration.nix instead. 4 | { config, lib, pkgs, modulesPath, ... }: 5 | 6 | { 7 | imports = 8 | [ (modulesPath + "/installer/scan/not-detected.nix") 9 | ]; 10 | 11 | boot.initrd.availableKernelModules = [ "xhci_pci" "nvme" "usb_storage" "sd_mod" ]; 12 | boot.initrd.kernelModules = [ ]; 13 | boot.kernelModules = [ "kvm-intel" ]; 14 | boot.extraModulePackages = [ ]; 15 | 16 | fileSystems."/" = 17 | { device = "/dev/disk/by-uuid/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"; 18 | fsType = "ext4"; 19 | }; 20 | 21 | fileSystems."/boot" = 22 | { device = "/dev/disk/by-uuid/XXXX-XXXX"; 23 | fsType = "vfat"; 24 | options = [ "fmask=0077" "dmask=0077" ]; 25 | }; 26 | 27 | fileSystems."/efi" = 28 | { device = "/dev/disk/by-uuid/XXXX-XXXX"; 29 | fsType = "vfat"; 30 | options = [ "fmask=0022" "dmask=0022" ]; 31 | }; 32 | 33 | # Swapfile 34 | swapDevices = [ { 35 | device = "/var/lib/swapfile"; 36 | size = 16*1024; 37 | } ]; 38 | 39 | # Enables DHCP on each ethernet and wireless interface. In case of scripted networking 40 | # (the default) this is the recommended approach. When using systemd-networkd it's 41 | # still possible to use this option, but it's recommended to use it in conjunction 42 | # with explicit per-interface declarations with `networking.interfaces..useDHCP`. 43 | networking.useDHCP = lib.mkDefault true; 44 | # networking.interfaces.wlp2s0.useDHCP = lib.mkDefault true; 45 | 46 | nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; 47 | hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; 48 | } -------------------------------------------------------------------------------- /modules/builds/expert.nix: -------------------------------------------------------------------------------- 1 | # modules/builds/expert.nix 2 | { lib, stdenv, writeText, xorg }: 3 | 4 | let 5 | configText = '' 6 | Section "InputClass" 7 | Identifier "Kensington Expert Wireless TB Mouse" 8 | MatchProduct "Kensington Expert Wireless TB Mouse" 9 | MatchDevicePath "/dev/input/event*" 10 | Driver "evdev" 11 | 12 | # Enable the scroll wheel/ring 13 | Option "EmulateWheel" "true" 14 | Option "EmulateWheelButton" "8" 15 | 16 | # Scroll wheel/ring sensitivity 17 | Option "XAxisMapping" "6 7" 18 | Option "YAxisMapping" "4 5" 19 | Option "EmulateWheelInertia" "10" 20 | 21 | # Button mapping 22 | Option "ButtonMapping" "1 2 3 4 5 6 7 8 9" 23 | 24 | # Pointer acceleration 25 | Option "AccelSpeed" "0.5" 26 | EndSection 27 | ''; 28 | in 29 | stdenv.mkDerivation { 30 | name = "kensington-expert-config"; 31 | version = "1.0.0"; 32 | 33 | unpackPhase = "mkdir -p $out"; 34 | dontBuild = true; 35 | 36 | installPhase = '' 37 | mkdir -p $out/etc/X11/xorg.conf.d 38 | echo "${configText}" > $out/etc/X11/xorg.conf.d/10-expert-mouse.conf 39 | ''; 40 | 41 | meta = with lib; { 42 | description = "X11 configuration for Kensington Expert Wireless TB Mouse using evdev"; 43 | license = licenses.mit; 44 | platforms = platforms.linux; 45 | }; 46 | } -------------------------------------------------------------------------------- /modules/builds/n-m3u8dl-re.nix: -------------------------------------------------------------------------------- 1 | { lib 2 | , stdenv 3 | , fetchurl 4 | , makeWrapper 5 | , icu 6 | , openssl 7 | , zlib 8 | }: 9 | 10 | stdenv.mkDerivation rec { 11 | pname = "n-m3u8dl-re"; 12 | version = "0.2.1-beta"; 13 | _time = "20240828"; 14 | 15 | src = fetchurl { 16 | url = "https://github.com/nilaoda/N_m3u8DL-RE/releases/download/v${version}/N_m3u8DL-RE_Beta_linux-x64_${_time}.tar.gz"; 17 | hash = "sha256-TOpIWhelu5GjSzELtaXThaI7ac7JcHUwU9g7JbRmuuo="; 18 | }; 19 | 20 | nativeBuildInputs = [ makeWrapper ]; 21 | 22 | buildInputs = [ 23 | icu 24 | openssl 25 | zlib 26 | ]; 27 | 28 | dontBuild = true; 29 | dontConfigure = true; 30 | dontStrip = true; 31 | dontPatchELF = true; 32 | 33 | unpackPhase = '' 34 | tar xvzf $src 35 | ''; 36 | 37 | installPhase = '' 38 | runHook preInstall 39 | 40 | mkdir -p $out/bin 41 | cp N_m3u8DL-RE_Beta_linux-x64/N_m3u8DL-RE $out/bin/n-m3u8dl-re 42 | ln -s $out/bin/n-m3u8dl-re $out/bin/N_m3u8DL-RE 43 | chmod +x $out/bin/n-m3u8dl-re 44 | 45 | wrapProgram $out/bin/n-m3u8dl-re \ 46 | --set LD_LIBRARY_PATH ${lib.makeLibraryPath buildInputs} \ 47 | --set DOTNET_SYSTEM_GLOBALIZATION_INVARIANT 0 48 | 49 | runHook postInstall 50 | ''; 51 | 52 | meta = with lib; { 53 | description = "Cross-Platform, beautiful and powerful stream downloader for DASH/HLS"; 54 | homepage = "https://github.com/nilaoda/N_m3u8DL-RE"; 55 | license = licenses.mit; 56 | platforms = [ "x86_64-linux" ]; 57 | maintainers = with maintainers; [ ]; 58 | }; 59 | } -------------------------------------------------------------------------------- /modules/builds/patches/lmms-rpmalloc.patch: -------------------------------------------------------------------------------- 1 | diff --git a/src/3rdparty/rpmalloc/CMakeLists.txt b/src/3rdparty/rpmalloc/CMakeLists.txt 2 | index 123456..789012 100644 3 | --- a/src/3rdparty/rpmalloc/CMakeLists.txt 4 | +++ b/src/3rdparty/rpmalloc/CMakeLists.txt 5 | @@ -1,3 +1,5 @@ 6 | project(rpmalloc) 7 | 8 | -add_library(rpmalloc STATIC) 9 | +add_library(rpmalloc STATIC 10 | + rpmalloc.c 11 | +) -------------------------------------------------------------------------------- /modules/builds/xdman7.nix: -------------------------------------------------------------------------------- 1 | { lib 2 | , stdenv 3 | , fetchurl 4 | , makeWrapper 5 | , jdk11 6 | , ffmpeg 7 | , python3 8 | , yt-dlp 9 | }: 10 | 11 | stdenv.mkDerivation rec { 12 | pname = "xdman"; 13 | version = "7.2.11"; 14 | 15 | src = fetchurl { 16 | url = "https://github.com/subhra74/xdm/releases/download/${version}/xdman.jar"; 17 | hash = "sha256-gRfyhvneHlf0VRZ22PCrPi6ZBER0S1lffMTLngH1HHw="; 18 | }; 19 | 20 | nativeBuildInputs = [ makeWrapper ]; 21 | 22 | buildInputs = [ 23 | jdk11 24 | ffmpeg 25 | python3 26 | yt-dlp 27 | ]; 28 | 29 | dontBuild = true; 30 | dontConfigure = true; 31 | dontStrip = true; 32 | dontPatchELF = true; 33 | dontUnpack = true; 34 | 35 | installPhase = '' 36 | runHook preInstall 37 | 38 | mkdir -p $out/{bin,share/java/xdman} 39 | cp $src $out/share/java/xdman/xdman.jar 40 | 41 | makeWrapper ${jdk11}/bin/java $out/bin/xdman \ 42 | --prefix PATH : ${lib.makeBinPath [ ffmpeg yt-dlp ]} \ 43 | --add-flags "-jar $out/share/java/xdman/xdman.jar" 44 | 45 | runHook postInstall 46 | ''; 47 | 48 | meta = with lib; { 49 | description = "Xtreme Download Manager: download manager with multiple browser integrations"; 50 | homepage = "https://xtremedownloadmanager.com/"; 51 | license = licenses.gpl2; 52 | platforms = [ "x86_64-linux" ]; 53 | maintainers = with maintainers; [ ]; 54 | }; 55 | } -------------------------------------------------------------------------------- /modules/builds/xdman8.nix: -------------------------------------------------------------------------------- 1 | { lib 2 | , stdenv 3 | , fetchurl 4 | , makeWrapper 5 | , gtk3 6 | , ffmpeg 7 | , rpmextract 8 | , openssl 9 | , gsettings-desktop-schemas 10 | , adwaita-icon-theme 11 | , hicolor-icon-theme 12 | , shared-mime-info 13 | }: 14 | 15 | stdenv.mkDerivation rec { 16 | pname = "xdman8"; 17 | version = "8.0.29"; 18 | 19 | src = fetchurl { 20 | url = "https://github.com/subhra74/xdm/releases/download/${version}/xdman_gtk-${version}-1.fc36.x86_64.rpm"; 21 | hash = "sha256-27R+f70DzIKqRniIYAPVbh1SIuy0pSqD4OZGH63CfqM="; 22 | }; 23 | 24 | nativeBuildInputs = [ 25 | makeWrapper 26 | rpmextract 27 | ]; 28 | 29 | buildInputs = [ 30 | gtk3 31 | ffmpeg 32 | openssl 33 | gsettings-desktop-schemas 34 | adwaita-icon-theme 35 | hicolor-icon-theme 36 | shared-mime-info 37 | ]; 38 | 39 | unpackPhase = '' 40 | rpmextract $src 41 | ''; 42 | 43 | dontBuild = true; 44 | dontConfigure = true; 45 | dontPatchELF = true; 46 | dontStrip = true; 47 | 48 | installPhase = '' 49 | runHook preInstall 50 | 51 | # Create the directory structure 52 | mkdir -p $out/{bin,opt/xdman,share/applications,share/icons/hicolor/scalable/apps} 53 | 54 | # Copy the main application files 55 | cp -r opt/xdman/* $out/opt/xdman/ 56 | 57 | # Install icon 58 | install -Dm644 opt/xdman/xdm-logo.svg $out/share/icons/hicolor/scalable/apps/ 59 | 60 | # Create wrapper 61 | makeWrapper $out/opt/xdman/xdm-app $out/bin/xdman8 \ 62 | --prefix PATH : "${lib.makeBinPath [ ffmpeg ]}" \ 63 | --set DOTNET_SYSTEM_GLOBALIZATION_INVARIANT 1 \ 64 | --prefix XDG_DATA_DIRS : "${gsettings-desktop-schemas}/share/gsettings-schemas/${gsettings-desktop-schemas.name}:${gtk3}/share/gsettings-schemas/${gtk3.name}:${shared-mime-info}/share:$out/share:$XDG_DATA_DIRS" \ 65 | --set LD_LIBRARY_PATH "${lib.makeLibraryPath [ 66 | stdenv.cc.cc.lib 67 | gtk3 68 | openssl 69 | ]}" \ 70 | --set GTK_THEME "Adwaita" \ 71 | --set GTK3_MODULES "${gtk3}/lib/gtk-3.0" 72 | 73 | # Install desktop file 74 | install -Dm644 usr/share/applications/xdm-app.desktop $out/share/applications/xdman8.desktop 75 | 76 | # Patch the desktop file 77 | substituteInPlace $out/share/applications/xdman8.desktop \ 78 | --replace "Exec=xdman" "Exec=xdman8" \ 79 | --replace "Icon=xdm-app" "Icon=xdm-logo" 80 | 81 | # Make binary executable and link libraries 82 | chmod +x $out/opt/xdman/xdm-app 83 | patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \ 84 | --set-rpath "${lib.makeLibraryPath [ 85 | stdenv.cc.cc 86 | gtk3 87 | openssl 88 | ]}" \ 89 | $out/opt/xdman/xdm-app 90 | 91 | runHook postInstall 92 | ''; 93 | 94 | meta = with lib; { 95 | description = "Powerful download accelerator and video downloader"; 96 | homepage = "https://github.com/subhra74/xdm"; 97 | license = licenses.gpl3; 98 | platforms = [ "x86_64-linux" ]; 99 | maintainers = with maintainers; [ ]; 100 | }; 101 | } -------------------------------------------------------------------------------- /modules/desktop/de/wayland/gnome.nix: -------------------------------------------------------------------------------- 1 | { config, pkgs, callPackage, ... }: 2 | 3 | { 4 | 5 | environment.pathsToLink = [ "/libexec" ]; 6 | 7 | 8 | # Enable the GNOME Desktop Environment. 9 | #services.xserver.displayManager.gdm.enable = true; 10 | services.xserver.displayManager.lightdm.enable = true; 11 | services.xserver.desktopManager.gnome.enable = true; 12 | 13 | } 14 | -------------------------------------------------------------------------------- /modules/desktop/de/x11/cinnamon.nix: -------------------------------------------------------------------------------- 1 | { config, pkgs, callPackage, ... }: 2 | 3 | { 4 | 5 | environment.pathsToLink = [ "/libexec" ]; 6 | 7 | 8 | services.xserver.displayManager.lightdm.enable = true; 9 | 10 | services.xserver.desktopManager.cinnamon.enable = true; 11 | 12 | # Enable the X11 windowing system 13 | services.xserver = { 14 | enable = true; 15 | 16 | }; 17 | 18 | } 19 | -------------------------------------------------------------------------------- /modules/desktop/display-manager/light-dm/lightdm.nix: -------------------------------------------------------------------------------- 1 | # /home/ttr/nixos-config/modules/desktop/display-manager/light-dm/lightdm.nix 2 | { config, lib, pkgs, ... }: 3 | 4 | let 5 | backgroundImage = pkgs.copyPathToStore ../../slick-greeter/1.jpeg; 6 | in 7 | { 8 | services.xserver = { 9 | enable = true; 10 | 11 | displayManager = { 12 | defaultSession = "none+i3"; 13 | 14 | lightdm = { 15 | enable = true; 16 | background = backgroundImage; 17 | greeters.gtk.enable = false; 18 | 19 | greeters.slick = { 20 | enable = true; 21 | extraConfig = '' 22 | background=${backgroundImage} 23 | draw-user-backgrounds=false 24 | theme-name=Adwaita-dark 25 | icon-theme-name=Adwaita 26 | font-name=Sans 11 27 | xft-antialias=true 28 | xft-hintstyle=hintfull 29 | enable-hidpi=auto 30 | ''; 31 | }; 32 | }; 33 | 34 | session = [ 35 | { 36 | name = "i3"; 37 | manage = "window"; 38 | start = '' 39 | ${pkgs.i3}/bin/i3 40 | ''; 41 | } 42 | { 43 | name = "sway"; 44 | manage = "window"; 45 | start = '' 46 | export XDG_SESSION_TYPE=wayland 47 | export XDG_CURRENT_DESKTOP=sway 48 | exec ${pkgs.sway}/bin/sway 49 | ''; 50 | } 51 | ]; 52 | }; 53 | }; 54 | 55 | environment.systemPackages = with pkgs; [ 56 | lightdm 57 | lightdm-slick-greeter 58 | sway 59 | ]; 60 | } -------------------------------------------------------------------------------- /modules/desktop/slick-greeter/1.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheTechRun/public-nixos/464f8fcb9a2a3f9819b00f47df34b68db219340e/modules/desktop/slick-greeter/1.jpeg -------------------------------------------------------------------------------- /modules/desktop/slick-greeter/1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheTechRun/public-nixos/464f8fcb9a2a3f9819b00f47df34b68db219340e/modules/desktop/slick-greeter/1.jpg -------------------------------------------------------------------------------- /modules/desktop/slick-greeter/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheTechRun/public-nixos/464f8fcb9a2a3f9819b00f47df34b68db219340e/modules/desktop/slick-greeter/1.png -------------------------------------------------------------------------------- /modules/desktop/wm/wayland/hyprland.nix: -------------------------------------------------------------------------------- 1 | { config, pkgs, ... }:{ 2 | 3 | programs.hyprland.enable = true; 4 | 5 | environment.systemPackages = with pkgs; [ 6 | cliphist 7 | hyprpaper 8 | hyprpicker 9 | hyprlock 10 | nwg-displays #wayland monitors 11 | nwg-look #wayland themes 12 | rofi-wayland 13 | waybar 14 | wlr-randr 15 | wtype 16 | wl-clipboard 17 | wpaperd 18 | ]; 19 | } 20 | -------------------------------------------------------------------------------- /modules/desktop/wm/wayland/sway.nix: -------------------------------------------------------------------------------- 1 | # /home/ttr/nixos-config/modules/desktop/wm/wayland/sway.nix 2 | { config, lib, pkgs, ... }: 3 | 4 | { 5 | programs.sway = { 6 | enable = true; 7 | wrapperFeatures = { 8 | base = true; 9 | gtk = true; 10 | }; 11 | extraSessionCommands = '' 12 | export SDL_VIDEODRIVER=wayland 13 | export QT_QPA_PLATFORM=wayland 14 | export QT_WAYLAND_DISABLE_WINDOWDECORATION="1" 15 | export MOZ_ENABLE_WAYLAND=1 16 | export XDG_CURRENT_DESKTOP=sway 17 | export XDG_SESSION_TYPE=wayland 18 | export _JAVA_AWT_WM_NONREPARENTING=1 19 | ''; 20 | extraPackages = with pkgs; [ 21 | swaylock 22 | swayidle 23 | wl-clipboard 24 | mako 25 | waybar 26 | wofi 27 | grim 28 | slurp 29 | wf-recorder 30 | xwayland 31 | networkmanagerapplet 32 | rofi 33 | flameshot 34 | jumpapp 35 | pyload-ng 36 | screenkey 37 | xfce.catfish 38 | fsearch 39 | lightlocker 40 | haskellPackages.greenclip 41 | dunst 42 | brightnessctl 43 | pamixer 44 | playerctl 45 | ]; 46 | }; 47 | 48 | xdg.portal = { 49 | enable = true; 50 | wlr.enable = true; 51 | extraPortals = with pkgs; [ 52 | xdg-desktop-portal-wlr 53 | xdg-desktop-portal-gtk 54 | ]; 55 | config.common.default = "*"; 56 | }; 57 | 58 | security.polkit.enable = true; 59 | hardware.graphics.enable = true; 60 | 61 | services.pipewire = { 62 | enable = true; 63 | alsa.enable = true; 64 | pulse.enable = true; 65 | }; 66 | } -------------------------------------------------------------------------------- /modules/desktop/wm/x11/i3.nix: -------------------------------------------------------------------------------- 1 | # /home/ttr/nixos-config/modules/desktop/wm/x11/i3.nix 2 | { config, pkgs, ... }: 3 | 4 | { 5 | environment.pathsToLink = [ "/libexec" ]; 6 | 7 | services.xserver = { 8 | enable = true; 9 | 10 | desktopManager = { 11 | xterm.enable = false; 12 | }; 13 | 14 | windowManager.i3 = { 15 | enable = true; 16 | extraPackages = with pkgs; [ 17 | arandr 18 | autokey 19 | autotiling 20 | arandr 21 | betterlockscreen 22 | dunst 23 | feh 24 | dconf-editor 25 | i3altlayout 26 | i3status 27 | i3lock 28 | i3blocks 29 | i3status 30 | lxappearance 31 | libmpdclient 32 | mpd 33 | nitrogen 34 | picom-pijulius 35 | tdrop 36 | jumpapp 37 | wmctrl 38 | xprintidle #for auto lock in i3 39 | xorg.xprop 40 | xdotool 41 | xorg.xev 42 | xorg.xhost 43 | xdg-desktop-portal 44 | xdg-desktop-portal-gtk 45 | 46 | # Lockscreen 47 | xautolock # autolocks 48 | lightlocker # locks screen for real 49 | lightdm-slick-greeter 50 | ]; 51 | }; 52 | }; 53 | 54 | xdg.portal = { 55 | enable = true; 56 | extraPortals = [ pkgs.xdg-desktop-portal-gtk ]; 57 | }; 58 | } -------------------------------------------------------------------------------- /modules/displaylink/displaylink-600.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheTechRun/public-nixos/464f8fcb9a2a3f9819b00f47df34b68db219340e/modules/displaylink/displaylink-600.zip -------------------------------------------------------------------------------- /modules/displaylink/displaylink.nix: -------------------------------------------------------------------------------- 1 | { config, pkgs, lib, ... }: 2 | 3 | { 4 | nixpkgs.config.displaylink = { 5 | enable = true; 6 | # Use a fixed path relative to the repository 7 | driverFile = ./displaylink-600.zip; 8 | # Provide a fixed hash that you'll get after downloading the file 9 | sha256 = "1ixrklwk67w25cy77n7l0pq6j9i4bp4lkdr30kp1jsmyz8daaypw"; # Add the hash here after downloading and running nix-prefetch-url file://$(pwd)/modules/displaylink/displaylink-600.zip 10 | }; 11 | 12 | # Add DisplayLink to video drivers 13 | services.xserver.videoDrivers = [ "displaylink" "modesetting" ]; 14 | } -------------------------------------------------------------------------------- /modules/docker/Other/arch-root.nix: -------------------------------------------------------------------------------- 1 | # This runs arch as root user only 2 | 3 | { config, lib, pkgs, ... }: 4 | 5 | let 6 | archContainer = config.virtualisation.oci-containers.containers.archlinux; 7 | in 8 | { 9 | virtualisation.oci-containers.containers = { 10 | archlinux = { 11 | image = "quay.io/toolbx/arch-toolbox:latest"; 12 | autoStart = true; 13 | volumes = [ 14 | "/home:/home" 15 | "/media:/media" 16 | "/mnt:/mnt" 17 | "/etc/resolv.conf:/etc/resolv.conf:ro" 18 | ]; 19 | extraOptions = [ 20 | "--network=host" 21 | "--security-opt=label=disable" 22 | "--security-opt=seccomp=unconfined" 23 | "--device=/dev/fuse" 24 | "--cap-add=CAP_SYS_ADMIN" 25 | "--cap-add=CAP_NET_ADMIN" 26 | ]; 27 | cmd = [ "tail" "-f" "/dev/null" ]; # Keep the container running 28 | }; 29 | }; 30 | 31 | environment.systemPackages = with pkgs; [ 32 | distrobox 33 | (writeScriptBin "enter-archlinux" '' 34 | #!${pkgs.stdenv.shell} 35 | set -e 36 | echo "Checking Arch Linux container status..." 37 | if ! ${pkgs.docker}/bin/docker ps -a | grep -q archlinux; then 38 | echo "Arch Linux container not found. Creating it..." 39 | ${pkgs.docker}/bin/docker create --name archlinux ${toString archContainer.extraOptions} ${toString (map (v: "-v ${v}") archContainer.volumes)} ${archContainer.image} tail -f /dev/null 40 | fi 41 | 42 | echo "Ensuring Arch Linux container is running..." 43 | CONTAINER_STATUS=$(${pkgs.docker}/bin/docker inspect -f '{{.State.Status}}' archlinux) 44 | if [ "$CONTAINER_STATUS" != "running" ]; then 45 | echo "Starting Arch Linux container..." 46 | ${pkgs.docker}/bin/docker start archlinux 47 | sleep 2 # Give the container a moment to start up 48 | fi 49 | 50 | echo "Entering Arch Linux container..." 51 | exec ${pkgs.docker}/bin/docker exec -it archlinux /bin/bash 52 | '') 53 | (writeScriptBin "debug-arch-container" '' 54 | #!${pkgs.stdenv.shell} 55 | echo "Arch container configuration:" 56 | echo "Image: ${archContainer.image}" 57 | echo "AutoStart: ${toString archContainer.autoStart}" 58 | echo "Volumes: ${toString archContainer.volumes}" 59 | echo "Extra options: ${toString archContainer.extraOptions}" 60 | echo "Container Status:" 61 | ${pkgs.docker}/bin/docker inspect archlinux 62 | '') 63 | ]; 64 | 65 | # Ensure Docker service is enabled 66 | virtualisation.docker.enable = true; 67 | } -------------------------------------------------------------------------------- /modules/docker/Other/arch-ttr-terminal-only.nix: -------------------------------------------------------------------------------- 1 | # Arch in command line only. No X-Server 2 | 3 | { config, lib, pkgs, ... }: 4 | 5 | let 6 | username = "ttr"; 7 | containerName = "arch-${username}"; 8 | userHome = "/home/${username}"; 9 | archContainer = config.virtualisation.oci-containers.containers.${containerName}; 10 | in 11 | { 12 | virtualisation.oci-containers.containers = { 13 | ${containerName} = { 14 | image = "quay.io/toolbx/arch-toolbox:latest"; 15 | autoStart = true; 16 | volumes = [ 17 | "${userHome}:${userHome}" 18 | "/media:/media" 19 | "/mnt:/mnt" 20 | "/etc/resolv.conf:/etc/resolv.conf:ro" 21 | ]; 22 | extraOptions = [ 23 | "--network=host" 24 | "--security-opt=label=disable" 25 | "--security-opt=seccomp=unconfined" 26 | "--device=/dev/fuse" 27 | "--cap-add=CAP_SYS_ADMIN" 28 | "--cap-add=CAP_NET_ADMIN" 29 | ]; 30 | cmd = [ "tail" "-f" "/dev/null" ]; 31 | }; 32 | }; 33 | 34 | environment.systemPackages = with pkgs; [ 35 | distrobox 36 | (writeScriptBin "enter-arch-${username}" '' 37 | #!${pkgs.stdenv.shell} 38 | set -e 39 | echo "Checking ${containerName} container status..." 40 | if ! ${pkgs.docker}/bin/docker ps -a | grep -q ${containerName}; then 41 | echo "${containerName} container not found. Creating it..." 42 | ${pkgs.docker}/bin/docker create --name ${containerName} ${toString archContainer.extraOptions} ${toString (map (v: "-v ${v}") archContainer.volumes)} ${archContainer.image} tail -f /dev/null 43 | fi 44 | 45 | echo "Ensuring ${containerName} container is running..." 46 | CONTAINER_STATUS=$(${pkgs.docker}/bin/docker inspect -f '{{.State.Status}}' ${containerName}) 47 | if [ "$CONTAINER_STATUS" != "running" ]; then 48 | echo "Starting ${containerName} container..." 49 | ${pkgs.docker}/bin/docker start ${containerName} 50 | fi 51 | 52 | echo "Setting up user ${username} in the container..." 53 | ${pkgs.docker}/bin/docker exec ${containerName} bash -c " 54 | if ! id ${username} &>/dev/null; then 55 | useradd -m -u $(id -u ${username}) ${username} 56 | echo '${username} ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers 57 | fi 58 | " 59 | 60 | echo "Entering ${containerName} container..." 61 | exec ${pkgs.docker}/bin/docker exec -it -u ${username} -e HOME=${userHome} ${containerName} /bin/bash 62 | '') 63 | (writeScriptBin "debug-${containerName}" '' 64 | #!${pkgs.stdenv.shell} 65 | echo "${containerName} configuration:" 66 | echo "Image: ${archContainer.image}" 67 | echo "AutoStart: ${toString archContainer.autoStart}" 68 | echo "Volumes: ${toString archContainer.volumes}" 69 | echo "Extra options: ${toString archContainer.extraOptions}" 70 | echo "Container Status:" 71 | ${pkgs.docker}/bin/docker inspect ${containerName} 72 | echo "User in container:" 73 | ${pkgs.docker}/bin/docker exec ${containerName} id ${username} || echo "User ${username} not found in container" 74 | '') 75 | ]; 76 | 77 | # Ensure Docker service is enabled 78 | virtualisation.docker.enable = true; 79 | } -------------------------------------------------------------------------------- /modules/docker/arch-ttr.nix: -------------------------------------------------------------------------------- 1 | # TO LAUNCH CONTAINER: enter-arch-> 2 | # TO EXPORT AND GET LAUNCH COMMAND: export-app- 3 | 4 | { config, lib, pkgs, ... }: 5 | 6 | let 7 | username = "ttr"; 8 | containerName = "arch-${username}"; 9 | userHome = "/home/${username}"; 10 | archContainer = config.virtualisation.oci-containers.containers.${containerName}; 11 | userDesktopFilePath = "${userHome}/.local/share/applications"; 12 | in 13 | { 14 | virtualisation.oci-containers.containers = { 15 | ${containerName} = { 16 | image = "quay.io/toolbx/arch-toolbox:latest"; 17 | autoStart = true; 18 | volumes = [ 19 | "${userHome}:${userHome}" 20 | "/media:/media" 21 | "/mnt:/mnt" 22 | "/etc/resolv.conf:/etc/resolv.conf:ro" 23 | "/tmp/.X11-unix:/tmp/.X11-unix" 24 | "/run/user/1000:/run/user/1000" 25 | ]; 26 | environment = { 27 | DISPLAY = ":0"; 28 | WAYLAND_DISPLAY = "wayland-0"; 29 | XDG_RUNTIME_DIR = "/run/user/1000"; 30 | }; 31 | extraOptions = [ 32 | "--network=host" 33 | "--security-opt=label=disable" 34 | "--security-opt=seccomp=unconfined" 35 | "--device=/dev/fuse" 36 | "--cap-add=CAP_SYS_ADMIN" 37 | "--cap-add=CAP_NET_ADMIN" 38 | "--ipc=host" 39 | ]; 40 | cmd = [ "tail" "-f" "/dev/null" ]; 41 | }; 42 | }; 43 | 44 | environment.systemPackages = with pkgs; [ 45 | distrobox 46 | (writeScriptBin "enter-arch-${username}" '' 47 | #!${pkgs.stdenv.shell} 48 | set -e 49 | echo "Checking ${containerName} container status..." 50 | if ! ${pkgs.docker}/bin/docker ps -a | grep -q ${containerName}; then 51 | echo "${containerName} container not found. Creating it..." 52 | ${pkgs.docker}/bin/docker create --name ${containerName} \ 53 | ${toString archContainer.extraOptions} \ 54 | ${toString (map (v: "-v ${v}") archContainer.volumes)} \ 55 | ${toString (lib.mapAttrsToList (k: v: "-e ${k}=${v}") archContainer.environment)} \ 56 | ${archContainer.image} tail -f /dev/null 57 | fi 58 | 59 | echo "Ensuring ${containerName} container is running..." 60 | CONTAINER_STATUS=$(${pkgs.docker}/bin/docker inspect -f '{{.State.Status}}' ${containerName}) 61 | if [ "$CONTAINER_STATUS" != "running" ]; then 62 | echo "Starting ${containerName} container..." 63 | ${pkgs.docker}/bin/docker start ${containerName} 64 | fi 65 | 66 | echo "Setting up user ${username} in the container..." 67 | ${pkgs.docker}/bin/docker exec ${containerName} bash -c " 68 | if ! id ${username} &>/dev/null; then 69 | useradd -m -u $(id -u ${username}) ${username} 70 | echo '${username} ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers 71 | fi 72 | # Install necessary packages for GUI applications 73 | pacman -Syu --noconfirm xorg-xhost 74 | " 75 | 76 | echo "Entering ${containerName} container..." 77 | xhost +local: # Allow local connections to X server 78 | exec ${pkgs.docker}/bin/docker exec -it \ 79 | -u ${username} \ 80 | -e HOME=${userHome} \ 81 | -e DISPLAY=$DISPLAY \ 82 | -e WAYLAND_DISPLAY=$WAYLAND_DISPLAY \ 83 | -e XDG_RUNTIME_DIR=$XDG_RUNTIME_DIR \ 84 | -w ${userHome} \ 85 | ${containerName} /bin/bash 86 | '') 87 | (writeScriptBin "export-app-${username}" '' 88 | #!${pkgs.stdenv.shell} 89 | set -e 90 | if [ "$1" = "" ]; then 91 | echo "Usage: export-app-${username} " 92 | exit 1 93 | fi 94 | APP="$1" 95 | DESKTOP_FILE="${userDesktopFilePath}/$APP-${containerName}.desktop" 96 | EXEC_COMMAND="${pkgs.docker}/bin/docker exec -it --user ${username} ${containerName} $APP" 97 | 98 | ${pkgs.docker}/bin/docker exec ${containerName} bash -c " 99 | if ! command -v $APP &> /dev/null; then 100 | echo \"$APP is not installed in the container. Installing...\" 101 | sudo pacman -Syu --noconfirm $APP 102 | fi 103 | " 104 | 105 | mkdir -p "${userDesktopFilePath}" 106 | cat > "$DESKTOP_FILE" << EOF 107 | [Desktop Entry] 108 | Name=$APP (${containerName}) 109 | Exec=$EXEC_COMMAND 110 | Icon=application-x-executable 111 | Type=Application 112 | Categories=Distrobox; 113 | EOF 114 | 115 | chmod +x "$DESKTOP_FILE" 116 | 117 | echo "Application $APP has been exported from ${containerName}." 118 | echo "It should now appear in your application launcher." 119 | echo "To run it from the command line, use:" 120 | echo "$EXEC_COMMAND" 121 | echo "If the application doesn't appear in your launcher, you may need to log out and log back in." 122 | '') 123 | (writeScriptBin "debug-${containerName}" '' 124 | #!${pkgs.stdenv.shell} 125 | echo "${containerName} configuration:" 126 | echo "Image: ${archContainer.image}" 127 | echo "AutoStart: ${toString archContainer.autoStart}" 128 | echo "Volumes: ${toString archContainer.volumes}" 129 | echo "Environment: ${toString (lib.mapAttrsToList (k: v: "${k}=${v}") archContainer.environment)}" 130 | echo "Extra options: ${toString archContainer.extraOptions}" 131 | echo "Container Status:" 132 | ${pkgs.docker}/bin/docker inspect ${containerName} 133 | echo "User in container:" 134 | ${pkgs.docker}/bin/docker exec ${containerName} id ${username} || echo "User ${username} not found in container" 135 | '') 136 | ]; 137 | 138 | # Ensure Docker service is enabled 139 | virtualisation.docker.enable = true; 140 | 141 | # Append to the existing XDG_DATA_DIRS environment variable 142 | environment.extraInit = '' 143 | export XDG_DATA_DIRS="$HOME/.local/share:$XDG_DATA_DIRS" 144 | ''; 145 | } -------------------------------------------------------------------------------- /modules/docker/docker-updates-with-rebuild.nix: -------------------------------------------------------------------------------- 1 | { config, lib, pkgs, ... }: 2 | 3 | { 4 | # Service that runs during system activation 5 | system.activationScripts.dockerContainerUpdates = { 6 | text = '' 7 | echo "Updating Docker containers..." 8 | 9 | # Pull latest images 10 | ${pkgs.docker}/bin/docker pull rogerfar/rdtclient:latest || true 11 | ${pkgs.docker}/bin/docker pull lscr.io/linuxserver/lidarr:latest || true 12 | ${pkgs.docker}/bin/docker pull lscr.io/linuxserver/jackett:latest || true 13 | ${pkgs.docker}/bin/docker pull ghcr.io/hotio/sonarr:latest || true 14 | ${pkgs.docker}/bin/docker pull lscr.io/linuxserver/syncthing:latest || true 15 | ${pkgs.docker}/bin/docker pull vaultwarden/server:latest || true 16 | ${pkgs.docker}/bin/docker pull portainer/portainer-ce:latest || true 17 | ${pkgs.docker}/bin/docker pull searxng/searxng:latest || true 18 | ${pkgs.docker}/bin/docker pull redis:alpine || true 19 | ${pkgs.docker}/bin/docker pull ferdium/ferdium-server:latest || true 20 | ${pkgs.docker}/bin/docker pull jellyfin/jellyfin:latest || true 21 | 22 | # Restart containers to use new images 23 | echo "Restarting containers with new images..." 24 | ${pkgs.docker}/bin/docker container restart rdt || true 25 | ${pkgs.docker}/bin/docker container restart lidarr || true 26 | ${pkgs.docker}/bin/docker container restart jackett || true 27 | ${pkgs.docker}/bin/docker container restart sonarr || true 28 | ${pkgs.docker}/bin/docker container restart syncthing || true 29 | ${pkgs.docker}/bin/docker container restart vaultwarden || true 30 | ${pkgs.docker}/bin/docker container restart portainer || true 31 | ${pkgs.docker}/bin/docker container restart searxng || true 32 | ${pkgs.docker}/bin/docker container restart redis || true 33 | ${pkgs.docker}/bin/docker container restart ferdium || true 34 | ${pkgs.docker}/bin/docker container restart jellyfin || true 35 | ''; 36 | deps = []; 37 | }; 38 | 39 | # Keep the daily timer as a backup 40 | systemd.timers."docker-containers-update" = { 41 | wantedBy = [ "timers.target" ]; 42 | timerConfig = { 43 | OnCalendar = "daily"; 44 | Persistent = true; 45 | }; 46 | }; 47 | 48 | systemd.services."docker-containers-update" = { 49 | script = '' 50 | echo "Running scheduled Docker container updates..." 51 | 52 | # Pull latest images 53 | ${pkgs.docker}/bin/docker pull rogerfar/rdtclient:latest || true 54 | ${pkgs.docker}/bin/docker pull lscr.io/linuxserver/lidarr:latest || true 55 | ${pkgs.docker}/bin/docker pull lscr.io/linuxserver/jackett:latest || true 56 | ${pkgs.docker}/bin/docker pull ghcr.io/hotio/sonarr:latest || true 57 | ${pkgs.docker}/bin/docker pull lscr.io/linuxserver/syncthing:latest || true 58 | ${pkgs.docker}/bin/docker pull vaultwarden/server:latest || true 59 | ${pkgs.docker}/bin/docker pull portainer/portainer-ce:latest || true 60 | ${pkgs.docker}/bin/docker pull searxng/searxng:latest || true 61 | ${pkgs.docker}/bin/docker pull redis:alpine || true 62 | ${pkgs.docker}/bin/docker pull ferdium/ferdium-server:latest || true 63 | ${pkgs.docker}/bin/docker pull jellyfin/jellyfin:latest || true 64 | 65 | # Restart containers 66 | ${pkgs.docker}/bin/docker container restart rdt || true 67 | ${pkgs.docker}/bin/docker container restart lidarr || true 68 | ${pkgs.docker}/bin/docker container restart jackett || true 69 | ${pkgs.docker}/bin/docker container restart sonarr || true 70 | ${pkgs.docker}/bin/docker container restart syncthing || true 71 | ${pkgs.docker}/bin/docker container restart vaultwarden || true 72 | ${pkgs.docker}/bin/docker container restart portainer || true 73 | ${pkgs.docker}/bin/docker container restart searxng || true 74 | ${pkgs.docker}/bin/docker container restart redis || true 75 | ${pkgs.docker}/bin/docker container restart ferdium || true 76 | ${pkgs.docker}/bin/docker container restart jellyfin || true 77 | ''; 78 | serviceConfig = { 79 | Type = "oneshot"; 80 | User = "root"; 81 | }; 82 | }; 83 | } -------------------------------------------------------------------------------- /modules/docker/docker-updates.nix: -------------------------------------------------------------------------------- 1 | { config, lib, pkgs, ... }: 2 | 3 | { 4 | # Timer to run updates daily at 3am 5 | systemd.timers."docker-containers-update" = { 6 | wantedBy = [ "timers.target" ]; 7 | timerConfig = { 8 | OnCalendar = "*-*-* 03:00:00"; # Run at 3am every day 9 | Persistent = true; # Run on next boot if system was down at scheduled time 10 | }; 11 | }; 12 | 13 | systemd.services."docker-containers-update" = { 14 | script = '' 15 | echo "Running scheduled Docker container updates..." 16 | 17 | # Pull latest images 18 | ${pkgs.docker}/bin/docker pull rogerfar/rdtclient:latest || true 19 | ${pkgs.docker}/bin/docker pull lscr.io/linuxserver/lidarr:latest || true 20 | ${pkgs.docker}/bin/docker pull lscr.io/linuxserver/jackett:latest || true 21 | ${pkgs.docker}/bin/docker pull ghcr.io/hotio/sonarr:latest || true 22 | ${pkgs.docker}/bin/docker pull lscr.io/linuxserver/syncthing:latest || true 23 | ${pkgs.docker}/bin/docker pull vaultwarden/server:latest || true 24 | ${pkgs.docker}/bin/docker pull portainer/portainer-ce:latest || true 25 | ${pkgs.docker}/bin/docker pull searxng/searxng:latest || true 26 | ${pkgs.docker}/bin/docker pull redis:alpine || true 27 | ${pkgs.docker}/bin/docker pull ferdium/ferdium-server:latest || true 28 | ${pkgs.docker}/bin/docker pull jellyfin/jellyfin:latest || true 29 | 30 | # Wait a moment for pulls to complete 31 | sleep 30 32 | 33 | # Restart containers 34 | ${pkgs.docker}/bin/docker container restart rdt || true 35 | ${pkgs.docker}/bin/docker container restart lidarr || true 36 | ${pkgs.docker}/bin/docker container restart jackett || true 37 | ${pkgs.docker}/bin/docker container restart sonarr || true 38 | ${pkgs.docker}/bin/docker container restart syncthing || true 39 | ${pkgs.docker}/bin/docker container restart vaultwarden || true 40 | ${pkgs.docker}/bin/docker container restart portainer || true 41 | ${pkgs.docker}/bin/docker container restart searxng || true 42 | ${pkgs.docker}/bin/docker container restart redis || true 43 | ${pkgs.docker}/bin/docker container restart ferdium || true 44 | ${pkgs.docker}/bin/docker container restart jellyfin || true 45 | 46 | echo "Docker container updates completed" 47 | ''; 48 | serviceConfig = { 49 | Type = "oneshot"; 50 | User = "root"; 51 | }; 52 | # Add some safety measures 53 | startLimitIntervalSec = 300; # 5 minutes 54 | startLimitBurst = 3; # Allow 3 restarts within 5 minutes 55 | }; 56 | } -------------------------------------------------------------------------------- /modules/docker/ferdium.nix: -------------------------------------------------------------------------------- 1 | { config, lib, pkgs, ... }: 2 | 3 | { 4 | virtualisation.oci-containers.containers = { 5 | ferdium = { 6 | image = "ferdium/ferdium-server:latest"; 7 | environment = { 8 | NODE_ENV = "production"; 9 | APP_URL = "https://ferdium.dummy.com/"; 10 | DB_CONNECTION = "sqlite"; 11 | DB_HOST = "127.0.0.1"; 12 | DB_PORT = "3306"; 13 | DB_USER = "root"; 14 | DB_PASSWORD = "XXXXXXXX"; 15 | DB_DATABASE = "ferdium"; 16 | DB_SSL = "false"; 17 | MAIL_CONNECTION = "smtp"; 18 | SMTP_HOST = "127.0.0.1"; 19 | SMTP_PORT = "2525"; 20 | MAIL_SSL = "false"; 21 | MAIL_USERNAME = "username"; 22 | MAIL_PASSWORD = "password"; 23 | MAIL_SENDER = "noreply@dummy.com"; 24 | IS_CREATION_ENABLED = "true"; 25 | IS_DASHBOARD_ENABLED = "true"; 26 | IS_REGISTRATION_ENABLED = "true"; 27 | CONNECT_WITH_FRANZ = "false"; 28 | DATA_DIR = "/data"; 29 | JWT_USE_PEM = "true"; 30 | PUID = "1000"; 31 | PGID = "1000"; 32 | TZ = "America/New_York"; 33 | AUTO_UPDATE = "true"; 34 | }; 35 | volumes = [ 36 | "/mnt/12tb/docker/ferdium/data/:/data" 37 | "/mnt/12tb/docker/ferdium/data/tmp:/app/build/tmp" 38 | "/mnt/12tb/docker/ferdium/data//recipes:/app/build/recipes" 39 | ]; 40 | ports = [ 41 | "3333:3333" 42 | ]; 43 | autoStart = true; 44 | extraOptions = [ 45 | "--network=host" 46 | ]; 47 | }; 48 | }; 49 | 50 | # Enable Docker 51 | virtualisation.docker.enable = true; 52 | 53 | # Open firewall port 54 | networking.firewall.allowedTCPPorts = [ 3333 ]; 55 | } -------------------------------------------------------------------------------- /modules/docker/jackett.nix: -------------------------------------------------------------------------------- 1 | { config, lib, pkgs, ... }: 2 | 3 | { 4 | virtualisation.oci-containers.containers = { 5 | jackett = { 6 | image = "lscr.io/linuxserver/jackett:latest"; 7 | environment = { 8 | PUID = "1000"; 9 | PGID = "1000"; 10 | TZ = "America/New_York"; 11 | AUTO_UPDATE = "true"; 12 | RUN_OPTS = ""; 13 | }; 14 | volumes = [ 15 | "/mnt/12tb/docker/jackett/data:/config" 16 | "/mnt/12tb/docker/jackett/blackhole:/downloads" 17 | ]; 18 | ports = [ 19 | "9117:9117" 20 | ]; 21 | autoStart = true; 22 | extraOptions = [ 23 | # "--sysctl=net.ipv6.conf.all.disable_ipv6=1" #this will block connections! 24 | ]; 25 | }; 26 | }; 27 | 28 | # Enable Docker 29 | virtualisation.docker.enable = true; 30 | 31 | # Open firewall port 32 | networking.firewall.allowedTCPPorts = [ 9117 ]; 33 | } -------------------------------------------------------------------------------- /modules/docker/jellyfin.nix: -------------------------------------------------------------------------------- 1 | { config, lib, pkgs, ... }: 2 | 3 | { 4 | virtualisation.oci-containers.containers = { 5 | container-name = { 6 | image = "jellyfin/jellyfin:latest"; 7 | environment = { 8 | PUID = "1000"; 9 | PGID = "1000"; 10 | UMASK = "002"; 11 | TZ = "America/New_YorkTC"; 12 | }; 13 | volumes = [ 14 | "/mnt/12tb/Jellyfin_Media:/data" 15 | "/mnt/12tb/docker/jellyfin/config:/config" 16 | 17 | ]; 18 | ports = [ 19 | "8096:8096" 20 | # More port mappings as needed 21 | ]; 22 | autoStart = true; 23 | extraOptions = [ 24 | # Add "--network=host" only if necessary 25 | # "--network=host" 26 | ]; 27 | }; 28 | }; 29 | 30 | # Open necessary firewall ports 31 | networking.firewall.allowedTCPPorts = [ 8096 ]; 32 | } -------------------------------------------------------------------------------- /modules/docker/lidarr.nix: -------------------------------------------------------------------------------- 1 | # copy and paste this into your new .nix and then add stuff from docker-compose that you want to convert 2 | 3 | { config, lib, pkgs, ... }: 4 | 5 | { 6 | virtualisation.oci-containers.containers = { 7 | lidarr = { 8 | image = "lscr.io/linuxserver/lidarr:latest"; 9 | environment = { 10 | # Environment variables here (look at other nix files for examples) 11 | PUID = "1000"; 12 | PGID = "1000"; 13 | UMASK = "002"; 14 | TZ = "America/New_York"; 15 | }; 16 | volumes = [ 17 | "/mnt/12tb/docker/lidarr:/config" 18 | "/mnt/12tb/data:/data" 19 | #"/mnt/12tb/data/downloads/music-lidarr:/downloads" 20 | ]; 21 | ports = [ 22 | "8686:8686" 23 | # More port mappings as needed 24 | ]; 25 | autoStart = true; 26 | extraOptions = [ 27 | # Add "--network=host" only if necessary 28 | # "--network=host" 29 | ]; 30 | }; 31 | }; 32 | 33 | # Enable Docker 34 | virtualisation.docker.enable = true; 35 | 36 | # Open necessary firewall ports 37 | networking.firewall.allowedTCPPorts = [ 8686 ]; 38 | } -------------------------------------------------------------------------------- /modules/docker/navidrome.nix: -------------------------------------------------------------------------------- 1 | { config, lib, pkgs, ... }: 2 | 3 | { 4 | virtualisation.oci-containers.containers = { 5 | navidrome = { 6 | image = "deluan/navidrome:latest"; 7 | user = "1000:1000"; 8 | environment = { 9 | ND_SCANSCHEDULE = "1h"; 10 | ND_LOGLEVEL = "info"; 11 | ND_SESSIONTIMEOUT = "24h"; 12 | ND_BASEURL = ""; 13 | }; 14 | volumes = [ 15 | "/12tb/Backups/Mega_NZ_Backup/Documents/docker/navidrome:/data" 16 | "/12tb/Backups/BIG_Backups/Music:/music:ro" 17 | ]; 18 | ports = [ 19 | "4533:4533" 20 | ]; 21 | autoStart = true; 22 | }; 23 | }; 24 | 25 | # Enable Docker 26 | virtualisation.docker.enable = true; 27 | 28 | # Open firewall port 29 | networking.firewall.allowedTCPPorts = [ 4533 ]; 30 | } 31 | -------------------------------------------------------------------------------- /modules/docker/portainer.nix: -------------------------------------------------------------------------------- 1 | { config, lib, pkgs, ... }: 2 | 3 | { 4 | virtualisation.oci-containers.containers = { 5 | portainer = { 6 | image = "portainer/portainer-ce:latest"; 7 | volumes = [ 8 | "/var/run/docker.sock:/var/run/docker.sock" 9 | "portainer_data:/data" 10 | ]; 11 | ports = [ 12 | "8009:8009" 13 | "9443:9443" 14 | ]; 15 | autoStart = true; 16 | }; 17 | }; 18 | 19 | # Enable Docker 20 | virtualisation.docker.enable = true; 21 | 22 | # Open firewall ports 23 | networking.firewall.allowedTCPPorts = [ 8009 9443 ]; 24 | } -------------------------------------------------------------------------------- /modules/docker/rdt.nix: -------------------------------------------------------------------------------- 1 | { config, lib, pkgs, ... }: 2 | 3 | { 4 | virtualisation.oci-containers.containers = { 5 | rdt = { 6 | image = "rogerfar/rdtclient:latest"; 7 | environment = { 8 | PUID = "1000"; 9 | PGID = "1000"; 10 | UMASK = "002"; 11 | TZ = "America/New_York"; 12 | }; 13 | volumes = [ 14 | "/mnt/12tb/data/downloads:/data/downloads" 15 | "/mnt/12tb/docker/rdt/data/db:/data/db" 16 | ]; 17 | ports = [ 18 | "6500:6500" 19 | ]; 20 | autoStart = true; 21 | }; 22 | }; 23 | 24 | # Enable Docker 25 | virtualisation.docker.enable = true; 26 | 27 | # Open firewall port 28 | networking.firewall.allowedTCPPorts = [ 6500 ]; 29 | } -------------------------------------------------------------------------------- /modules/docker/searxng.nix: -------------------------------------------------------------------------------- 1 | { config, lib, pkgs, ... }: 2 | 3 | let 4 | searxngDir = builtins.toString (./. + "/searxng"); 5 | in 6 | { 7 | virtualisation.docker.enable = true; 8 | 9 | virtualisation.oci-containers.containers = { 10 | redis = { 11 | image = "redis:alpine"; 12 | ports = [ 13 | "6379:6379" 14 | ]; 15 | }; 16 | 17 | searxng = { 18 | image = "searxng/searxng:latest"; 19 | environment = { 20 | SEARXNG_BASE_URL = "http://localhost:8092"; 21 | REDIS_URL = "redis://localhost:6379/0"; 22 | }; 23 | volumes = [ 24 | "${searxngDir}:/etc/searxng:rw" 25 | ]; 26 | ports = [ 27 | "8092:8080" 28 | ]; 29 | dependsOn = [ "redis" ]; 30 | }; 31 | }; 32 | 33 | networking.firewall.allowedTCPPorts = [ 8092 ]; 34 | 35 | system.activationScripts = { 36 | createSearxngSettings = '' 37 | mkdir -p ${searxngDir} 38 | if [ ! -f ${searxngDir}/settings.yml ]; then 39 | cat > ${searxngDir}/settings.yml << EOL 40 | use_default_settings: true 41 | server: 42 | secret_key: "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" # change this! 43 | limiter: false # can be disabled for a private instance 44 | image_proxy: true 45 | ui: 46 | static_use_hash: true 47 | redis: 48 | url: redis://localhost:6379/0 49 | EOL 50 | fi 51 | ''; 52 | 53 | searxngPermissions = '' 54 | mkdir -p ${searxngDir} 55 | chown -R 1000:1000 ${searxngDir} 56 | chmod -R 755 ${searxngDir} 57 | ''; 58 | }; 59 | } -------------------------------------------------------------------------------- /modules/docker/searxng/settings.yml: -------------------------------------------------------------------------------- 1 | use_default_settings: true 2 | server: 3 | secret_key: "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" # change this! 4 | limiter: false # can be disabled for a private instance 5 | image_proxy: true 6 | ui: 7 | static_use_hash: true 8 | redis: 9 | url: redis://localhost:6379/0 10 | -------------------------------------------------------------------------------- /modules/docker/searxng/uwsgi.ini: -------------------------------------------------------------------------------- 1 | [uwsgi] 2 | # Who will run the code 3 | uid = searxng 4 | gid = searxng 5 | 6 | # Number of workers (usually CPU count) 7 | # default value: %k (= number of CPU core, see Dockerfile) 8 | workers = %k 9 | 10 | # Number of threads per worker 11 | # default value: 4 (see Dockerfile) 12 | threads = 4 13 | 14 | # The right granted on the created socket 15 | chmod-socket = 666 16 | 17 | # Plugin to use and interpreter config 18 | single-interpreter = true 19 | master = true 20 | plugin = python3 21 | lazy-apps = true 22 | enable-threads = 4 23 | 24 | # Module to import 25 | module = searx.webapp 26 | 27 | # Virtualenv and python path 28 | pythonpath = /usr/local/searxng/ 29 | chdir = /usr/local/searxng/searx/ 30 | 31 | # automatically set processes name to something meaningful 32 | auto-procname = true 33 | 34 | # Disable request logging for privacy 35 | disable-logging = true 36 | log-5xx = true 37 | 38 | # Set the max size of a request (request-body excluded) 39 | buffer-size = 8192 40 | 41 | # No keep alive 42 | # See https://github.com/searx/searx-docker/issues/24 43 | add-header = Connection: close 44 | 45 | # Follow SIGTERM convention 46 | # See https://github.com/searxng/searxng/issues/3427 47 | die-on-term 48 | 49 | # uwsgi serves the static files 50 | static-map = /static=/usr/local/searxng/searx/static 51 | # expires set to one day 52 | static-expires = /* 86400 53 | static-gzip-all = True 54 | offload-threads = 4 55 | -------------------------------------------------------------------------------- /modules/docker/sonarr.nix: -------------------------------------------------------------------------------- 1 | { config, lib, pkgs, ... }: 2 | 3 | { 4 | virtualisation.oci-containers.containers = { 5 | sonarr = { 6 | image = "ghcr.io/hotio/sonarr:latest"; 7 | environment = { 8 | PUID = "1000"; 9 | PGID = "1000"; 10 | UMASK = "002"; 11 | TZ = "America/New_York"; 12 | }; 13 | volumes = [ 14 | "/mnt/12tb/docker/sonarr:/config" 15 | "/mnt/12tb/data:/data" 16 | ]; 17 | ports = [ 18 | "8989:8989" 19 | ]; 20 | autoStart = true; 21 | }; 22 | }; 23 | 24 | # Enable Docker 25 | virtualisation.docker.enable = true; 26 | 27 | # Open firewall port 28 | networking.firewall.allowedTCPPorts = [ 8989 ]; 29 | } -------------------------------------------------------------------------------- /modules/docker/syncthing.nix: -------------------------------------------------------------------------------- 1 | { config, lib, pkgs, ... }: 2 | 3 | { 4 | virtualisation.oci-containers.containers = { 5 | syncthing = { 6 | image = "lscr.io/linuxserver/syncthing:latest"; 7 | environment = { 8 | PUID = "1000"; 9 | PGID = "1000"; 10 | TZ = "America/New_York"; 11 | }; 12 | volumes = [ 13 | "./config:/config" 14 | "/home/ttr/notes:/notes" 15 | ]; 16 | ports = [ 17 | "8384:8384" 18 | "22000:22000/tcp" 19 | "22000:22000/udp" 20 | "21027:21027/udp" 21 | ]; 22 | autoStart = true; 23 | extraOptions = [ 24 | "--hostname=syncthing" 25 | ]; 26 | }; 27 | }; 28 | 29 | # Enable Docker 30 | virtualisation.docker.enable = true; 31 | 32 | # Open firewall ports 33 | networking.firewall = { 34 | allowedTCPPorts = [ 8384 22000 ]; 35 | allowedUDPPorts = [ 22000 21027 ]; 36 | }; 37 | } -------------------------------------------------------------------------------- /modules/docker/template.nix: -------------------------------------------------------------------------------- 1 | # copy and paste this into your new .nix and then add stuff from docker-compose that you want to convert 2 | 3 | { config, lib, pkgs, ... }: 4 | 5 | { 6 | virtualisation.oci-containers.containers = { 7 | container-name-here = { 8 | image = "image-name:latest"; 9 | environment = { 10 | # Environment variables here (look at other nix files for examples) 11 | PUID = "1000"; 12 | PGID = "1000"; 13 | UMASK = "002"; 14 | TZ = "America/New_York"; 15 | }; 16 | volumes = [ 17 | "/host/path:/container/path" 18 | # More volume mappings as needed 19 | ]; 20 | ports = [ 21 | "host-port:container-port" 22 | # More port mappings as needed 23 | ]; 24 | autoStart = true; 25 | extraOptions = [ 26 | # Add "--network=host" only if necessary 27 | # "--network=host" 28 | ]; 29 | }; 30 | }; 31 | 32 | # Open necessary firewall ports 33 | networking.firewall.allowedTCPPorts = [ port-number ]; 34 | } -------------------------------------------------------------------------------- /modules/docker/vaultwarden.nix: -------------------------------------------------------------------------------- 1 | { config, lib, pkgs, ... }: 2 | 3 | { 4 | virtualisation.oci-containers.containers = { 5 | vaultwarden = { 6 | image = "vaultwarden/server:latest"; 7 | volumes = [ 8 | "/mnt/12tb/Backups/Mega_NZ_Backup/Documents/docker/vaultwarden:/data/" 9 | ]; 10 | ports = [ 11 | "4378:80" 12 | ]; 13 | autoStart = true; 14 | }; 15 | }; 16 | 17 | # Enable Docker 18 | virtualisation.docker.enable = true; 19 | 20 | # Open firewall port 21 | networking.firewall.allowedTCPPorts = [ 4378 ]; 22 | } -------------------------------------------------------------------------------- /modules/flakes/python/flake.lock: -------------------------------------------------------------------------------- 1 | { 2 | "nodes": { 3 | "flake-utils": { 4 | "inputs": { 5 | "systems": "systems" 6 | }, 7 | "locked": { 8 | "lastModified": 1731533236, 9 | "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", 10 | "owner": "numtide", 11 | "repo": "flake-utils", 12 | "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", 13 | "type": "github" 14 | }, 15 | "original": { 16 | "owner": "numtide", 17 | "repo": "flake-utils", 18 | "type": "github" 19 | } 20 | }, 21 | "nixpkgs": { 22 | "locked": { 23 | "lastModified": 1733759999, 24 | "narHash": "sha256-463SNPWmz46iLzJKRzO3Q2b0Aurff3U1n0nYItxq7jU=", 25 | "owner": "nixos", 26 | "repo": "nixpkgs", 27 | "rev": "a73246e2eef4c6ed172979932bc80e1404ba2d56", 28 | "type": "github" 29 | }, 30 | "original": { 31 | "owner": "nixos", 32 | "ref": "nixos-unstable", 33 | "repo": "nixpkgs", 34 | "type": "github" 35 | } 36 | }, 37 | "root": { 38 | "inputs": { 39 | "flake-utils": "flake-utils", 40 | "nixpkgs": "nixpkgs" 41 | } 42 | }, 43 | "systems": { 44 | "locked": { 45 | "lastModified": 1681028828, 46 | "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", 47 | "owner": "nix-systems", 48 | "repo": "default", 49 | "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", 50 | "type": "github" 51 | }, 52 | "original": { 53 | "owner": "nix-systems", 54 | "repo": "default", 55 | "type": "github" 56 | } 57 | } 58 | }, 59 | "root": "root", 60 | "version": 7 61 | } 62 | -------------------------------------------------------------------------------- /modules/flakes/python/flake.nix: -------------------------------------------------------------------------------- 1 | { 2 | description = "Python Development Environment"; 3 | 4 | inputs = { 5 | nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; 6 | flake-utils.url = "github:numtide/flake-utils"; 7 | }; 8 | 9 | outputs = { self, nixpkgs, flake-utils }: 10 | flake-utils.lib.eachDefaultSystem (system: 11 | let 12 | pkgs = import nixpkgs { 13 | inherit system; 14 | config.allowUnfree = true; 15 | }; 16 | 17 | pythonEnv = pkgs.python311.withPackages (ps: with ps; [ 18 | # Web Scraping & Network 19 | requests 20 | beautifulsoup4 21 | httpx 22 | 23 | # Data Processing 24 | numpy 25 | pandas 26 | 27 | # Your commonly used packages based on realitypics_6.py 28 | requests 29 | beautifulsoup4 30 | 31 | # Additional Utilities 32 | python-dotenv 33 | pyyaml 34 | rich 35 | tqdm 36 | 37 | # Development Tools 38 | pip 39 | black 40 | mypy 41 | pylint 42 | pytest 43 | ipython 44 | ]); 45 | 46 | # Create a wrapper script to run Python files 47 | pythonWrapper = pkgs.writeScriptBin "runpy" '' 48 | #!${pkgs.bash}/bin/bash 49 | if [ -z "$1" ]; then 50 | echo "Usage: runpy " 51 | exit 1 52 | fi 53 | 54 | exec ${pythonEnv}/bin/python "$@" 55 | ''; 56 | 57 | in { 58 | devShells.default = pkgs.mkShell { 59 | name = "python-dev"; 60 | 61 | buildInputs = with pkgs; [ 62 | pythonEnv 63 | pythonWrapper 64 | nodePackages.pyright 65 | ruff 66 | ]; 67 | 68 | shellHook = '' 69 | echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" 70 | echo "🐍 Python Development Environment" 71 | echo "Python version: $(python --version)" 72 | echo "" 73 | echo "🛠️ Available commands:" 74 | echo "- runpy : Run a Python script" 75 | echo "- python : Start Python REPL" 76 | echo "" 77 | echo "💡 Example: runpy ~/.scripts/cfpics_scripts/realitypics_6.py" 78 | echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" 79 | 80 | # Add script directories to PATH 81 | export PATH="$PATH:$HOME/.scripts:$HOME/.scripts/cfpics_scripts" 82 | ''; 83 | }; 84 | 85 | # Add an app that can be run with 'nix run' 86 | apps.default = { 87 | type = "app"; 88 | program = "${pythonWrapper}/bin/runpy"; 89 | }; 90 | } 91 | ); 92 | } -------------------------------------------------------------------------------- /modules/flakes/template/flake.nix: -------------------------------------------------------------------------------- 1 | { 2 | description = "Development Environment Template"; 3 | 4 | inputs = { 5 | nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; 6 | flake-utils.url = "github:numtide/flake-utils"; 7 | }; 8 | 9 | outputs = { self, nixpkgs, flake-utils }: 10 | flake-utils.lib.eachDefaultSystem (system: 11 | let 12 | pkgs = import nixpkgs { 13 | inherit system; 14 | config.allowUnfree = true; 15 | }; 16 | in { 17 | devShells.default = pkgs.mkShell { 18 | name = "dev-environment"; 19 | 20 | buildInputs = with pkgs; [ 21 | # Add your packages here 22 | ]; 23 | 24 | shellHook = '' 25 | echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" 26 | echo "Development Environment" 27 | echo "" 28 | echo "🛠️ Available tools:" 29 | echo "- List your tools here" 30 | echo "" 31 | echo "💡 Additional information" 32 | echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" 33 | ''; 34 | }; 35 | } 36 | ); 37 | } -------------------------------------------------------------------------------- /modules/notes.md: -------------------------------------------------------------------------------- 1 | # Update pinned programs 2 | To update the pinned packages, you would just need to update two things in that flake.nix pinned overlay block: 3 | 4 | 1. The commit hash in the URL 5 | 2. The sha256 hash 6 | 7 | ```nix 8 | pinnedPkgs = import (fetchTarball { 9 | url = "https://github.com/nixos/nixpkgs/archive/a73246e2eef4c6ed172979932bc80e1404ba2d56.tar.gz"; # <- Update this hash 10 | sha256 = "sha256-463SNPWmz46iLzJKRzO3Q2b0Aurff3U1n0nYItxq7jU="; # <- And this hash 11 | }) { system = final.system; }; 12 | ``` 13 | 14 | You can get these values from a newer `flake.lock` after doing a `flake update`. Look for the `nixpkgs` entry in your lock file, which will have: 15 | - `rev`: use this in the URL 16 | - `narHash`: use this as the sha256 17 | 18 | The rest of your pinned packages will automatically use the new versions from that revision without needing any other changes. 19 | 20 | # Docker Updates: 21 | `docker-updates.nix` uses systemD timer and will run docker updates every day at 3am. 22 | `docker-updates-with-rebuild.nix` does the same but will also update docker containers with every rebuild. 23 | 24 | # New Flakes in environment setups 25 | Flakes will not work until they are added to git. For dev environments you may have to manually add it. 26 | Example for python: 27 | 28 | ``` 29 | # Add to git (Only need to run this if build script is not woking) 30 | cd ~/nixos-config 31 | git add modules/flakes/python/ 32 | git commit -m "Add Python development flake" 33 | git push origin master 34 | 35 | # Force create lock file 36 | cd ~/nixos-config/modules/flakes/python 37 | nix flake lock --recreate-lock-file 38 | ``` -------------------------------------------------------------------------------- /modules/scripts/flake-pull.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -euo pipefail 4 | 5 | echo "Pulling NixOS configuration changes..." 6 | 7 | # Change to the nixos-config directory 8 | cd ~/nixos-config 9 | 10 | # Fetch the latest changes 11 | echo "Fetching latest changes from remote..." 12 | git fetch origin 13 | 14 | # Check if there are any changes 15 | if git diff --quiet HEAD origin/master; then 16 | echo "No new changes to pull." 17 | else 18 | # Pull changes 19 | echo "Pulling changes excluding hardware-configuration.nix..." 20 | git pull origin master 21 | 22 | # Checkout files from origin/master, excluding hardware-configuration.nix 23 | git checkout origin/master -- . ':!hardware-configuration.nix' 24 | 25 | echo "Changes pulled successfully." 26 | 27 | # Show a summary of changes 28 | echo "Summary of changes:" 29 | git --no-pager log --oneline HEAD@{1}.. 30 | fi 31 | 32 | echo "Pull operation complete." -------------------------------------------------------------------------------- /modules/scripts/flake-push.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -euo pipefail 4 | 5 | echo "Pushing NixOS configuration changes..." 6 | 7 | # Change to the nixos-config directory 8 | cd ~/nixos-config 9 | 10 | # Check if there are any changes 11 | if git diff-index --quiet HEAD --; then 12 | echo "No changes to commit." 13 | exit 0 14 | fi 15 | 16 | # Git operations 17 | echo "Committing changes to git..." 18 | git add . 19 | 20 | # Prompt for commit message 21 | read -p "Enter a commit message (default: 'Update NixOS configuration'): " commit_message 22 | commit_message=${commit_message:-"Update NixOS configuration"} 23 | git commit -m "$commit_message" 24 | 25 | # Prompt for confirmation before force pushing 26 | echo "Warning: You are about to force push to the master branch." 27 | read -p "Are you sure you want to continue? This may overwrite remote changes. (y/N): " confirm 28 | if [[ $confirm =~ ^[Yy]$ ]]; then 29 | echo "Force pushing changes to remote repository..." 30 | git push origin master --force 31 | echo "Push complete." 32 | else 33 | echo "Push aborted." 34 | exit 1 35 | fi 36 | 37 | echo "NixOS configuration push complete!" -------------------------------------------------------------------------------- /modules/scripts/optiplex-flake-build.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -euo pipefail 4 | 5 | echo "Building and updating NixOS flake configuration..." 6 | 7 | # Change to the nixos-config directory 8 | cd ~/nixos-config 9 | 10 | # Git operations 11 | echo "Checking for changes..." 12 | # Check both tracked and untracked files 13 | if [[ -n "$(git status --porcelain)" ]]; then 14 | echo "Changes detected. Committing to git..." 15 | # Stage all changes, including untracked files 16 | git add -A 17 | 18 | read -p "Enter a commit message (default: 'Update NixOS configuration'): " commit_message 19 | commit_message=${commit_message:-"Update NixOS configuration"} 20 | git commit -m "$commit_message" 21 | 22 | echo "Pushing changes to remote repository..." 23 | read -p "Are you sure you want to force push to master? (y/N): " confirm 24 | if [[ $confirm == [yY] || $confirm == [yY][eE][sS] ]]; then 25 | git push origin master --force 26 | else 27 | echo "Push aborted." 28 | fi 29 | else 30 | echo "No changes detected in git." 31 | fi 32 | 33 | # Rebuild NixOS 34 | echo "Rebuilding NixOS configuration..." 35 | sudo nixos-rebuild switch --flake .#optiplex -------------------------------------------------------------------------------- /modules/scripts/optiplex-flake-update.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -euo pipefail 4 | 5 | echo "Updating NixOS flake configuration..." 6 | 7 | cd $HOME/nixos-config 8 | echo "Updating flake inputs..." 9 | nix flake update 10 | 11 | echo "Rebuilding NixOS configuration..." 12 | sudo nixos-rebuild switch --flake .#optiplex 13 | 14 | echo "NixOS update complete!" -------------------------------------------------------------------------------- /modules/scripts/setup-casiotone.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Set up JACK 4 | jack_control start 5 | jack_control ds alsa 6 | jack_control dps device hw:LKS250 7 | jack_control dps rate 44100 8 | jack_control dps nperiods 2 9 | jack_control dps period 256 10 | 11 | # Start FluidSynth 12 | fluidsynth -a jack -m alsa_seq -l -i /usr/share/soundfonts/default.sf2 & 13 | 14 | # Connect MIDI ports 15 | sleep 2 16 | aconnect "LK-S250" "FLUID Synth" -------------------------------------------------------------------------------- /modules/scripts/yoga-flake-build.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -euo pipefail 4 | 5 | echo "Building and updating NixOS flake configuration..." 6 | 7 | # Change to the nixos-config directory 8 | cd ~/nixos-config 9 | 10 | # Git operations 11 | echo "Checking for changes..." 12 | # Check both tracked and untracked files 13 | if [[ -n "$(git status --porcelain)" ]]; then 14 | echo "Changes detected. Committing to git..." 15 | # Stage all changes, including untracked files 16 | git add -A 17 | 18 | read -p "Enter a commit message (default: 'Update NixOS configuration'): " commit_message 19 | commit_message=${commit_message:-"Update NixOS configuration"} 20 | git commit -m "$commit_message" 21 | 22 | echo "Pushing changes to remote repository..." 23 | read -p "Are you sure you want to force push to master? (y/N): " confirm 24 | if [[ $confirm == [yY] || $confirm == [yY][eE][sS] ]]; then 25 | git push origin master --force 26 | else 27 | echo "Push aborted." 28 | fi 29 | else 30 | echo "No changes detected in git." 31 | fi 32 | 33 | # Rebuild NixOS 34 | echo "Rebuilding NixOS configuration..." 35 | sudo nixos-rebuild switch --flake .#yoga 36 | 37 | echo "NixOS build and update complete!" -------------------------------------------------------------------------------- /modules/scripts/yoga-flake-update.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -euo pipefail 4 | 5 | echo "Updating NixOS flake configuration..." 6 | 7 | cd $HOME/nixos-config 8 | echo "Updating flake inputs..." 9 | nix flake update 10 | 11 | echo "Rebuilding NixOS configuration..." 12 | sudo nixos-rebuild switch --flake .#yoga 13 | 14 | echo "NixOS update complete!" -------------------------------------------------------------------------------- /modules/system/16gb-swap.nix: -------------------------------------------------------------------------------- 1 | { config, lib, pkgs, ... }: 2 | 3 | { 4 | 5 | swapDevices = [ { 6 | device = "/var/lib/swapfile"; 7 | size = 16*1024; 8 | } ]; 9 | 10 | } -------------------------------------------------------------------------------- /modules/system/4gb-swap.nix: -------------------------------------------------------------------------------- 1 | { config, lib, pkgs, ... }: 2 | 3 | { 4 | 5 | swapDevices = [ { 6 | device = "/var/lib/swapfile"; 7 | size = 4*1024; 8 | } ]; 9 | 10 | } -------------------------------------------------------------------------------- /modules/system/8gb-swap.nix: -------------------------------------------------------------------------------- 1 | { config, lib, pkgs, ... }: 2 | 3 | { 4 | 5 | swapDevices = [ { 6 | device = "/var/lib/swapfile"; 7 | size = 8*1024; 8 | } ]; 9 | 10 | } -------------------------------------------------------------------------------- /modules/system/audio.nix: -------------------------------------------------------------------------------- 1 | { config, pkgs, ... }: 2 | 3 | { 4 | # Enable sound with pipewire 5 | hardware.pulseaudio.enable = false; 6 | security.rtkit.enable = true; 7 | services.pipewire = { 8 | enable = true; 9 | alsa.enable = true; 10 | alsa.support32Bit = true; 11 | pulse.enable = true; 12 | # If you want to use JACK applications, uncomment this 13 | # jack.enable = true; 14 | 15 | # use the example session manager (no others are packaged yet so this is enabled by default, 16 | # no need to redefine it in your config for now) 17 | #media-session.enable = true; 18 | }; 19 | } -------------------------------------------------------------------------------- /modules/system/canon.nix: -------------------------------------------------------------------------------- 1 | { lib 2 | , stdenv 3 | , fetchurl 4 | , unzip 5 | , autoconf 6 | , automake 7 | , libtool_1_5 8 | , makeWrapper 9 | , cups 10 | , jbigkit 11 | , glib 12 | , gtk3 13 | , gdk-pixbuf 14 | , pango 15 | , cairo 16 | , coreutils 17 | , atk 18 | , pkg-config 19 | , libxml2 20 | , runtimeShell 21 | , libredirect 22 | , ghostscript 23 | , pkgs 24 | , zlib 25 | }: 26 | 27 | let 28 | system = 29 | if stdenv.hostPlatform.system == "x86_64-linux" then "intel" 30 | else if stdenv.hostPlatform.system == "aarch64-linux" then "arm" 31 | else throw "Unsupported platform for Canon UFR2 Drivers: ${stdenv.hostPlatform.system}"; 32 | ld64 = "${stdenv.cc}/nix-support/dynamic-linker"; 33 | libs = pkgs: lib.makeLibraryPath buildInputs; 34 | 35 | version = "5.70"; 36 | dl = "8/0100007658/33"; 37 | 38 | versionNoDots = builtins.replaceStrings [ "." ] [ "" ] version; 39 | src_canon = fetchurl { 40 | url = "http://gdlp01.c-wss.com/gds/${dl}/linux-UFRII-drv-v${versionNoDots}-m17n-11.tar.gz"; 41 | hash = "sha256-d5VHlPpUPAr3RWVdQRdn42YLuVekOw1IaMFLVt1Iu7o="; 42 | }; 43 | 44 | buildInputs = [ cups zlib jbigkit glib gtk3 libxml2 gdk-pixbuf pango cairo atk ]; 45 | in 46 | stdenv.mkDerivation rec { 47 | pname = "canon-cups-ufr2"; 48 | inherit version; 49 | src = src_canon; 50 | 51 | postUnpack = '' 52 | ( 53 | cd $sourceRoot 54 | tar -xf Sources/cnrdrvcups-lb-${version}-1.11.tar.xz 55 | sed -ie "s@_prefix=/usr@_prefix=$out@" cnrdrvcups-common-${version}/allgen.sh 56 | sed -ie "s@_libdir=/usr/lib@_libdir=$out/lib@" cnrdrvcups-common-${version}/allgen.sh 57 | sed -ie "s@_bindir=/usr/bin@_bindir=$out/bin@" cnrdrvcups-common-${version}/allgen.sh 58 | sed -ie "s@/usr@$out@" cnrdrvcups-common-${version}/{{backend,rasterfilter}/Makefile.am,rasterfilter/cnrasterproc.h} 59 | sed -ie "s@etc/cngplp@$out/etc/cngplp@" cnrdrvcups-common-${version}/cngplp/Makefile.am 60 | sed -ie "s@usr/share/cngplp@$out/usr/share/cngplp@" cnrdrvcups-common-${version}/cngplp/src/Makefile.am 61 | patchShebangs cnrdrvcups-common-${version} 62 | 63 | sed -ie "s@_prefix=/usr@_prefix=$out@" cnrdrvcups-lb-${version}/allgen.sh 64 | sed -ie "s@_libdir=/usr/lib@_libdir=$out/lib@" cnrdrvcups-lb-${version}/allgen.sh 65 | sed -ie "s@_bindir=/usr/bin@_bindir=$out/bin@" cnrdrvcups-lb-${version}/allgen.sh 66 | sed -ie '/^cd \.\.\/cngplp/,/^cd files/{/^cd files/!{d}}' cnrdrvcups-lb-${version}/allgen.sh 67 | sed -ie "s@cd \.\./pdftocpca@cd pdftocpca@" cnrdrvcups-lb-${version}/allgen.sh 68 | sed -ie "s@/usr@$out@" cnrdrvcups-lb-${version}/pdftocpca/Makefile.am 69 | sed -i "/CNGPLPDIR/d" cnrdrvcups-lb-${version}/Makefile 70 | patchShebangs cnrdrvcups-lb-${version} 71 | ) 72 | ''; 73 | 74 | nativeBuildInputs = [ makeWrapper unzip autoconf automake libtool_1_5 pkg-config ]; 75 | 76 | inherit buildInputs; 77 | 78 | installPhase = '' 79 | runHook preInstall 80 | 81 | ( 82 | cd cnrdrvcups-common-${version} 83 | ./allgen.sh 84 | make install 85 | ) 86 | ( 87 | cd cnrdrvcups-common-${version}/Rule 88 | mkdir -p $out/share/cups/usb 89 | install -m 644 *.usb-quirks $out/share/cups/usb 90 | ) 91 | ( 92 | cd cnrdrvcups-lb-${version} 93 | ./allgen.sh 94 | make install 95 | 96 | mkdir -p $out/share/cups/model 97 | install -m 644 ppd/*.ppd $out/share/cups/model/ 98 | ) 99 | 100 | ( 101 | cd lib 102 | mkdir -p $out/lib 103 | install -m 755 libs64/${system}/libColorGearCufr2.so.2.0.0 $out/lib 104 | install -m 755 libs64/${system}/libcaepcmufr2.so.1.0 $out/lib 105 | install -m 755 libs64/${system}/libcaiocnpkbidir.so.1.0.0 $out/lib 106 | install -m 755 libs64/${system}/libcaiousb.so.1.0.0 $out/lib 107 | install -m 755 libs64/${system}/libcaiowrapufr2.so.1.0.0 $out/lib 108 | install -m 755 libs64/${system}/libcanon_slimufr2.so.1.0.0 $out/lib 109 | install -m 755 libs64/${system}/libcanonufr2r.so.1.0.0 $out/lib 110 | install -m 755 libs64/${system}/libcnaccm.so.1.0 $out/lib 111 | install -m 755 libs64/${system}/libcnlbcmr.so.1.0 $out/lib 112 | install -m 755 libs64/${system}/libcnncapcmr.so.1.0 $out/lib 113 | install -m 755 libs64/${system}/libufr2filterr.so.1.0.0 $out/lib 114 | 115 | install -m 755 libs64/${system}/cnpdfdrv $out/bin 116 | install -m 755 libs64/${system}/cnpkbidir $out/bin 117 | install -m 755 libs64/${system}/cnpkmoduleufr2r $out/bin 118 | install -m 755 libs64/${system}/cnrsdrvufr2 $out/bin 119 | install -m 755 libs64/${system}/cnsetuputil2 $out/bin/cnsetuputil2 120 | 121 | mkdir -p $out/share/cnpkbidir 122 | install -m 644 libs64/${system}/cnpkbidir_info* $out/share/cnpkbidir 123 | 124 | mkdir -p $out/share/ufr2filter 125 | install -m 644 libs64/${system}/ThLB* $out/share/ufr2filter 126 | ) 127 | 128 | ( 129 | cd $out/lib 130 | 131 | ln -sf libColorGearCufr2.so.2.0.0 libColorGearCufr2.so 132 | ln -sf libColorGearCufr2.so.2.0.0 libColorGearCufr2.so.2 133 | ln -sf libcaepcmufr2.so.1.0 libcaepcmufr2.so 134 | ln -sf libcaepcmufr2.so.1.0 libcaepcmufr2.so.1 135 | ln -sf libcaiocnpkbidir.so.1.0.0 libcaiocnpkbidir.so 136 | ln -sf libcaiocnpkbidir.so.1.0.0 libcaiocnpkbidir.so.1 137 | ln -sf libcaiowrapufr2.so.1.0.0 libcaiowrapufr2.so 138 | ln -sf libcaiowrapufr2.so.1.0.0 libcaiowrapufr2.so.1 139 | ln -sf libcanon_slimufr2.so.1.0.0 libcanon_slimufr2.so 140 | ln -sf libcanon_slimufr2.so.1.0.0 libcanon_slimufr2.so.1 141 | ln -sf libcanonufr2r.so.1.0.0 libcanonufr2r.so 142 | ln -sf libcanonufr2r.so.1.0.0 libcanonufr2r.so.1 143 | ln -sf libcnlbcmr.so.1.0 libcnlbcmr.so 144 | ln -sf libcnlbcmr.so.1.0 libcnlbcmr.so.1 145 | ln -sf libufr2filterr.so.1.0.0 libufr2filterr.so 146 | ln -sf libufr2filterr.so.1.0.0 libufr2filterr.so.1 147 | ln -sf libuictlufr2r.so.1.0.0 libuictlufr2r.so 148 | ln -sf libuictlufr2r.so.1.0.0 libuictlufr2r.so.1 149 | 150 | patchelf --set-rpath "$(cat $NIX_CC/nix-support/orig-cc)/lib:${libs pkgs}:${stdenv.cc.cc.lib}/lib64:${stdenv.cc.libc}/lib64:$out/lib" libcanonufr2r.so.1.0.0 151 | patchelf --set-rpath "$(cat $NIX_CC/nix-support/orig-cc)/lib:${libs pkgs}:${stdenv.cc.cc.lib}/lib64:${stdenv.cc.libc}/lib64" libcaepcmufr2.so.1.0 152 | patchelf --set-rpath "$(cat $NIX_CC/nix-support/orig-cc)/lib:${libs pkgs}:${stdenv.cc.cc.lib}/lib64:${stdenv.cc.libc}/lib64" libColorGearCufr2.so.2.0.0 153 | ) 154 | 155 | ( 156 | cd $out/bin 157 | patchelf --set-interpreter "$(cat ${ld64})" --set-rpath "${lib.makeLibraryPath buildInputs}:${stdenv.cc.cc.lib}/lib64:${stdenv.cc.libc}/lib64" cnsetuputil2 cnpdfdrv 158 | patchelf --set-interpreter "$(cat ${ld64})" --set-rpath "${lib.makeLibraryPath buildInputs}:${stdenv.cc.cc.lib}/lib64:${stdenv.cc.libc}/lib64:$out/lib" cnpkbidir cnrsdrvufr2 cnpkmoduleufr2r cnjbigufr2 159 | 160 | wrapProgram $out/bin/cnrsdrvufr2 \ 161 | --prefix LD_LIBRARY_PATH ":" "$out/lib" \ 162 | --set LD_PRELOAD "${libredirect}/lib/libredirect.so" \ 163 | --set NIX_REDIRECTS /usr/bin/cnpkmoduleufr2r=$out/bin/cnpkmoduleufr2r:/usr/bin/cnjbigufr2=$out/bin/cnjbigufr2 164 | 165 | wrapProgram $out/bin/cnsetuputil2 \ 166 | --set LD_PRELOAD "${libredirect}/lib/libredirect.so" \ 167 | --set NIX_REDIRECTS /usr/share/cnsetuputil2=$out/usr/share/cnsetuputil2 168 | ) 169 | 170 | ( 171 | cd lib/data/ufr2 172 | mkdir -p $out/share/caepcm 173 | install -m 644 *.ICC $out/share/caepcm 174 | install -m 644 *.icc $out/share/caepcm 175 | install -m 644 *.PRF $out/share/caepcm 176 | install -m 644 CnLB* $out/share/caepcm 177 | ) 178 | 179 | ( 180 | cd cnrdrvcups-utility-${version}/data 181 | mkdir -p $out/usr/share/cnsetuputil2 182 | install -m 644 cnsetuputil* $out/usr/share/cnsetuputil2 183 | ) 184 | 185 | makeWrapper "${ghostscript}/bin/gs" "$out/bin/gs" \ 186 | --prefix LD_LIBRARY_PATH ":" "$out/lib" \ 187 | --prefix PATH ":" "$out/bin" 188 | 189 | runHook postInstall 190 | ''; 191 | 192 | meta = with lib; { 193 | description = "CUPS Linux drivers for Canon printers"; 194 | homepage = "http://www.canon.com/"; 195 | sourceProvenance = with sourceTypes; [ binaryNativeCode ]; 196 | license = licenses.unfree; 197 | maintainers = with maintainers; [ lluchs ]; 198 | }; 199 | } 200 | -------------------------------------------------------------------------------- /modules/system/cron.nix: -------------------------------------------------------------------------------- 1 | { config, lib, pkgs, ... }: 2 | 3 | let 4 | username = "ttr"; # Define the username here for easy changing 5 | userHome = config.users.users.${username}.home; 6 | in 7 | { 8 | services.cron = { 9 | enable = true; 10 | systemCronJobs = [ 11 | # Master Script 1am, 6am, 1pm, 6pm 12 | "0 1,6,13,18 * * * ${username} ${userHome}/.scripts/cronjobs/master.sh" 13 | 14 | # Flake Update every Monday at 12:30am 15 | "30 0 * * 1 ${username} ${userHome}/nixos-config/modules/scripts/flake-update.sh >> ${userHome}/.scripts/logs/flakes_updates.log 2>&1" 16 | 17 | # Serve Port TV 18 | "*/5 * * * * ${username} bash -l -c '${userHome}/.scripts/serve.sh'" 19 | 20 | # Clear Log files every Sunday and Thursday at 3 AM: 21 | "0 3 * * 0,4 ${username} ${userHome}/.scripts/logs/clear-all-logs.sh" 22 | 23 | #Testing 24 | # "* * * * * ${username} ${pkgs.bashInteractive}/bin/bash /mnt/12tb/TestStuff/cron/test.sh" # For Testing 25 | ]; 26 | }; 27 | } -------------------------------------------------------------------------------- /modules/system/cups-canon-zebra.nix: -------------------------------------------------------------------------------- 1 | # Configuration for both Canon MF620C and Zebra LP2844 2 | { config, lib, pkgs, ... }: 3 | 4 | with lib; 5 | 6 | { 7 | options = { 8 | services.customCups = { 9 | enable = mkEnableOption "Enable custom CUPS printing configuration"; 10 | }; 11 | }; 12 | 13 | config = mkIf config.services.customCups.enable { 14 | services.avahi = { 15 | enable = true; 16 | nssmdns4 = true; 17 | openFirewall = true; 18 | publish = { 19 | enable = true; 20 | addresses = true; 21 | userServices = true; 22 | }; 23 | }; 24 | 25 | services.printing = { 26 | enable = true; 27 | browsing = true; 28 | defaultShared = true; 29 | # Include drivers for both printers 30 | drivers = with pkgs; [ 31 | canon-cups-ufr2 32 | gutenprint # Contains Zebra drivers 33 | cups-filters 34 | ]; 35 | logLevel = "debug2"; 36 | # Add configuration specific to Zebra printer 37 | extraConf = '' 38 | LogLevel debug2 39 | 40 | # Allow raw printing for Zebra 41 | FileDevice Yes 42 | 43 | # Shorter timeout for label printer 44 | JobKillDelay 30 45 | 46 | # Important for Zebra printer 47 | 48 | Order allow,deny 49 | Allow from all 50 | 51 | 52 | 53 | Order allow,deny 54 | Allow from all 55 | 56 | ''; 57 | browsedConf = '' 58 | BrowseDNSSDSubTypes _cups,_print 59 | BrowseLocalProtocols all 60 | BrowseRemoteProtocols all 61 | CreateIPPPrinterQueues All 62 | BrowseTimeout 15 63 | ''; 64 | }; 65 | 66 | # Required packages for both printers 67 | environment.systemPackages = with pkgs; [ 68 | cups-filters 69 | gutenprint 70 | ghostscript 71 | foomatic-filters 72 | cups-pk-helper 73 | system-config-printer 74 | ]; 75 | 76 | # Configure systemd service 77 | systemd.services.cups = { 78 | wants = [ "network-online.target" ]; 79 | after = [ "network-online.target" ]; 80 | serviceConfig = { 81 | Restart = "on-failure"; 82 | RestartSec = "5s"; 83 | }; 84 | }; 85 | 86 | # Required for proper operation 87 | services.dbus.enable = true; 88 | security.polkit.enable = true; 89 | 90 | # Open necessary ports 91 | networking.firewall = { 92 | allowedTCPPorts = [ 631 9100 ]; 93 | allowedUDPPorts = [ 631 5353 ]; 94 | }; 95 | }; 96 | } -------------------------------------------------------------------------------- /modules/system/cups.nix: -------------------------------------------------------------------------------- 1 | { config, lib, pkgs, ... }: 2 | 3 | { 4 | 5 | # Enable CUPS to print documents. 6 | # Discovery 7 | services.avahi = { 8 | enable = true; 9 | nssmdns4 = true; 10 | openFirewall = true; 11 | }; 12 | # Enable printing 13 | services.printing = { 14 | enable = true; 15 | listenAddresses = [ "*:631" ]; 16 | allowFrom = [ "all" ]; 17 | browsing = true; 18 | defaultShared = true; 19 | }; 20 | } -------------------------------------------------------------------------------- /modules/system/firewall.nix: -------------------------------------------------------------------------------- 1 | { config, lib, pkgs, ... }: 2 | 3 | { 4 | networking = { 5 | firewall = { 6 | enable = true; # change this to enable and disable 7 | allowedTCPPorts = [ 2234 8001 22 445 5000 631 9100 9089 53317 ]; 8 | allowedUDPPorts = [ 2234 8001 22 445 5000 631 5353 9089 53317 ]; 9 | }; 10 | 11 | extraHosts = '' 12 | 192.168.1.222 rustdesk.cloudlive.us 13 | ''; 14 | }; 15 | } 16 | 17 | ### PORTS ### 18 | # 44 - Baikal 19 | # 631 9100 5353 - Cups (Printer) 20 | # 53317 - Localsend 21 | # 8001 - Pyload 22 | # 5000 - Pyserve 23 | # 445 - Samba 24 | # 22 - Ssh 25 | # 2234 - Soulseek 26 | 27 | -------------------------------------------------------------------------------- /modules/system/samba.nix: -------------------------------------------------------------------------------- 1 | { config, lib, pkgs, ... }: { 2 | services = { 3 | samba = { 4 | enable = true; 5 | package = pkgs.samba4Full; 6 | openFirewall = true; 7 | settings = { 8 | global = { 9 | "server smb encrypt" = "required"; 10 | "server min protocol" = "SMB3_00"; 11 | }; 12 | tv = { 13 | path = "/mnt/12tb/data/media/tv"; 14 | "read only" = "no"; 15 | comment = "CF TV Series"; 16 | }; 17 | movies = { 18 | path = "/mnt/12tb/data/media/movies"; 19 | "read only" = "no"; 20 | comment = "CF Movies"; 21 | }; 22 | jellyfin = { 23 | path = "/mnt/12tb/Jellyfin_Media"; 24 | "read only" = "no"; 25 | comment = "Jellyfin Videos"; 26 | }; 27 | roughdrafts = { 28 | path = "/12tb/Rough_Drafts"; 29 | "read only" = "no"; 30 | comment = "Rough Drafts"; 31 | }; 32 | }; 33 | }; 34 | }; 35 | } -------------------------------------------------------------------------------- /modules/system/services.nix: -------------------------------------------------------------------------------- 1 | { config, pkgs, ... }: 2 | 3 | { 4 | services = { 5 | customCups.enable = true; # Enable CUPS to print documents defined in cups.nix. 6 | libinput.enable = true; # Enable touchpad support 7 | tailscale = { 8 | enable = true; 9 | useRoutingFeatures = "both"; 10 | }; 11 | flatpak.enable = true; 12 | usbmuxd.enable = true; 13 | mpd.enable = true; # Music Player Demon 14 | # Commented out services 15 | # prowlarr.enable = true; 16 | # sonarr.enable = true; 17 | # jellyfin.enable = true; 18 | # jackett.enable = true; 19 | 20 | # udev rules for vial 21 | udev.extraRules = '' 22 | KERNEL=="hidraw*", SUBSYSTEM=="hidraw", MODE="0666" 23 | # Specific rules for keyboard vendors if needed 24 | # SUBSYSTEM=="usb", ATTR{idVendor}=="feed", MODE="0666" 25 | ''; 26 | }; 27 | 28 | systemd.services.NetworkManager-wait-online.enable = false; 29 | 30 | # XFCE desktop manager (for Thunar preferences) 31 | services.xserver.desktopManager.xfce = { 32 | enable = true; 33 | noDesktop = true; 34 | }; 35 | } -------------------------------------------------------------------------------- /modules/system/ssh.nix: -------------------------------------------------------------------------------- 1 | { config, lib, pkgs, ... }: 2 | 3 | { 4 | # Server-side SSH configuration 5 | services.openssh = { 6 | enable = true; 7 | 8 | settings = { 9 | PasswordAuthentication = false; 10 | PermitRootLogin = "no"; 11 | # Enable SFTP subsystem 12 | Subsystem = "sftp internal-sftp"; 13 | }; 14 | 15 | # Consider changing this if you need SSH access from other machines 16 | listenAddresses = [ 17 | #All Addresses 18 | # { addr = "0.0.0.0"; port = 22; } # IPv4: all interfaces 19 | # { addr = "::"; port = 22; } # IPv6: all interfaces 20 | 21 | # Tailscale Only 22 | { addr = "100.92.247.76"; port = 22; } # PC 23 | ]; 24 | }; 25 | 26 | # Enable FUSE 27 | boot.kernelModules = [ "fuse" ]; 28 | 29 | # Install SSHFS and other useful SSH-related tools 30 | environment.systemPackages = with pkgs; [ 31 | sshfs 32 | openssh 33 | fuse 34 | ]; 35 | 36 | # Set up SSH keys for your user 37 | users.users.ttr = { 38 | openssh.authorizedKeys.keys = [ 39 | # Laptop 40 | "ssh-ed25519 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXx git@dummy.com" 41 | 42 | # Termux (Android): 43 | "ssh-ed25519 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ssh@dummy.com" 44 | 45 | ]; 46 | }; 47 | 48 | # SSH client configuration for remote PC 49 | environment.etc."ssh/ssh_config".text = '' 50 | Host remote 51 | HostName remote 52 | User ttr 53 | Port 22 54 | ForwardX11 yes 55 | IdentityFile ~/.ssh/id_ed25519 56 | ServerAliveInterval 60 57 | ServerAliveCountMax 3 58 | Compression yes 59 | ''; 60 | 61 | # Enable X11 forwarding 62 | services.xserver.enable = true; 63 | 64 | # Allow users in the "fuse" group to use FUSE 65 | users.groups.fuse = {}; 66 | users.users.ttr.extraGroups = [ "fuse" ]; 67 | } 68 | -------------------------------------------------------------------------------- /modules/system/template.nix: -------------------------------------------------------------------------------- 1 | { config, lib, pkgs, ... }: 2 | 3 | { 4 | 5 | # Command in between here. Dont forget to SAVE AS something else. 6 | 7 | } -------------------------------------------------------------------------------- /modules/system/virtualization.nix: -------------------------------------------------------------------------------- 1 | { config, pkgs, ... }: 2 | 3 | { 4 | virtualisation = { 5 | spiceUSBRedirection.enable = true; 6 | libvirtd = { 7 | enable = true; 8 | qemu = { 9 | package = pkgs.qemu_kvm; 10 | runAsRoot = true; 11 | swtpm.enable = true; 12 | ovmf = { 13 | enable = true; 14 | packages = [pkgs.OVMFFull.fd]; 15 | }; 16 | }; 17 | }; 18 | docker = { 19 | enable = true; 20 | enableOnBoot = true; 21 | }; 22 | # Comment remains for future reference 23 | # Uncomment if you want to use Podman instead of Docker 24 | # podman = { 25 | # enable = true; 26 | # autoPrune.enable = true; 27 | # defaultNetwork.settings = { 28 | # dns_enabled = true; 29 | # ipv6_enabled = false; 30 | # }; 31 | # }; 32 | }; 33 | 34 | # Keep existing settings 35 | virtualisation.oci-containers.backend = "docker"; #defaults to docker 36 | virtualisation.podman.enable = false; 37 | programs.virt-manager.enable = true; 38 | 39 | # Add necessary system packages for virtualization 40 | environment.systemPackages = with pkgs; [ 41 | virt-viewer 42 | spice spice-gtk 43 | spice-protocol 44 | win-virtio 45 | win-spice 46 | swtpm 47 | OVMF 48 | ]; 49 | 50 | # Enable dconf (required for virt-manager settings) 51 | programs.dconf.enable = true; 52 | 53 | # Configure default network for libvirt 54 | systemd.services.libvirtd-default-network = { 55 | enable = true; 56 | description = "Creates and starts libvirt default network"; 57 | wantedBy = [ "multi-user.target" ]; 58 | after = [ "libvirtd.service" ]; 59 | serviceConfig = { 60 | Type = "oneshot"; 61 | RemainAfterExit = "yes"; 62 | }; 63 | script = '' 64 | # Wait for libvirtd to be ready 65 | sleep 2 66 | 67 | # Check if default network exists 68 | ${pkgs.libvirt}/bin/virsh net-info default >/dev/null 2>&1 69 | if [ $? -ne 0 ]; then 70 | # Create default network if it doesn't exist 71 | ${pkgs.libvirt}/bin/virsh net-define ${pkgs.writeText "default-network.xml" '' 72 | 73 | default 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | ''} 83 | fi 84 | 85 | # Start the network if it's not active 86 | ${pkgs.libvirt}/bin/virsh net-list | grep -q default || \ 87 | ${pkgs.libvirt}/bin/virsh net-start default 88 | 89 | # Enable autostart 90 | ${pkgs.libvirt}/bin/virsh net-autostart default 91 | ''; 92 | }; 93 | } -------------------------------------------------------------------------------- /modules/system/xmodmap.nix: -------------------------------------------------------------------------------- 1 | { config, pkgs, ... }: 2 | 3 | { 4 | services.xserver = { 5 | xkb.layout = "us"; 6 | xkb.variant = ""; 7 | xkb.options = "caps:hyper"; # This line remaps Caps Lock to Hyper 8 | 9 | displayManager.sessionCommands = '' 10 | # Debug log 11 | echo "Executing xmodmap and setxkbmap commands" >> /tmp/xkb_debug.log 12 | 13 | # Try setxkbmap first 14 | ${pkgs.xorg.setxkbmap}/bin/setxkbmap -option caps:hyper 15 | 16 | # Then apply xmodmap 17 | ${pkgs.xorg.xmodmap}/bin/xmodmap ${pkgs.writeText "xmodmap-config" '' 18 | clear lock 19 | clear mod3 20 | keycode 66 = Hyper_L 21 | add mod3 = Hyper_L 22 | ''} 23 | 24 | # Log xmodmap result 25 | ${pkgs.xorg.xmodmap}/bin/xmodmap -pke | grep -i hyper >> /tmp/xkb_debug.log 2>&1 26 | 27 | # Your existing sessionCommands: 28 | ${pkgs.xorg.xrandr}/bin/xrandr --setprovideroutputsource 2 0 29 | ${pkgs.xorg.xhost}/bin/xhost +local: 30 | 31 | # Any other existing sessionCommands... 32 | ''; 33 | }; 34 | } -------------------------------------------------------------------------------- /modules/timers/masterscript.nix: -------------------------------------------------------------------------------- 1 | # Removed for Privacy -------------------------------------------------------------------------------- /modules/users/family/home-family.nix: -------------------------------------------------------------------------------- 1 | { config, pkgs, ... }: 2 | 3 | { 4 | home.username = "family"; 5 | home.homeDirectory = "/home/family"; 6 | 7 | # Cursor and DPI settings 8 | xresources.properties = { 9 | "Xcursor.size" = 22; 10 | # "Xft.dpi" = 172; # Uncomment if using a 4K monitor 11 | }; 12 | 13 | # Packages for the family user 14 | home.packages = with pkgs; [ 15 | libreoffice-fresh 16 | # vscodium # Uncomment if needed 17 | 18 | # Fonts 19 | #font-awesome 20 | #nerdfonts 21 | #unifont 22 | ]; 23 | 24 | # Example of how to configure a program (uncomment and modify as needed) 25 | # programs.git = { 26 | # enable = true; 27 | # userName = "Family User"; 28 | # userEmail = "family@example.com"; 29 | # }; 30 | 31 | # This value determines the Home Manager release that your 32 | # configuration is compatible with. It's recommended to keep this up to date. 33 | home.stateVersion = "24.05"; 34 | 35 | # Let Home Manager install and manage itself. 36 | programs.home-manager.enable = true; 37 | } -------------------------------------------------------------------------------- /modules/users/muffery/home-muffery.nix: -------------------------------------------------------------------------------- 1 | { config, pkgs, ... }: 2 | 3 | { 4 | home.username = "muffery"; 5 | home.homeDirectory = "/home/muffery"; 6 | 7 | # Cursor and DPI settings 8 | xresources.properties = { 9 | "Xcursor.size" = 22; 10 | # "Xft.dpi" = 172; # Uncomment if using a 4K monitor 11 | }; 12 | 13 | # Packages for the family user 14 | home.packages = with pkgs; [ 15 | libreoffice-fresh 16 | # vscodium # Uncomment if needed 17 | 18 | # Fonts 19 | #font-awesome 20 | #nerdfonts 21 | #unifont 22 | ]; 23 | 24 | # Example of how to configure a program (uncomment and modify as needed) 25 | # programs.git = { 26 | # enable = true; 27 | # userName = "Family User"; 28 | # userEmail = "family@example.com"; 29 | # }; 30 | 31 | # This value determines the Home Manager release that your 32 | # configuration is compatible with. It's recommended to keep this up to date. 33 | home.stateVersion = "24.05"; 34 | 35 | # Let Home Manager install and manage itself. 36 | programs.home-manager.enable = true; 37 | } -------------------------------------------------------------------------------- /modules/users/ttr/bashrc.nix: -------------------------------------------------------------------------------- 1 | { config, pkgs, ... }: 2 | 3 | { 4 | programs.bash = { 5 | enable = true; 6 | shellAliases = { 7 | 8 | # Nixos commands 9 | buildopt = "$HOME/nixos-config/modules/scripts/optiplex-flake-build.sh"; 10 | buildopttrace = "cd $HOME/nixos-config && sudo nixos-rebuild switch --flake .#optiplex --show-trace"; 11 | builyoga = "$HOME/nixos-config/modules/scripts/yoga-flake-build.sh"; 12 | update = "$HOME/nixos-config/modules/scripts/flake-update.sh"; 13 | rebuild = "sudo nixos-rebuild switch --flake /home/ttr/nixos-config"; 14 | fpull = "$HOME/nixos-config/modules/scripts/flake-pull.sh"; 15 | fpush = "$HOME/nixos-config/modules/scripts/flake-push.sh"; 16 | cdmodules = "cd $HOME/nixos-config/modules"; 17 | cdnix = "cd $HOME/nixos-config"; 18 | config = "micro $HOME/nixos-config/configuration.nix"; 19 | flake = "micro $HOME/nixos-config/flake.nix"; 20 | flakes = "micro $HOME/nixos-config/flake.nix"; 21 | hardware = "micro $HOME/nixos-config/hosts/optiplex/hardware-configuration.nix"; 22 | home = "micro $HOME/nixos-config/modules/users/home-ttr.nix"; 23 | usersnix = "micro $HOME/nixos-config/modules/users/users.nix"; 24 | nixgarbage = "sudo nix-store --gc"; 25 | 26 | # APP LAUNCH 27 | timeshift = "sudo timeshift-gtk"; 28 | gparted = "sudo gparted"; 29 | vmm = "virt-manager"; 30 | gufw = "sudo gufw"; 31 | ufw = "sudo gufw"; 32 | 33 | # FILE LOCATIONS 34 | dow = "cd $HOME/Downloads"; 35 | scr = "cd $HOME/.scripts"; 36 | 37 | 38 | # Arch Docker Container 39 | a1 = "enter-arch-ttr"; 40 | 41 | # GIT 42 | homepull = "bash $HOME/home-pull.sh"; 43 | homepush = "bash $HOME/home-push.sh"; 44 | 45 | # FFMPEG Scripts 46 | findmkv = "find /mnt/12tb/data/media -type f -name \"*.mkv\" -print0 | xargs -0 -I {} echo \"{}\" | sort && $HOME/.scripts/ffmpeg-scripts/mkv-to-mp4-with-prompt.sh"; 47 | countmkv = "find /mnt/12tb/data/media -type f -name \"*.mkv\" | wc -l"; 48 | mp4togif = "bash $HOME/.scripts/ffmpeg-scripts/mp4-to-gif.sh"; 49 | mwp = "$HOME/.scripts/ffmpeg-scripts/N_m3u8DL-RE-with-prompts-MWP.sh"; 50 | d720 = "$HOME/.scripts/ffmpeg-scripts/720p.sh"; 51 | d1080 = "$HOME/.scripts/ffmpeg-scripts/1080p.sh"; 52 | 53 | # SCRIPTS 54 | m1 = "bash $HOME/.scripts/cronjobs/master.sh"; 55 | m2 = "tail -f $HOME/.scripts/logs/mastersh.log"; 56 | m3 = "cd /tmp && rm script.lock"; 57 | sb = "bash $HOME/.scripts/Small-Backups.sh"; 58 | bb = "bash $HOME/.scripts/Big-Backups.sh"; 59 | pi = "$HOME/.scripts/piper/piper-rofi-hardcoded.sh"; 60 | tts = "$HOME/.scripts/piper/piper-rofi-hardcoded.sh"; 61 | 62 | # QUICK TERMS 63 | ll = "ls -l"; 64 | cl = "clear"; 65 | CL = "clear"; 66 | xx = "find . -type f \\( -name \"*.sh\" -o -name \"*.py\" -o -name \"*.perl\" -o -name \"*.AppImage\" \\) -exec chmod +x {} +"; 67 | cron = "crontab -e"; 68 | cronjob20 = "sudo journalctl -u cron -n 20"; 69 | cronjob40 = "sudo journalctl -u cron -n 40"; 70 | cronjob50 = "sudo journalctl -u cron -n 50"; 71 | back = "cd ../"; 72 | back2 = "cd ../.."; 73 | back3 = "cd ../../.."; 74 | mega = "mega-sync"; 75 | makes = "makepkg -si"; 76 | uninstall = "flatpak uninstall"; 77 | samba = "sudo micro /etc/samba/smb.conf"; 78 | unfree = "export NIXPKGS_ALLOW_UNFREE=1"; 79 | dup = "sudo docker-compose up -d"; 80 | pup = "sudo podman-compose up -d"; 81 | source = "source ~/.bashrc"; 82 | SOURCE = "source ~/.bashrc"; 83 | repo = "cd $HOME/ttr-app-repo/"; 84 | trash = "trash-empty"; 85 | w = "wget"; 86 | microserve = "micro $HOME/.scripts/serve.sh"; 87 | i3r = "i3-msg reload"; 88 | sr = "swaymsg reload"; 89 | apacherestart = "sudo systemctl restart apache2"; 90 | 91 | # PRODUCTIVITY 92 | sym = "bash $HOME/.scripts/symlink.sh"; 93 | replace = "bash $HOME/.scripts/replace_text.sh"; 94 | theme = "$HOME/.scripts/TTR-Themer/rofi-themer.sh"; 95 | blog = "bundle exec jekyll serve"; 96 | bloginstall = "bundle install"; 97 | blogbuild = "bundle exec jekyll build"; 98 | msearch = "bash $HOME/.scripts/mastersearch.sh"; 99 | 100 | # SSH Commands 101 | rsssh = "sudo systemctl restart sshd"; 102 | sshconfig = "micro $HOME/.ssh/config"; 103 | sshremote = "ssh ttr@remote"; 104 | sshmountremote = "sshfs ttr@remote:/home/ttr/ ~/remote_server"; 105 | sshunmountremote = "fusermount -u $HOME/remote_server"; 106 | sshxremote = "ssh -X ttr@remote"; 107 | catpub = "cat /home/ttr/.ssh/id_ed25519.pub"; 108 | 109 | 110 | }; 111 | initExtra = '' 112 | # Chain of sourcing: 113 | # .xprofile -> .profile -> .bashrc 114 | # source ~/.bashrc 115 | 116 | # If not running interactively, don't do anything 117 | case $- in 118 | *i*) ;; 119 | *) return;; 120 | esac 121 | 122 | # QT apps theming 123 | export QT_QPA_PLATFORMTHEME="qt5ct" 124 | 125 | # Share history between shells 126 | export PROMPT_COMMAND='history -a' 127 | 128 | # Starship prompt 129 | if command -v starship &> /dev/null; then 130 | eval "$(starship init bash)" 131 | fi 132 | 133 | # History control 134 | export HISTCONTROL=ignoredups:erasedups 135 | shopt -s histappend 136 | PROMPT_COMMAND="history -a; history -c; history -r; $PROMPT_COMMAND" 137 | 138 | # Enable bash completion 139 | if ! shopt -oq posix; then 140 | if [ -f /usr/share/bash-completion/bash_completion ]; then 141 | . /usr/share/bash-completion/bash_completion 142 | elif [ -f /etc/bash_completion ]; then 143 | . /etc/bash_completion 144 | fi 145 | fi 146 | 147 | # Install Ruby Gems to ~/gems 148 | export GEM_HOME="$HOME/gems" 149 | export PATH="$HOME/gems/bin:$PATH" 150 | 151 | # Nix LD for bin files 152 | export NIX_LD=$(cat $(nix eval --raw nixpkgs#stdenv.cc)/nix-support/dynamic-linker) 153 | ''; 154 | }; 155 | } -------------------------------------------------------------------------------- /modules/users/ttr/home-ttr.nix: -------------------------------------------------------------------------------- 1 | { config, pkgs, ... }: 2 | 3 | { 4 | imports = [ 5 | #./bashrc.nix 6 | #...other imports 7 | ]; 8 | 9 | # TODO please change the username & home directory to your own 10 | home.username = "ttr"; 11 | home.homeDirectory = "/home/ttr"; 12 | 13 | # link the configuration file in current directory to the specified location in home directory 14 | # home.file.".config/i3/wallpaper.jpg".source = ./wallpaper.jpg; 15 | 16 | # link all files in `./scripts` to `~/.config/i3/scripts` 17 | # home.file.".config/i3/scripts" = { 18 | # source = ./scripts; 19 | # recursive = true; # link recursively 20 | # executable = true; # make all files executable 21 | # }; 22 | 23 | # encode the file content in nix configuration file directly 24 | # home.file.".xxx".text = '' 25 | # xxx 26 | # ''; 27 | 28 | # Set environment variables 29 | home.sessionVariables = { 30 | EDITOR = "micro"; 31 | PATH = "$PATH:/usr/bin:$HOME/.local/bin:$HOME/ttr-app-repo/"; 32 | }; 33 | 34 | # Set cursor size and dpi for 4k monitor 35 | xresources.properties = { 36 | "Xcursor.size" = 22; 37 | # "Xft.dpi" = 172; 38 | }; 39 | 40 | # Packages that should be installed to the user profile. 41 | home.packages = with pkgs; [ 42 | # Built from source 43 | n-m3u8dl-re 44 | xdman7 45 | xdman8 46 | 47 | # Testing 48 | kmonad #keybaord 49 | deno # vil converter 50 | evtest 51 | cargo-tauri 52 | devbox 53 | 54 | # Web Browsers: 55 | brave 56 | firefox 57 | #microsoft-edge 58 | opera 59 | 60 | # File Managers & Addons: 61 | xfce.catfish 62 | mate.caja-with-extensions 63 | ranger 64 | 65 | # Music: 66 | clementine 67 | sayonara 68 | 69 | # Basics 70 | terminator # Konsole 71 | bitwarden # PW Manager 72 | 73 | # Productivity: 74 | autokey 75 | flameshot 76 | fsearch 77 | gpick # Colorpicker x11 78 | piper-tts 79 | gImageReader #OCR 80 | normcap # OCR (USE FLATPAK INSTEAD) 81 | scrcpy # Screen Record 82 | tree # directory structure hierarchies 83 | joplin-desktop # Notes 84 | 85 | 86 | # Self Hosting: 87 | docker-compose 88 | #cloudflared 89 | #rustdesk-flutter 90 | 91 | # Programming: 92 | android-tools 93 | neovim 94 | #neovim-unwrapped 95 | vscodium # Text Editor 96 | 97 | # Editing: 98 | audacity 99 | gimp-with-plugins 100 | obs-studio 101 | 102 | # Virtual: 103 | distrobox 104 | virt-manager 105 | 106 | # TUI: 107 | bottom 108 | #cava #Dependencies fucked 109 | cmatrix 110 | fastfetch 111 | figlet #ASVII Generator 112 | glava 113 | glow 114 | neofetch 115 | 116 | # MIDI and Audio Production 117 | lmms 118 | 119 | # Other 120 | #ferdium 121 | gparted 122 | gthumb #Pic Viewer 123 | gtk4 124 | jumpapp 125 | localsend 126 | lsof 127 | megacmd 128 | ntfs3g 129 | playerctl 130 | polybarFull 131 | protonvpn-gui 132 | scrot #Screenshot 133 | starship 134 | syncthing 135 | tmux 136 | unrar 137 | vial 138 | wine 139 | xarchiver 140 | xclip 141 | xdotool 142 | xvfb-run 143 | yt-dlp 144 | zenity #Prompt for new Files 145 | 146 | # iso burner 147 | #woeusb-ng 148 | #ntfs3g 149 | #dosfstools 150 | #ventoy-bin 151 | #isoimagewriter 152 | #mediawriter 153 | 154 | # fonts 155 | font-awesome 156 | #nerdfonts 157 | unifont 158 | 159 | # Soulseek 160 | nicotine-plus 161 | slskd 162 | 163 | # React & Npm 164 | nodejs_20 165 | nodePackages.npm 166 | nodePackages.pnpm 167 | 168 | # Messaging 169 | #discord 170 | #telegram-desktop 171 | #element-desktop 172 | 173 | # Jellyfin Programs 174 | #jellyfin 175 | #jellyfin-ffmpeg 176 | #jellyfin-web 177 | 178 | 179 | ]; 180 | 181 | # basic configuration of programs, please change to your own: 182 | #Git 183 | programs.bat = { 184 | enable = true; 185 | config = { 186 | theme = "GitHub"; 187 | italic-text = "always"; 188 | }; 189 | }; 190 | 191 | programs.git = { 192 | enable = true; 193 | userName = "TTR"; 194 | userEmail = "git@dummy.com"; 195 | }; 196 | 197 | # This value determines the home Manager release that your 198 | # configuration is compatible with. This helps avoid breakage 199 | # when a new home Manager release introduces backwards 200 | # incompatible changes. 201 | # 202 | # You can update home Manager without changing this value. See 203 | # the home Manager release notes for a list of state version 204 | # changes in each release. 205 | home.stateVersion = "24.05"; 206 | 207 | # Let home Manager install and manage itself. 208 | programs.home-manager.enable = true; 209 | 210 | # home.enableNixpkgsReleaseCheck = false; 211 | } -------------------------------------------------------------------------------- /modules/users/users.nix: -------------------------------------------------------------------------------- 1 | # users.nix 2 | { config, pkgs, ... }: 3 | 4 | { 5 | users.users = { 6 | ttr = { 7 | isNormalUser = true; 8 | extraGroups = [ "plugdev" "wheel" "cups" "networkmanager" "scanner" "lp" "libvirtd" "libvirt" "docker" "ttr" ]; 9 | uid = 1000; # It's good practice to explicitly set the UID 10 | }; 11 | muffery = { 12 | isNormalUser = true; 13 | extraGroups = [ "cups" "networkmanager" "muffery" ]; 14 | uid = 5000; 15 | }; 16 | family = { 17 | isNormalUser = true; 18 | extraGroups = [ "cups" "networkmanager" "family" ]; 19 | uid = 5001; 20 | }; 21 | }; 22 | 23 | users.groups = { 24 | ttr = { 25 | gid = 1000; 26 | }; 27 | # You can define other groups here as needed 28 | muffery = { 29 | gid = 5000; 30 | }; 31 | family = { 32 | gid = 5001; 33 | }; 34 | 35 | }; 36 | } 37 | 38 | # Set passwords: 39 | #sudo passwd 40 | 41 | 42 | # Manual set userid and groupid 43 | #sudo usermod -u 5000 family 44 | #sudo groupmod -g 5000 family 45 | #sudo usermod -u 5001 muffery 46 | #sudo groupmod -g 5001 muffery --------------------------------------------------------------------------------