containers

This commit is contained in:
Lilith 2024-07-24 00:36:50 +02:00
parent 65cefaf5cd
commit 578f0231ca
Signed by: lilith
GPG key ID: 8712A0F317C37175
6 changed files with 59 additions and 14 deletions

24
flake.lock generated
View file

@ -5,11 +5,11 @@
"nixpkgs": "nixpkgs" "nixpkgs": "nixpkgs"
}, },
"locked": { "locked": {
"lastModified": 1718921313, "lastModified": 1721074762,
"narHash": "sha256-TFJah1RW5qnYW7kajjAFPAS5j/0q0R3vz9zPjrRA0Mc=", "narHash": "sha256-RhqFBMLh6G5vAo7Jz9mdsworI50E4FAAg7rPho4CNfY=",
"owner": "Aylur", "owner": "Aylur",
"repo": "ags", "repo": "ags",
"rev": "646d5ad073ff7f8b1d50cfbd40f5b8a250fcd59d", "rev": "8194f0c9546a150525a2022c17aed51df1464b80",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -346,11 +346,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1720734513, "lastModified": 1721135958,
"narHash": "sha256-neWQ8eNtLTd+YMesb7WjKl1SVCbDyCm46LUgP/g/hdo=", "narHash": "sha256-H548rpPMsn25LDKn1PCFmPxmWlClJJGnvdzImHkqjuY=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "90ae324e2c56af10f20549ab72014804a3064c7f", "rev": "afd2021bedff2de92dfce0e257a3d03ae65c603d",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -451,11 +451,11 @@
}, },
"nixpkgs-stable_2": { "nixpkgs-stable_2": {
"locked": { "locked": {
"lastModified": 1721059467, "lastModified": 1721150952,
"narHash": "sha256-0Yx4eXowxw5TATf92DZu2qKbBYXPxYh849h9tL/TQR0=", "narHash": "sha256-LRuNRlV1JelXkufntUbaVDpI+CEOgHAnI+MTToOT9Hk=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "be45415f0f321f030f8c76723fd15d4b0f3a02fb", "rev": "4830e090c333af770f3edf2aa4d5a2b183f6455e",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -499,11 +499,11 @@
}, },
"nixpkgs_4": { "nixpkgs_4": {
"locked": { "locked": {
"lastModified": 1721016451, "lastModified": 1721080040,
"narHash": "sha256-Cypl9ORr5UjtBsbjXMTJRepTe362yNVrPrntUvHiTaw=", "narHash": "sha256-USDsS90/88RJibP3gEcH1AaVt+JpnX4XCUD9bAJP5I4=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "a14c5d651cee9ed70f9cd9e83f323f1e531002db", "rev": "b2c1f10bfbb3f617ea8e8669ac13f3f56ceb2ea2",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -4,6 +4,11 @@
extraConfig = { extraConfig = {
config.gaming.enable = true; config.gaming.enable = true;
config.docker = {
enable = true;
ollama.enable = true;
};
config.hyprlandOverrides = { config.hyprlandOverrides = {
settings = { settings = {
input = { input = {

View file

@ -0,0 +1,32 @@
{ pkgs, lib, config, conf, ...}: {
imports = [
] ++ lib.optional config.docker.ollama.enable ./ollama.nix
;
environment.systemPackages = with pkgs; [
arion
docker-client
];
virtualization = {
docker.enable = false;
podman.enable = true;
podman.dockerSocket.enable = true;
podman.defaultNetwork.dnsname.enable = true;
arion.projects.ollama = lib.mkIf config.containers.ollama.enable {
settings.services = {
ollama = {
service = {
image = "ollama/ollama:sha256:4325d935cd6e07cfa840eb193aad0594ba6cbc97ca9d0778f6716507cb3955ed";
useHostStore = true;
};
};
};
};
};
users.users.${conf.user}.extraGroups = ["podman"];
}

View file

@ -0,0 +1,5 @@
{...}: {
projects.ollama = {
}
}

View file

@ -18,5 +18,6 @@
./syncthing.nix ./syncthing.nix
./wayland.nix ./wayland.nix
./zsh.nix ./zsh.nix
]; ] ++ lib.optional config.containers.enable ./containers
;
} }

View file

@ -1,6 +1,8 @@
{lib, ...}: { {lib, ...}: {
options.gaming.enable = lib.mkEnableOption "Enable gaming"; options.gaming.enable = lib.mkEnableOption "Enable gaming";
config.gaming.enable = lib.mkDefault false;
options.containers.enable = lib.mkEnableOption "Enable podman";
options.containers.ollama.enable = lib.mkEnableOption "Run Ollama container";
options.hyprlandOverrides = lib.mkOption { options.hyprlandOverrides = lib.mkOption {
# type = lib.types.attributeSet; # type = lib.types.attributeSet;