summaryrefslogtreecommitdiff
path: root/src/content/en/pastebins/2018/07/13/guixbuilder-nixos.adoc
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2025-04-18 02:17:12 -0300
committerEuAndreh <eu@euandre.org>2025-04-18 02:48:42 -0300
commit020c1e77489b772f854bb3288b9c8d2818a6bf9d (patch)
tree142aec725a52162a446ea7d947cb4347c9d573c9 /src/content/en/pastebins/2018/07/13/guixbuilder-nixos.adoc
parentMakefile: Remove security.txt.gz (diff)
downloadeuandre.org-020c1e77489b772f854bb3288b9c8d2818a6bf9d.tar.gz
euandre.org-020c1e77489b772f854bb3288b9c8d2818a6bf9d.tar.xz
git mv src/content/* src/content/en/
Diffstat (limited to 'src/content/en/pastebins/2018/07/13/guixbuilder-nixos.adoc')
-rw-r--r--src/content/en/pastebins/2018/07/13/guixbuilder-nixos.adoc42
1 files changed, 42 insertions, 0 deletions
diff --git a/src/content/en/pastebins/2018/07/13/guixbuilder-nixos.adoc b/src/content/en/pastebins/2018/07/13/guixbuilder-nixos.adoc
new file mode 100644
index 0000000..65dbcc7
--- /dev/null
+++ b/src/content/en/pastebins/2018/07/13/guixbuilder-nixos.adoc
@@ -0,0 +1,42 @@
+= Guix users in NixOS system configuration
+:categories: nix guix
+:sort: 2
+
+[source,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";
+ };
+ };
+----