pass user as arg

This commit is contained in:
Noah Masur 2022-04-28 20:46:00 -04:00
parent eadec0c699
commit 71e4cc2f5a
6 changed files with 17 additions and 15 deletions

View File

@ -26,6 +26,7 @@
nixosConfigurations = {
desktop = nixpkgs.lib.nixosSystem {
inherit system;
specialArgs = { inherit user; };
modules = [
./nixos/configuration.nix
home-manager.nixosModules.home-manager
@ -33,16 +34,17 @@
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
extraSpecialArgs = { inherit user; };
users.${user} = {
imports = [
./nixos/home.nix
./modules/applications/firefox.nix
./modules/applications/alacritty.nix
./modules/shell/fish.nix
./modules/shell/utilities.nix
./modules/shell/git.nix
./modules/shell/github.nix
./modules/editor/neovim.nix
./modules/applications/alacritty.nix
];
};
};

View File

@ -8,5 +8,6 @@
xdg.configFile = { "nvim/init.lua".source = ../../nvim.configlink/init.lua; };
programs.git.extraConfig.core.editor = "nvim";
home.sessionVariables = { EDITOR = "nvim"; };
}

View File

@ -90,6 +90,8 @@
shellInit = "";
};
home.sessionVariables = { fish_greeting = ""; };
programs.starship = {
enable = true;
enableFishIntegration = true;

View File

@ -19,4 +19,9 @@
glow
];
home.file = {
".rgignore".text = config.ignorePatterns;
".fdignore".text = config.ignorePatterns;
};
}

View File

@ -2,7 +2,7 @@
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running nixos-help).
{ config, pkgs, ... }:
{ config, pkgs, user, ... }:
{
imports = [ # Include the results of the hardware scan.
@ -102,7 +102,7 @@
fonts.fontconfig.defaultFonts.monospace = [ "Victor Mono" ];
# Define a user account. Don't forget to set a password with passwd.
users.users.noah = {
users.users.${user} = {
# Create a home directory for human user
isNormalUser = true;

View File

@ -1,9 +1,7 @@
{ pkgs, lib, ... }:
{ pkgs, user, lib, ... }:
let
editor = "nvim";
font = "Victor Mono";
dotfiles = builtins.toString ../.;
nixos_config = builtins.toString ./.;
notes_path = "$HOME/dev/personal/notes";
@ -22,11 +20,12 @@ let
in {
options = with lib; {
user = mkOption { default = "noah"; };
testuser = mkOption { default = user; };
fullName = mkOption { default = "Noah Masur"; };
font = mkOption { default = font; };
font = mkOption { default = "Victor Mono"; };
nixos_config = mkOption { default = nixos_config; };
dotfiles = mkOption { default = dotfiles; };
ignorePatterns = mkOption { default = ignore_patterns; };
};
config = {
@ -52,8 +51,6 @@ in {
gtk.theme = { name = "Adwaita-dark"; };
home.sessionVariables = {
fish_greeting = "";
EDITOR = "${editor}";
NIXOS_CONFIG = "${nixos_config}";
DOTS = "${dotfiles}";
NOTES_PATH = "${notes_path}";
@ -66,11 +63,6 @@ in {
"direnvrc".text = "source $HOME/.nix-profile/share/nix-direnv/direnvrc";
"spectrwm/spectrwm.conf".source = ./spectrwm.conf;
};
home.file = {
".rgignore".text = ignore_patterns;
".fdignore".text = ignore_patterns;
};
programs.direnv = {
enable = true;
nix-direnv.enable = true;