From 3e2567e026064fa48c878b3c8dffc9ce0318d149 Mon Sep 17 00:00:00 2001 From: Chris Thompson Date: Sat, 14 Dec 2024 18:39:44 -0500 Subject: [PATCH 1/4] Update flake.lock --- flake.lock | 12 ++++++------ hosts/default/configuration.nix | 20 ++++++++++++++++---- 2 files changed, 22 insertions(+), 10 deletions(-) diff --git a/flake.lock b/flake.lock index 8c45378..4ad035c 100644 --- a/flake.lock +++ b/flake.lock @@ -7,11 +7,11 @@ ] }, "locked": { - "lastModified": 1733769654, - "narHash": "sha256-aVvYDt8eitZVF6fdOrSoIzYRkQ5Gh6kfRvqkiaDRLL0=", + "lastModified": 1734093295, + "narHash": "sha256-hSwgGpcZtdDsk1dnzA0xj5cNaHgN9A99hRF/mxMtwS4=", "owner": "nix-community", "repo": "home-manager", - "rev": "e952e94955dcc6fa2120c1430789fc41363f5237", + "rev": "66c5d8b62818ec4c1edb3e941f55ef78df8141a8", "type": "github" }, "original": { @@ -22,11 +22,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1733759999, - "narHash": "sha256-463SNPWmz46iLzJKRzO3Q2b0Aurff3U1n0nYItxq7jU=", + "lastModified": 1733940404, + "narHash": "sha256-Pj39hSoUA86ZePPF/UXiYHHM7hMIkios8TYG29kQT4g=", "owner": "nixos", "repo": "nixpkgs", - "rev": "a73246e2eef4c6ed172979932bc80e1404ba2d56", + "rev": "5d67ea6b4b63378b9c13be21e2ec9d1afc921713", "type": "github" }, "original": { diff --git a/hosts/default/configuration.nix b/hosts/default/configuration.nix index b342110..f95c8fc 100644 --- a/hosts/default/configuration.nix +++ b/hosts/default/configuration.nix @@ -142,9 +142,6 @@ # Install firefox. programs.firefox.enable = true; - # Add docker! - virtualisation.docker.enable = true; - virtualisation.docker.storageDriver = "btrfs"; # Only when using BTRFS! (wolcen approved!) # Required for DDEV to add hosts files, if your DNS will not resolve addresses to localhost. # Some firewall DNS resolvers will NOT allow an externally resolved domain name to resolve to a reserved IP (e.g. localhost). @@ -201,7 +198,22 @@ diffr # another diff hilighting tool brave # privacy oriented browser zig # the zig language - # fonts + powerline # prompt utility + ]; + programs.zsh.enable = true; + programs.git = { + enable = true; + lfs.enable = true; + }; + # Orchestrator for FOSS VR stack + #programs.envision = { + # enable = true; + # openFirewall = true; # This is set true by default + #}; + nixpkgs.config.permittedInsecurePackages = [ + "electron-27.3.11" + ]; + fonts.packages = with pkgs; [ anonymousPro corefonts dejavu_fonts From 8784d609ede34c2ad1062aca5b14781685d0c128 Mon Sep 17 00:00:00 2001 From: Chris Thompson Date: Sat, 14 Dec 2024 18:40:17 -0500 Subject: [PATCH 2/4] Add packages: distrobox --- hosts/default/configuration.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/hosts/default/configuration.nix b/hosts/default/configuration.nix index f95c8fc..91b0b77 100644 --- a/hosts/default/configuration.nix +++ b/hosts/default/configuration.nix @@ -199,6 +199,7 @@ brave # privacy oriented browser zig # the zig language powerline # prompt utility + distrobox # instant alternate OS availability ]; programs.zsh.enable = true; programs.git = { From 66d7fdf5596eaea233c1efe6b6152dc986a60b52 Mon Sep 17 00:00:00 2001 From: Chris Thompson Date: Sat, 14 Dec 2024 18:44:29 -0500 Subject: [PATCH 3/4] Add various fonts --- hosts/default/configuration.nix | 46 ++++++++++++--------------------- 1 file changed, 16 insertions(+), 30 deletions(-) diff --git a/hosts/default/configuration.nix b/hosts/default/configuration.nix index 91b0b77..aa13c15 100644 --- a/hosts/default/configuration.nix +++ b/hosts/default/configuration.nix @@ -222,47 +222,33 @@ fira-code fira-code-symbols gohufont + inconsolata liberation_ttf - nerd-fonts.daddy-time-mono - nerd-fonts.monofur + #nerd-fonts + nerd-fonts._0xproto nerd-fonts._3270 + nerd-fonts.anonymice + nerd-fonts.daddy-time-mono + nerd-fonts.hack + nerd-fonts.jetbrains-mono + nerd-fonts.monofur + nerd-fonts.monoid + nerd-fonts.roboto-mono + nerd-fonts.sauce-code-pro + nerd-fonts.shure-tech-mono + nerd-fonts.space-mono nerd-fonts.ubuntu + nerd-fonts.ubuntu-mono + nerd-fonts.zed-mono noto-fonts noto-fonts-color-emoji noto-fonts-monochrome-emoji mplus-outline-fonts.githubRelease mononoki + powerline-fonts proggyfonts ]; - programs.zsh.enable = true; - programs.git = { - enable = true; - lfs.enable = true; - }; - # Orchestrator for FOSS VR stack - #programs.envision = { - # enable = true; - # openFirewall = true; # This is set true by default - #}; - nixpkgs.config.permittedInsecurePackages = [ - "electron-27.3.11" - ]; - #fonts = { - # fontconfig.enable = true; - # enableFontDir = true; - # enableGhostscriptFonts = true; - # fonts = with pkgs; [ - # corefonts - # dejavu_fonts - # inconsolata - # source-han-sans-japanese - # source-han-sans-korean - # source-han-sans-simplified-chinese - # source-han-sans-traditional-chinese - # ubuntu_font_family - # ]; - #}; # Some programs need SUID wrappers, can be configured further or are # started in user sessions. # programs.mtr.enable = true; From 04cee1bdd89be3692ccbc286b405755c9c6b1bcd Mon Sep 17 00:00:00 2001 From: Chris Thompson Date: Sat, 14 Dec 2024 18:45:21 -0500 Subject: [PATCH 4/4] Add ollama service/virtualization block --- hosts/default/configuration.nix | 51 ++++++++++++++++++++++++++++++++- 1 file changed, 50 insertions(+), 1 deletion(-) diff --git a/hosts/default/configuration.nix b/hosts/default/configuration.nix index aa13c15..1be658d 100644 --- a/hosts/default/configuration.nix +++ b/hosts/default/configuration.nix @@ -275,7 +275,56 @@ hardware.graphics.extraPackages32 = [ pkgs.driversi686Linux.amdvlk ]; - + services.ollama = { + enable = true; + acceleration = "rocm"; + environmentVariables = { + HCC_AMDGPU_TARGET = "gfx1031"; # used to be necessary, but doesn't seem to anymore + }; + rocmOverrideGfx = "10.3.1"; + }; + system.activationScripts = { + script.text = '' + install -d -m 755 /home/wolcen/.open-webui -o root -g root + ''; + }; + virtualisation = { + # Add docker! + docker.enable = true; + podman.enable = false; + docker.storageDriver = "btrfs"; # Only when using BTRFS! (wolcen approved!) + oci-containers = { + backend = "docker"; + containers = { + open-webui = { + image = "ghcr.io/open-webui/open-webui:main"; + + environment = { + "TZ" = "America/New York"; + "OLLAMA_API_BASE_URL" = "http://127.0.0.1:11434/api"; + "OLLAMA_BASE_URL" = "http://127.0.0.1:11434"; + "WEBUI_URL" = "http://127.0.0.1:8080/"; + }; + + volumes = [ + "/home/wolcen/.openweb-ui:/app/backend/data" + ]; + + ports = [ + "127.0.0.1:3000:8080" # Ensures we listen only on localhost + ]; + + extraOptions = [ + "--pull=always" # Pull if the image on the registry is newer + "--name=open-webui" + "--hostname=open-webui" + "--network=host" + "--add-host=host.containers.internal:host-gateway" + ]; + }; + }; + }; + }; # Force radv environment.variables.AMD_VULKAN_ICD = "RADV"; # Or