pass other values as arg

This commit is contained in:
Noah Masur 2022-04-28 20:54:37 -04:00
parent 71e4cc2f5a
commit b922cd8f09
6 changed files with 22 additions and 22 deletions

View File

@ -22,11 +22,17 @@
}; };
user = "noah"; user = "noah";
fullName = "Noah Masur";
font = {
package = pkgs.victor-mono;
name = "Victor Mono";
};
in { in {
nixosConfigurations = { nixosConfigurations = {
desktop = nixpkgs.lib.nixosSystem { desktop = nixpkgs.lib.nixosSystem {
inherit system; inherit system;
specialArgs = { inherit user; }; specialArgs = { inherit user fullName font; };
modules = [ modules = [
./nixos/configuration.nix ./nixos/configuration.nix
home-manager.nixosModules.home-manager home-manager.nixosModules.home-manager
@ -34,7 +40,7 @@
home-manager = { home-manager = {
useGlobalPkgs = true; useGlobalPkgs = true;
useUserPackages = true; useUserPackages = true;
extraSpecialArgs = { inherit user; }; extraSpecialArgs = { inherit user fullName font; };
users.${user} = { users.${user} = {
imports = [ imports = [
./nixos/home.nix ./nixos/home.nix

View File

@ -1,4 +1,4 @@
{ pkgs, config, ... }: { { pkgs, config, font, ... }: {
programs.alacritty = { programs.alacritty = {
enable = true; enable = true;
settings = { settings = {
@ -15,7 +15,7 @@
scrolling.history = 10000; scrolling.history = 10000;
font = { font = {
size = 14.0; size = 14.0;
normal = { family = "${config.font}"; }; normal = { family = font.name; };
}; };
key_bindings = [ key_bindings = [
{ {

View File

@ -1 +1 @@
{ pkgs, dotfiles, nixos_config ... }: { imports = [ ./fish.nix ]; } { ... }: { imports = [ ./fish.nix ]; }

View File

@ -1,4 +1,4 @@
{ config, pkgs, ... }: { { pkgs, ... }: {
programs.fish = { programs.fish = {
enable = true; enable = true;
@ -25,8 +25,9 @@
s = "sudo"; s = "sudo";
sc = "systemctl"; sc = "systemctl";
scs = "systemctl status"; scs = "systemctl status";
reb = reb = "nixos-rebuild switch -I nixos-config=${
"nixos-rebuild switch -I nixos-config=${config.nixos_config}/configuration.nix"; builtins.toString ../../nixos/.
}/configuration.nix";
# Tmux # Tmux
ta = "tmux attach-session"; ta = "tmux attach-session";
@ -37,7 +38,7 @@
v = "vim"; v = "vim";
vl = "vim -c 'normal! `0'"; vl = "vim -c 'normal! `0'";
vll = "vim -c 'Telescope oldfiles'"; vll = "vim -c 'Telescope oldfiles'";
vimrc = "vim ${config.dotfiles}/nvim.configlink/init.lua"; vimrc = "vim ${builtins.toString ../../.}/nvim.configlink/init.lua";
# Notes # Notes
qn = "quicknote"; qn = "quicknote";

View File

@ -1,12 +1,12 @@
{ config, pkgs, ... }: { { config, pkgs, fullName, ... }: {
programs.git = { programs.git = {
enable = true; enable = true;
userName = "${config.fullName}"; userName = fullName;
userEmail = "7386960+nmasur@users.noreply.github.com"; userEmail = "7386960+nmasur@users.noreply.github.com";
extraConfig = { extraConfig = {
pager = { branch = "false"; }; pager = { branch = "false"; };
safe = { directory = "${config.dotfiles}"; }; safe = { directory = builtins.toString ../../.; };
}; };
}; };

View File

@ -2,8 +2,6 @@
let let
dotfiles = builtins.toString ../.;
nixos_config = builtins.toString ./.;
notes_path = "$HOME/dev/personal/notes"; notes_path = "$HOME/dev/personal/notes";
ignore_patterns = '' ignore_patterns = ''
@ -20,11 +18,6 @@ let
in { in {
options = with lib; { options = with lib; {
testuser = mkOption { default = user; };
fullName = mkOption { default = "Noah Masur"; };
font = mkOption { default = "Victor Mono"; };
nixos_config = mkOption { default = nixos_config; };
dotfiles = mkOption { default = dotfiles; };
ignorePatterns = mkOption { default = ignore_patterns; }; ignorePatterns = mkOption { default = ignore_patterns; };
}; };
@ -51,8 +44,8 @@ in {
gtk.theme = { name = "Adwaita-dark"; }; gtk.theme = { name = "Adwaita-dark"; };
home.sessionVariables = { home.sessionVariables = {
NIXOS_CONFIG = "${nixos_config}"; NIXOS_CONFIG = builtins.toString ./.;
DOTS = "${dotfiles}"; DOTS = builtins.toString ../.;
NOTES_PATH = "${notes_path}"; NOTES_PATH = "${notes_path}";
}; };
@ -66,7 +59,7 @@ in {
programs.direnv = { programs.direnv = {
enable = true; enable = true;
nix-direnv.enable = true; nix-direnv.enable = true;
config = { whitelist = { prefix = [ "${dotfiles}/" ]; }; }; config = { whitelist = { prefix = [ "${builtins.toString ../.}/" ]; }; };
}; };
# Email # Email