From 9252d6940b5ef6760e0c8be060562a68dde7f9ba Mon Sep 17 00:00:00 2001 From: niten Date: Fri, 5 Jan 2024 17:11:38 -0800 Subject: [PATCH] Give users groups (and switch to 23.11 --- flake.lock | 144 +++++++++++++++++++++++++++++++++++++++ flake.nix | 2 +- tesla-mate-container.nix | 34 +++++---- 3 files changed, 164 insertions(+), 16 deletions(-) create mode 100644 flake.lock diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..43126b2 --- /dev/null +++ b/flake.lock @@ -0,0 +1,144 @@ +{ + "nodes": { + "arion": { + "inputs": { + "flake-parts": "flake-parts", + "haskell-flake": "haskell-flake", + "hercules-ci-effects": "hercules-ci-effects", + "nixpkgs": "nixpkgs" + }, + "locked": { + "lastModified": 1703950660, + "narHash": "sha256-GgynJdQ6KngwFBd4YbMYbwesyOiMTZAFymsStE0PSfM=", + "owner": "hercules-ci", + "repo": "arion", + "rev": "f295eabd25b7c894ab405be784e2a010f83fde55", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "arion", + "type": "github" + } + }, + "flake-parts": { + "inputs": { + "nixpkgs-lib": [ + "arion", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1701473968, + "narHash": "sha256-YcVE5emp1qQ8ieHUnxt1wCZCC3ZfAS+SRRWZ2TMda7E=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "34fed993f1674c8d06d58b37ce1e0fe5eebcb9f5", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "flake-parts_2": { + "inputs": { + "nixpkgs-lib": [ + "arion", + "hercules-ci-effects", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1696343447, + "narHash": "sha256-B2xAZKLkkeRFG5XcHHSXXcP7To9Xzr59KXeZiRf4vdQ=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "c9afaba3dfa4085dbd2ccb38dfade5141e33d9d4", + "type": "github" + }, + "original": { + "id": "flake-parts", + "type": "indirect" + } + }, + "haskell-flake": { + "locked": { + "lastModified": 1675296942, + "narHash": "sha256-u1X1sblozi5qYEcLp1hxcyo8FfDHnRUVX3dJ/tW19jY=", + "owner": "srid", + "repo": "haskell-flake", + "rev": "c2cafce9d57bfca41794dc3b99c593155006c71e", + "type": "github" + }, + "original": { + "owner": "srid", + "ref": "0.1.0", + "repo": "haskell-flake", + "type": "github" + } + }, + "hercules-ci-effects": { + "inputs": { + "flake-parts": "flake-parts_2", + "nixpkgs": [ + "arion", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1701009247, + "narHash": "sha256-GuX16rzRze2y7CsewJLTV6qXkXWyEwp6VCZXi8HLruU=", + "owner": "hercules-ci", + "repo": "hercules-ci-effects", + "rev": "31b6cd7569191bfcd0a548575b0e2ef953ed7d09", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "hercules-ci-effects", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1701436327, + "narHash": "sha256-tRHbnoNI8SIM5O5xuxOmtSLnswEByzmnQcGGyNRjxsE=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "91050ea1e57e50388fa87a3302ba12d188ef723a", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1704295289, + "narHash": "sha256-9WZDRfpMqCYL6g/HNWVvXF0hxdaAgwgIGeLYiOhmes8=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "b0b2c5445c64191fd8d0b31f2b1a34e45a64547d", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "ref": "nixos-23.11", + "type": "indirect" + } + }, + "root": { + "inputs": { + "arion": "arion", + "nixpkgs": "nixpkgs_2" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix index e8364dd..a657932 100644 --- a/flake.nix +++ b/flake.nix @@ -2,7 +2,7 @@ description = "TeslaMate running in a container"; inputs = { - nixpkgs.url = "nixpkgs/nixos-23.05"; + nixpkgs.url = "nixpkgs/nixos-23.11"; arion.url = "github:hercules-ci/arion"; }; diff --git a/tesla-mate-container.nix b/tesla-mate-container.nix index a2efc64..9843d05 100644 --- a/tesla-mate-container.nix +++ b/tesla-mate-container.nix @@ -160,22 +160,26 @@ in { }; }; - users.users = { - tesla-mate = { - isSystemUser = true; - group = "tesla-mate"; - uid = 720; - }; - tesla-mate-postgres = { - isSystemUser = true; - group = "tesla-mate"; - uid = 721; - }; - tesla-mate-grafana = { - isSystemUser = true; - group = "tesla-mate"; - uid = 722; + users = { + users = { + tesla-mate = { + isSystemUser = true; + group = "tesla-mate"; + uid = 720; + }; + tesla-mate-postgres = { + isSystemUser = true; + group = "tesla-mate"; + uid = 721; + }; + tesla-mate-grafana = { + isSystemUser = true; + group = "tesla-mate"; + uid = 722; + }; }; + groups.tesla-mate.members = + [ "tesla-mate" "tesla-mate-postgres" "tesla-mate-grafana" ]; }; systemd = {