From 99f984a5234874de036139fb602df2dcf28b5a80 Mon Sep 17 00:00:00 2001 From: Mohammad Rafiq Date: Mon, 7 Jul 2025 06:31:21 +0800 Subject: [PATCH] refactor(users): move owner config to users config in manifest --- nix/manifest.nix | 5 +++-- nix/modules/nixos/users.nix | 6 ++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/nix/manifest.nix b/nix/manifest.nix index 85f794e..b6e0648 100644 --- a/nix/manifest.nix +++ b/nix/manifest.nix @@ -14,8 +14,9 @@ let in { flake.manifest = { - owner = { - username = "rafiq"; + users.rafiq = { + primary = true; + username = "rafiq"; # If we don't set this here we have to do some weird shit email = "rafiq@rrv.sh"; shell = "fish"; pubkey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILdsZyY3gu8IGB8MzMnLdh+ClDxQQ2RYG9rkeetIKq8n rafiq"; diff --git a/nix/modules/nixos/users.nix b/nix/modules/nixos/users.nix index a2790f7..cfdeba5 100644 --- a/nix/modules/nixos/users.nix +++ b/nix/modules/nixos/users.nix @@ -1,6 +1,8 @@ -{ config, ... }: +{ config, lib, ... }: let - inherit (config.flake.manifest) owner; + inherit (config.flake.lib) flattenAttrs; + inherit (lib.attrsets) filterAttrs; + owner = flattenAttrs (filterAttrs (_: v: (v.primary or false)) config.flake.manifest.users); in { flake.modules.nixos.default =