diff options
author | EuAndreh <eu@euandre.org> | 2020-02-23 00:07:30 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2020-02-23 00:07:30 -0300 |
commit | 4c4b4ca617689b8112798df73d48972cbcfef4c0 (patch) | |
tree | 48f7190ba707f71752f0b5fff15ab5c3f2ededb3 /_pastebins/guix-users-in-nixos-system-configuration.md | |
parent | /home/andreh/dev/libre/dotfiles/scripts/ad-hoc/pastebin.sh: Auto-add _pastebi... (diff) | |
download | euandre.org-4c4b4ca617689b8112798df73d48972cbcfef4c0.tar.gz euandre.org-4c4b4ca617689b8112798df73d48972cbcfef4c0.tar.xz |
/home/andreh/dev/libre/dotfiles/scripts/ad-hoc/pastebin.sh: Auto-add _pastebins/guix-users-in-nixos-system-configuration.md
Diffstat (limited to '_pastebins/guix-users-in-nixos-system-configuration.md')
-rw-r--r-- | _pastebins/guix-users-in-nixos-system-configuration.md | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/_pastebins/guix-users-in-nixos-system-configuration.md b/_pastebins/guix-users-in-nixos-system-configuration.md new file mode 100644 index 0000000..f7c8440 --- /dev/null +++ b/_pastebins/guix-users-in-nixos-system-configuration.md @@ -0,0 +1,44 @@ +--- +title: Guix users in NixOS system configuration +date: 2018-07-13 +layout: pastebin +lang: en +--- + +```nix + users = { + mutableUsers = false; + + extraUsers = + let + andrehUser = { + andreh = { + # my custom user config + }; + }; + # From the Guix manual: + # https://www.gnu.org/software/guix/manual/en/html_node/Build-Environment-Setup.html#Build-Environment-Setup + buildUser = (i: + { + "guixbuilder${i}" = { # guixbuilder$i + group = "guixbuild"; # -g guixbuild + extraGroups = ["guixbuild"]; # -G guixbuild + home = "/var/empty"; # -d /var/empty + shell = pkgs.nologin; # -s `which nologin` + description = "Guix build user ${i}"; # -c "Guix buid user $i" + isSystemUser = true; # --system + }; + } + ); + in + # merge all users + pkgs.lib.fold (str: acc: acc // buildUser str) + andrehUser + # for i in `seq -w 1 10` + (map (pkgs.lib.fixedWidthNumber 2) (builtins.genList (n: n+1) 10)); + + extraGroups.guixbuild = { + name = "guixbuild"; + }; + }; +``` |