Skip to content

Commit

Permalink
feat(development): replaced Docker with rootless Podman; misc adjustm…
Browse files Browse the repository at this point in the history
…ents
  • Loading branch information
dr460nf1r3 committed May 8, 2024
1 parent ad0dfb3 commit af7f61d
Show file tree
Hide file tree
Showing 5 changed files with 79 additions and 62 deletions.
94 changes: 47 additions & 47 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 7 additions & 2 deletions nixos/modules/apps.nix
Original file line number Diff line number Diff line change
Expand Up @@ -79,19 +79,24 @@ in {
ansible
beekeeper-studio
distrobox
dive
docker-compose
fishPlugins.wakatime-fish
gh
gitkraken
jetbrains.webstorm
heroku
hugo
jetbrains.webstorm
manix
mongodb-compass
nix-prefetch-git
nixd
nixos-generators
nixpkgs-lint
nixpkgs-review
nodejs
nodejs_22 # 24 not available
podman-compose
podman-tui
speedcrunch
termius
ventoy-full
Expand Down
19 changes: 7 additions & 12 deletions nixos/modules/development.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
config,
lib,
pkgs,
...
}:
with lib; let
Expand Down Expand Up @@ -40,9 +39,6 @@ in {
# Conflicts with virtualisation.containers if enabled
boot.enableContainers = false;

# Wakatime plugin
environment.systemPackages = with pkgs; [fishPlugins.wakatime-fish];

# Allow building sdcard images for Raspi
nixpkgs.config.allowUnsupportedSystem = true;

Expand All @@ -51,16 +47,15 @@ in {

# Libvirt & Podman with docker alias
virtualisation = {
docker = {
autoPrune = {
enable = true;
flags = ["--all"];
};
containers.enable = true;
lxd.enable = false;
podman = {
autoPrune.enable = true;
defaultNetwork.settings.dns_enabled = true;
dockerCompat = true;
dockerSocket.enable = true;
enable = true;
enableOnBoot = false;
storageDriver = "overlay2";
};
lxd.enable = false;
virtualbox.host = {
addNetworkInterface = false;
enable = true;
Expand Down
3 changes: 3 additions & 0 deletions nixos/modules/impermanence.nix
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@
".local/share/TelegramDesktop"
".local/share/Vorta"
".local/share/baloo"
".local/share/containers"
".local/share/direnv"
".local/share/dolphin"
".local/share/fish"
Expand Down Expand Up @@ -226,6 +227,7 @@
# Cache stuff, not actual user data
".cache/bookmarksrunner"
".cache/chromium"
".cache/containers"
".cache/firedragon"
".cache/konsole"
".cache/lutris"
Expand All @@ -237,6 +239,7 @@
".local/share/Trash"
".local/state/syncthing"
".local/state/wireplumber"
# Special permissions needed for those
{
directory = ".gnupg";
mode = "0700";
Expand Down
16 changes: 15 additions & 1 deletion nixos/modules/users.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
keys,
config,
keys,
lib,
...
}: let
# Use fixed UIDs/GIDs
Expand Down Expand Up @@ -32,6 +33,7 @@
nscd = uidGid 990;
plocate = uidGid 989;
polkituser = uidGid 988;
podman = uidGid 968;
promtail = uidGid 987;
rtkit = uidGid 986;
sshd = uidGid 985;
Expand Down Expand Up @@ -87,6 +89,18 @@ in {
home = "/home/nico";
isNormalUser = true;
openssh.authorizedKeys.keyFiles = [keys.nico];
subGidRanges = lib.mkIf config.virtualisation.podman.enable [
{
count = 65536;
startGid = 615536;
}
];
subUidRanges = [
{
count = 65536;
startUid = 615536;
}
];
};
# Lock root password
root.hashedPasswordFile = config.sops.secrets."passwords/root".path;
Expand Down

0 comments on commit af7f61d

Please sign in to comment.