From 91dd406c3e208fe31658af8759e4465b2ed89db1 Mon Sep 17 00:00:00 2001 From: Giulio De Pasquale Date: Fri, 15 Apr 2022 12:20:11 +0100 Subject: [PATCH] daje --- lib/user.nix | 12 +++++++++++- roles/home/common.nix | 8 ++++---- roles/home/zsh.nix | 3 +++ 3 files changed, 18 insertions(+), 5 deletions(-) diff --git a/lib/user.nix b/lib/user.nix index 4a3e40e..72d4de0 100644 --- a/lib/user.nix +++ b/lib/user.nix @@ -22,5 +22,15 @@ home-manager.users.${name}.imports = [ (mkRole "common") ] ++ roles_mod; - }; + }; + + mkHMUser = { name, roles ? [] }: + let + mkRole = role: import (../roles/home + "/${role}.nix"); + in{ + home-manager.users.${name}.imports = [ (mkRole "common") ] + ++ roles_mod; + }; + + }; } diff --git a/roles/home/common.nix b/roles/home/common.nix index 49cf2a4..7589488 100644 --- a/roles/home/common.nix +++ b/roles/home/common.nix @@ -1,6 +1,7 @@ -{ config, pkgs, unstable, ... }: +{ config, pkgs, ... }: -{ +let unstable = import { }; +in { imports = [ ./zsh.nix ./git.nix ]; home = { @@ -9,8 +10,6 @@ EDITOR = "nvim"; VISUAL = "nvim"; }; - - packages = with pkgs; [ rizin sshfs nixfmt victor-mono ]; }; programs.neovim = { @@ -24,6 +23,7 @@ cmake-format clang-tools rustfmt + nixfmt ]; extraConfig = '' " syntax diff --git a/roles/home/zsh.nix b/roles/home/zsh.nix index fd2bca5..fe04fad 100644 --- a/roles/home/zsh.nix +++ b/roles/home/zsh.nix @@ -7,5 +7,8 @@ plugins = [ "git" "sudo" "docker" "docker-compose" "adb" "systemd" ]; theme = "bira"; }; + initExtra = '' + source ~/.profile + ''; }; }