distrobox
This commit is contained in:
parent
59a701bd73
commit
c347e4b245
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
inputs = {
|
inputs = {
|
||||||
# https://github.com/nixos/nixpkgs
|
# https://github.com/nixos/nixpkgs
|
||||||
nixpkgs-edge.url = "github:NixOS/nixpkgs/nixos-unstable";
|
nixpkgs-edge.url = "github:NixOS/nixpkgs/nixos-unstable"; # "edge" is four letters
|
||||||
nixpkgs-2311.url = "github:NixOS/nixpkgs/nixos-23.11";
|
nixpkgs-2311.url = "github:NixOS/nixpkgs/nixos-23.11";
|
||||||
nixpkgs-2305.url = "github:NixOS/nixpkgs/nixos-23.05";
|
nixpkgs-2305.url = "github:NixOS/nixpkgs/nixos-23.05";
|
||||||
nixpkgs-2211.url = "github:NixOS/nixpkgs/nixos-22.11"; # for old docs
|
nixpkgs-2211.url = "github:NixOS/nixpkgs/nixos-22.11"; # for old docs
|
||||||
|
@ -121,7 +121,7 @@
|
||||||
inputs-2003 = inputs-2305 // { nixpkgs = inputs'.nixpkgs-2003; };
|
inputs-2003 = inputs-2305 // { nixpkgs = inputs'.nixpkgs-2003; };
|
||||||
inputs-1909 = inputs-2305 // { nixpkgs = inputs'.nixpkgs-1909; };
|
inputs-1909 = inputs-2305 // { nixpkgs = inputs'.nixpkgs-1909; };
|
||||||
|
|
||||||
mkFlakeView = inputs: system: inputs.nixpkgs.lib.mapAttrs (name: flake: {
|
mkFlakeView = inputs: system: inputs.nixpkgs.lib.mapAttrs (name: flake: flake // {
|
||||||
# TODO filter non-flake inputs
|
# TODO filter non-flake inputs
|
||||||
nixos = flake.nixosModules
|
nixos = flake.nixosModules
|
||||||
or null;
|
or null;
|
||||||
|
@ -194,7 +194,7 @@
|
||||||
to.type = "github";
|
to.type = "github";
|
||||||
to.owner = "NixOS";
|
to.owner = "NixOS";
|
||||||
to.repo = "nixpkgs";
|
to.repo = "nixpkgs";
|
||||||
to.ref = "nixpkgs-unstable-small";
|
to.ref = "nixos-unstable-small";
|
||||||
};
|
};
|
||||||
nix.nixPath = [
|
nix.nixPath = [
|
||||||
"nixpkgs=${inputs.nixpkgs}"
|
"nixpkgs=${inputs.nixpkgs}"
|
||||||
|
|
|
@ -24,8 +24,8 @@
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
../../profiles/sshd.nix
|
../../profiles/sshd.nix
|
||||||
#../../profiles/no-suspend.nix
|
#../../profiles/no-suspend.nix
|
||||||
#../../profiles/podman.nix
|
#../../profiles/oci/podman.nix
|
||||||
#../../profiles/docker.nix
|
#../../profiles/oci/docker.nix
|
||||||
|
|
||||||
../../users/pbsds
|
../../users/pbsds
|
||||||
|
|
||||||
|
|
|
@ -24,8 +24,9 @@
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
../../profiles/sshd.nix
|
../../profiles/sshd.nix
|
||||||
../../profiles/no-suspend.nix
|
../../profiles/no-suspend.nix
|
||||||
#../../profiles/podman.nix
|
#../../profiles/oci/podman.nix
|
||||||
../../profiles/docker.nix
|
../../profiles/oci/docker.nix
|
||||||
|
../../profiles/oci/distrobox.nix
|
||||||
|
|
||||||
../../users/pbsds
|
../../users/pbsds
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,39 @@
|
||||||
|
{ pkgs, config, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
|
||||||
|
assertions = [
|
||||||
|
{
|
||||||
|
assertion = config.virtualisation.docker.enable || config.virtualisation.podman.enable;
|
||||||
|
message = "distrobox requires either podman or docker";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
environment.systemPackages = [
|
||||||
|
pkgs.distrobox
|
||||||
|
];
|
||||||
|
|
||||||
|
# update periodically
|
||||||
|
systemd.user = {
|
||||||
|
timers."distrobox-update" = {
|
||||||
|
enable = true;
|
||||||
|
wantedBy = ["timers.target"];
|
||||||
|
timerConfig = {
|
||||||
|
OnBootSec = "1h";
|
||||||
|
OnUnitActiveSec = "1d";
|
||||||
|
Unit = "distrobox-update.service";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
services."distrobox-update" = {
|
||||||
|
enable = true;
|
||||||
|
script = ''
|
||||||
|
${pkgs.distrobox}/bin/distrobox upgrade --all
|
||||||
|
'';
|
||||||
|
serviceConfig = {
|
||||||
|
Type = "oneshot";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
|
@ -1,7 +1,8 @@
|
||||||
{ lib, pkgs, ... }:
|
{ lib, pkgs, ... }:
|
||||||
{
|
{
|
||||||
virtualisation.docker.enable = true;
|
virtualisation.docker.enable = true;
|
||||||
#virtualisation.oci-containers.backend = lib.mkDefault "docker";
|
virtualisation.oci-containers.backend = lib.mkDefault "docker";
|
||||||
|
|
||||||
|
|
||||||
virtualisation.docker.autoPrune.enable = true;
|
virtualisation.docker.autoPrune.enable = true;
|
||||||
virtualisation.docker.autoPrune.dates = "weekly";
|
virtualisation.docker.autoPrune.dates = "weekly";
|
||||||
|
@ -11,12 +12,13 @@
|
||||||
#docker-compose
|
#docker-compose
|
||||||
];
|
];
|
||||||
|
|
||||||
# remember to add your user:
|
|
||||||
#users.users.USERNAME.extraGroups = [ "docker" ];
|
|
||||||
|
|
||||||
# Required for containers under podman-compose to be able to talk to each other.
|
# Required for containers under podman-compose to be able to talk to each other.
|
||||||
#virtualisation.defaultNetwork.settings.dns_enabled = true;
|
#virtualisation.defaultNetwork.settings.dns_enabled = true;
|
||||||
|
|
||||||
# TODO: if root-on-zfs
|
# TODO: if root-on-zfs
|
||||||
#virtualisation.podman.extraPackages = [ pkgs.zfs ];
|
#virtualisation.podman.extraPackages = [ pkgs.zfs ];
|
||||||
|
|
||||||
|
# remember to add your user:
|
||||||
|
#users.users.USERNAME.extraGroups = [ "docker" ];
|
||||||
}
|
}
|
|
@ -1,8 +1,8 @@
|
||||||
{ config, pkgs, ... }:
|
{ config, pkgs, ... }:
|
||||||
{
|
{
|
||||||
virtualisation.podman.enable = true;
|
virtualisation.podman.enable = true;
|
||||||
virtualisation.podman.dockerCompat = !config.virtualisation.docker.enable; # alias docker to podman
|
|
||||||
virtualisation.oci-containers.backend = "podman"; # default
|
virtualisation.oci-containers.backend = "podman"; # default
|
||||||
|
virtualisation.podman.dockerCompat = !config.virtualisation.docker.enable; # alias docker to podman
|
||||||
|
|
||||||
virtualisation.podman.autoPrune.enable = true;
|
virtualisation.podman.autoPrune.enable = true;
|
||||||
virtualisation.podman.autoPrune.dates = "weekly";
|
virtualisation.podman.autoPrune.dates = "weekly";
|
||||||
|
@ -13,7 +13,6 @@
|
||||||
podman-tui
|
podman-tui
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
||||||
# Required for containers under podman-compose to be able to talk to each other.
|
# Required for containers under podman-compose to be able to talk to each other.
|
||||||
#virtualisation.defaultNetwork.settings.dns_enabled = true;
|
#virtualisation.defaultNetwork.settings.dns_enabled = true;
|
||||||
|
|
Loading…
Reference in New Issue