diff --git a/hosts/common.nix b/hosts/common.nix index a7f2032..3b0de86 100644 --- a/hosts/common.nix +++ b/hosts/common.nix @@ -26,10 +26,15 @@ description = "Base16 color scheme"; }; }; - dotfilesPath = mkOption { + dotfilesPath = let + homePath = if pkgs.stdenv.isDarwin then + "/Users/${config.user}" + else + "/home/${config.user}"; + in mkOption { type = types.path; description = "Path of dotfiles repository."; - default = builtins.toPath "$HOME/dev/personal/dotfiles"; + default = builtins.toPath "${homePath}/dev/personal/dotfiles"; }; dotfilesRepo = mkOption { type = types.str; diff --git a/hosts/desktop/default.nix b/hosts/desktop/default.nix index 4a2b02d..70f27f4 100644 --- a/hosts/desktop/default.nix +++ b/hosts/desktop/default.nix @@ -16,7 +16,7 @@ nixpkgs.lib.nixosSystem { gui = { enable = true; compositor.enable = true; - colorscheme = (import ../modules/colorscheme/gruvbox); + colorscheme = (import ../../modules/colorscheme/gruvbox); wallpaper = "${wallpapers}/gruvbox/road.jpg"; gtk.theme = { name = "Adwaita-dark"; }; }; diff --git a/modules/darwin/dotfiles.nix b/modules/darwin/dotfiles.nix index e753c12..2c86300 100644 --- a/modules/darwin/dotfiles.nix +++ b/modules/darwin/dotfiles.nix @@ -4,11 +4,11 @@ programs.fish = { shellAbbrs = { - nr = "rebuild-darwin"; - nro = "rebuild-darwin offline"; + nr = lib.mkForce "rebuild-darwin"; + nro = lib.mkForce "rebuild-darwin offline"; }; functions = { - rebuild-nixos = { + rebuild-darwin = { body = '' if test "$argv[1]" = "offline" set option "--option substitute false" @@ -16,7 +16,7 @@ pushd ${config.dotfilesPath} git add --all popd - commandline -r darwin-rebuild switch $option --flake ${config.dotfilesPath}#macbook + commandline -r "darwin-rebuild switch $option --flake ${config.dotfilesPath}#macbook" commandline -f execute ''; }; diff --git a/modules/darwin/user.nix b/modules/darwin/user.nix index d6ff3a5..50b63b3 100644 --- a/modules/darwin/user.nix +++ b/modules/darwin/user.nix @@ -1,8 +1,19 @@ -{ config, pkgs, ... }: { +{ config, pkgs, lib, ... }: { users.users."${config.user}" = { # macOS user home = "/Users/${config.user}"; shell = pkgs.zsh; # Default shell }; + home-manager.users.${config.user} = { + + accounts.email.accounts.home = { + passwordCommand = lib.mkForce + "${pkgs.age}/bin/age --decrypt --identity /Users/${config.user}/.ssh/id_ed25519 ${ + builtins.toString ./mailpass.age + }"; + }; + + }; + } diff --git a/modules/editor/dotfiles.nix b/modules/editor/dotfiles.nix index 8dce093..04d086e 100644 --- a/modules/editor/dotfiles.nix +++ b/modules/editor/dotfiles.nix @@ -30,7 +30,7 @@ pushd ${config.dotfilesPath} git add --all popd - commandline -r doas nixos-rebuild switch $option --flake ${config.dotfilesPath} + commandline -r "doas nixos-rebuild switch $option --flake ${config.dotfilesPath}" commandline -f execute ''; }; diff --git a/modules/mail/himalaya.nix b/modules/mail/himalaya.nix index 76a443c..ae67b25 100644 --- a/modules/mail/himalaya.nix +++ b/modules/mail/himalaya.nix @@ -19,7 +19,7 @@ }; accounts.email = { - maildirBasePath = "/Users/${config.user}/mail"; + maildirBasePath = "$HOME/mail"; accounts = { home = let address = "${config.user}@${config.mailServer}"; in { @@ -68,7 +68,7 @@ mu.enable = false; notmuch.enable = false; passwordCommand = - "${pkgs.age}/bin/age --decrypt --identity /Users/${config.user}/.ssh/id_ed25519 ${ + "${pkgs.age}/bin/age --decrypt --identity /home/${config.user}/.ssh/id_ed25519 ${ builtins.toString ./mailpass.age }"; smtp = {