Personal NixOS flake

clean up configuration.nix, move docker to virt.nix

+27 -125
-110
configuration.nix
··· 5 5 { config, lib, pkgs, ... }: 6 6 7 7 { 8 - # imports = 9 - # [ # Include the results of the hardware scan. 10 - # ./hardware-configuration.nix 11 - # ]; 12 - 13 - #nix.settings.experimental-features = ["nix-command" "flakes"]; 14 - 15 - # nix.settings = { 16 - # experimental-features = ["nix-command" "flakes"]; 17 - # #substituters = ["https://hyprland.cachix.org"]; 18 - # #trusted-public-keys = ["hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="]; 19 - # }; 20 - 21 - 22 - # Bootloader. 23 - # boot.loader.systemd-boot.enable = true; 24 - # boot.loader.efi.canTouchEfiVariables = true; 25 - 26 - #networking.hostName = "Emerald"; # Define your hostname. 27 - # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. 28 - 29 - # Configure network proxy if necessary 30 - # networking.proxy.default = "http://user:password@proxy:port/"; 31 - # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; 32 - 33 - # Enable networking 34 - #networking.networkmanager.enable = true; 35 - 36 - # Set your time zone. 37 - # time.timeZone = "America/New_York"; 38 - 39 - # # Select internationalisation properties. 40 - # i18n.defaultLocale = "en_US.UTF-8"; 41 - 42 - # i18n.extraLocaleSettings = { 43 - # LC_ADDRESS = "en_US.UTF-8"; 44 - # LC_IDENTIFICATION = "en_US.UTF-8"; 45 - # LC_MEASUREMENT = "en_US.UTF-8"; 46 - # LC_MONETARY = "en_US.UTF-8"; 47 - # LC_NAME = "en_US.UTF-8"; 48 - # LC_NUMERIC = "en_US.UTF-8"; 49 - # LC_PAPER = "en_US.UTF-8"; 50 - # LC_TELEPHONE = "en_US.UTF-8"; 51 - # LC_TIME = "en_US.UTF-8"; 52 - # }; 53 - 54 8 # Enable the X11 windowing system. 55 9 # You can disable this if you're only using the Wayland session. 56 10 services.xserver.enable = true; ··· 67 21 68 22 # Enable CUPS to print documents. 69 23 services.printing.enable = true; 70 - 71 - # Enable sound with pipewire. 72 - # hardware.pulseaudio.enable = false; 73 - # security.rtkit.enable = true; 74 - # services.pipewire = { 75 - # enable = true; 76 - # alsa.enable = true; 77 - # alsa.support32Bit = true; 78 - # pulse.enable = true; 79 - # # If you want to use JACK applications, uncomment this 80 - # #jack.enable = true; 81 - 82 - # # use the example session manager (no others are packaged yet so this is enabled by default, 83 - # # no need to redefine it in your config for now) 84 - # #media-session.enable = true; 85 - # }; 86 - 87 - #services.pipewire.extraConfig.pipewire."92-low-latency" = { 88 - # "context.properties" = { 89 - #"default.clock.rate" = 48000; 90 - #"default.clock.quantum" = 2048; 91 - # "default.clock.min-quantum" = 1024; 92 - #"default.clock.max-quantum" = 2048; 93 - # }; 94 - #}; 95 - 96 - # services.pipewire.extraConfig.pipewire-pulse."92-low-latency" = { 97 - # context.modules = [ 98 - # { 99 - # name = "libpipewire-module-protocol-pulse"; 100 - # args = { 101 - # pulse.min.req = "768/48000"; 102 - # pulse.default.req = "768/48000"; 103 - # pulse.max.req = "768/48000"; 104 - # pulse.min.quantum = "768/48000"; 105 - # pulse.max.quantum = "768/48000"; 106 - # }; 107 - # } 108 - # ]; 109 - # stream.properties = { 110 - # node.latency = "768/48000"; 111 - # resample.quality = 1; 112 - # }; 113 - # }; 114 - 115 - # Containers 116 - virtualisation = { 117 - 118 - # Docker 119 - docker = { 120 - enable = true; 121 - liveRestore = false; 122 - 123 - daemon.settings = { 124 - data-root = "/docker"; 125 - }; 126 - 127 - # rootless = { 128 - # enable = true; 129 - # setSocketVariable = true; 130 - #}; 131 - 132 - }; 133 - }; 134 24 135 25 # Enable touchpad support (enabled default in most desktopManager). 136 26 # services.xserver.libinput.enable = true;
+27 -15
sys/virt.nix
··· 1 1 { 2 - virtualisation.oci-containers.containers = { 3 - "gitea" = { 4 - autoStart = true; 5 - image = "gitea/gitea"; 6 - ports = [ "32769:22" "32768:3000"]; 7 - environment = { 8 - #USER_UID = "1000"; 9 - #USER_GID = "1000"; 10 - USER = "git"; 11 - GITEA_CUSTOM = "/data/gitea"; 2 + virtualisation = { 3 + 4 + docker = { 5 + enable = true; 6 + liveRestore = false; 7 + daemon.settings = { 8 + data-root = "/docker"; 12 9 }; 13 - volumes = [ 14 - "/home/volumes/gitea/data:/data" 15 - "/etc/timezone:/etc/timezone:ro" 16 - "/etc/localtime:/etc/localtime:ro" 17 - ]; 10 + }; 11 + 12 + # Could/should probs make these their own modules too tbh 13 + oci-containers.containers = { 14 + "gitea" = { 15 + autoStart = true; 16 + image = "gitea/gitea"; 17 + ports = [ "32769:22" "32768:3000"]; 18 + environment = { 19 + #USER_UID = "1000"; 20 + #USER_GID = "1000"; 21 + USER = "git"; 22 + GITEA_CUSTOM = "/data/gitea"; 23 + }; 24 + volumes = [ 25 + "/home/volumes/gitea/data:/data" 26 + "/etc/timezone:/etc/timezone:ro" 27 + "/etc/localtime:/etc/localtime:ro" 28 + ]; 29 + }; 18 30 }; 19 31 }; 20 32 }