fix build on linux

This commit is contained in:
Noah Masur 2022-06-19 23:54:16 -04:00
parent e22a4f3df2
commit fdfc66c7ad
6 changed files with 27 additions and 11 deletions

View File

@ -26,10 +26,15 @@
description = "Base16 color scheme"; 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; type = types.path;
description = "Path of dotfiles repository."; description = "Path of dotfiles repository.";
default = builtins.toPath "$HOME/dev/personal/dotfiles"; default = builtins.toPath "${homePath}/dev/personal/dotfiles";
}; };
dotfilesRepo = mkOption { dotfilesRepo = mkOption {
type = types.str; type = types.str;

View File

@ -16,7 +16,7 @@ nixpkgs.lib.nixosSystem {
gui = { gui = {
enable = true; enable = true;
compositor.enable = true; compositor.enable = true;
colorscheme = (import ../modules/colorscheme/gruvbox); colorscheme = (import ../../modules/colorscheme/gruvbox);
wallpaper = "${wallpapers}/gruvbox/road.jpg"; wallpaper = "${wallpapers}/gruvbox/road.jpg";
gtk.theme = { name = "Adwaita-dark"; }; gtk.theme = { name = "Adwaita-dark"; };
}; };

View File

@ -4,11 +4,11 @@
programs.fish = { programs.fish = {
shellAbbrs = { shellAbbrs = {
nr = "rebuild-darwin"; nr = lib.mkForce "rebuild-darwin";
nro = "rebuild-darwin offline"; nro = lib.mkForce "rebuild-darwin offline";
}; };
functions = { functions = {
rebuild-nixos = { rebuild-darwin = {
body = '' body = ''
if test "$argv[1]" = "offline" if test "$argv[1]" = "offline"
set option "--option substitute false" set option "--option substitute false"
@ -16,7 +16,7 @@
pushd ${config.dotfilesPath} pushd ${config.dotfilesPath}
git add --all git add --all
popd popd
commandline -r darwin-rebuild switch $option --flake ${config.dotfilesPath}#macbook commandline -r "darwin-rebuild switch $option --flake ${config.dotfilesPath}#macbook"
commandline -f execute commandline -f execute
''; '';
}; };

View File

@ -1,8 +1,19 @@
{ config, pkgs, ... }: { { config, pkgs, lib, ... }: {
users.users."${config.user}" = { # macOS user users.users."${config.user}" = { # macOS user
home = "/Users/${config.user}"; home = "/Users/${config.user}";
shell = pkgs.zsh; # Default shell 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
}";
};
};
} }

View File

@ -30,7 +30,7 @@
pushd ${config.dotfilesPath} pushd ${config.dotfilesPath}
git add --all git add --all
popd popd
commandline -r doas nixos-rebuild switch $option --flake ${config.dotfilesPath} commandline -r "doas nixos-rebuild switch $option --flake ${config.dotfilesPath}"
commandline -f execute commandline -f execute
''; '';
}; };

View File

@ -19,7 +19,7 @@
}; };
accounts.email = { accounts.email = {
maildirBasePath = "/Users/${config.user}/mail"; maildirBasePath = "$HOME/mail";
accounts = { accounts = {
home = let address = "${config.user}@${config.mailServer}"; home = let address = "${config.user}@${config.mailServer}";
in { in {
@ -68,7 +68,7 @@
mu.enable = false; mu.enable = false;
notmuch.enable = false; notmuch.enable = false;
passwordCommand = 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 builtins.toString ./mailpass.age
}"; }";
smtp = { smtp = {