]> git.immae.eu Git - perso/Immae/Config/Nix.git/commitdiff
Use flake for openarc
authorIsmaël Bouya <ismael.bouya@normalesup.org>
Wed, 30 Dec 2020 23:13:07 +0000 (00:13 +0100)
committerIsmaël Bouya <ismael.bouya@normalesup.org>
Thu, 31 Dec 2020 10:32:20 +0000 (11:32 +0100)
flakes/openarc/flake.nix
lib/default.nix
lib/flake-compat.nix [new file with mode: 0644]
modules/default.nix
pkgs/default.nix

index 6110b2d126e70b0a054293c36877ead3371e58f4..bdb03581bd680f65a64c99eaf23b592a8c4ea444 100644 (file)
           };
 
           config = lib.mkIf cfg.enable {
-            users.users.openarc = lib.optionalAttrs (cfg.user == "openarc") {
-              group = cfg.group;
-              uid = myuids.lib.uids.openarc;
+            users.users = lib.optionalAttrs (cfg.user == "openarc") {
+              openarc = {
+                group = cfg.group;
+                uid = myuids.lib.uids.openarc;
+              };
             };
 
-            users.groups.openarc = lib.optionalAttrs (cfg.group == "openarc") {
-              gid = myuids.lib.gids.openarc;
+            users.groups = lib.optionalAttrs (cfg.group == "openarc") {
+              openarc.gid = myuids.lib.gids.openarc;
             };
 
             environment.systemPackages = [ self.defaultPackage."${pkgs.system}" ];
index 57bde79a2172737dcb5e05da377d08bd0f23f1e1..7b392f1de44e14d10d4be8e73f693260fb8b3bbc 100644 (file)
@@ -1,6 +1,7 @@
 { pkgs }:
 with pkgs;
 rec {
+  flakeCompat = import ./flake-compat.nix;
   nodeEnv = import ./node-env.nix;
 
   fetchedGithub = path:
diff --git a/lib/flake-compat.nix b/lib/flake-compat.nix
new file mode 100644 (file)
index 0000000..1f0d492
--- /dev/null
@@ -0,0 +1,6 @@
+src:
+(import (
+  fetchTarball {
+    url = "https://github.com/edolstra/flake-compat/archive/99f1c2157fba4bfe6211a321fd0ee43199025dbf.tar.gz";
+    sha256 = "0x2jn3vrawwv9xp15674wjz9pixwjyj3j771izayl962zziivbx2";
+  }) { inherit src; }).defaultNix
index 03b9adc9c92a162956dc003ae32eff3b1b82491c..059a9d8374d824b0cc8b3015ac869bef52107f81 100644 (file)
@@ -1,3 +1,6 @@
+let
+  flakeCompat = import ../lib/flake-compat.nix;
+in
 {
   myids = ./myids.nix;
   secrets = ./secrets.nix;
@@ -12,7 +15,7 @@
   fiche = ./webapps/fiche.nix;
 
   opendmarc = ./opendmarc.nix;
-  openarc = ./openarc.nix;
+  openarc = (flakeCompat ../flakes/openarc).nixosModule;
 
   duplyBackup = ./duply_backup;
   rsyncBackup = ./rsync_backup;
index b260f97335f6349b0f910d79a19b7608dd5f3fbf..ff21a205819d97660bfc4f806c54afe2c3e09f49 100644 (file)
@@ -22,7 +22,7 @@ rec {
   notmuch-python2 = callPackage ./notmuch/notmuch-python { pythonPackages = python2Packages; };
   notmuch-python3 = callPackage ./notmuch/notmuch-python { pythonPackages = python3Packages; };
   notmuch-vim = callPackage ./notmuch/notmuch-vim {};
-  openarc = callPackage ./openarc { inherit mylibs; };
+  openarc = (mylibs.flakeCompat ../flakes/openarc).default;
   opendmarc = callPackage ./opendmarc { libspf2 = callPackage ./opendmarc/libspf2.nix {}; };
   pg_activity = callPackage ./pg_activity { inherit mylibs; };
   pgloader = callPackage ./pgloader {};