Skip to content

Latest commit

 

History

History

ubuntu-nix-systemd

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

Nix package manager on Ubuntu - systemd

Usage

Keep systemd in background and use it with another user

container_id="$(podman run --rm --detach ghcr.io/kachick/ubuntu-nix-systemd:latest)"
sleep 1
podman exec --user=user -it "$container_id" bash

Make sure non root and non sudoers can run nix features

user@541fad9ac911:/$ nix --version
nix (Nix) 2.20.3
user@541fad9ac911:/$ nix run nixpkgs#hello
Hello, world!
user@541fad9ac911:/$ ps -ef | grep systemd
root           1       0  0 10:53 ?        00:00:00 /bin/systemd --system
root          15       1  0 10:53 ?        00:00:00 /lib/systemd/systemd-journald
systemd+      22       1  0 10:53 ?        00:00:00 /lib/systemd/systemd-resolved
user         770      26  0 10:55 pts/0    00:00:00 grep --color=auto systemd
user@541fad9ac911:/$ sudo
bash: sudo: command not found

Motivation

Note