trying to add a second user on one machine

This commit is contained in:
Nicholas Young 2023-02-16 11:28:00 -08:00
parent 6e1a140903
commit 4349ad8a1f
6 changed files with 162 additions and 4 deletions

View file

@ -7,17 +7,38 @@
url = github:nix-community/home-manager; url = github:nix-community/home-manager;
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
kmonad.url = "github:kmonad/kmonad?dir=nix"; kmonad.url = "github:kmonad/kmonad?dir=nix";
}; };
outputs = inputs@{ self, nixpkgs, home-manager, kmonad }: outputs = inputs@{ self, nixpkgs, home-manager, kmonad }:
let let
user = "nixolas"; user = "nixolas";
system = "x86_64-linux";
pkgs = import nixpkgs {
inherit system;
config.allowUnfree = true;
};
in { in {
nixosConfigurations = import ./hosts { nixosConfigurations = {
inherit (nixpkgs) lib; inherit (nixpkgs) lib;
inherit inputs nixpkgs home-manager user kmonad ; inherit inputs nixpkgs home-manager user kmonad ;
NicksNixLaptop = {
inherit system;
specialArgs = inputs;
modules = [
{
networking.hostName = "NicksNixLaptop";
}
kmonad.nixosModules.default
./hosts/laptop
./hosts/configuration.nix
./modules/kmonad.nix
./hosts/laptop/home.nix
];
}
}; };
}; };
} }

View file

@ -27,7 +27,7 @@ in {
extraSpecialArgs = { inherit user; }; extraSpecialArgs = { inherit user; };
users.${user} = { users.${user} = {
imports = [ imports = [
./home.nix ../users/${user}.nix
../modules/emacs.nix ../modules/emacs.nix
../modules/git.nix ../modules/git.nix
../modules/fusuma.nix ../modules/fusuma.nix
@ -37,6 +37,18 @@ in {
../modules/zsh.nix ../modules/zsh.nix
]; ];
}; };
users.nicholix = {
imports = [
../users/nicholix.nix
../modules/emacs.nix
../modules/git.nix
../modules/fusuma.nix
../modules/vim.nix
../modules/wezterm.nix
../modules/xdg.nix
../modules/zsh.nix
]
}
}; };
} }
]; ];

View file

@ -1,7 +1,9 @@
{ ... }: { ... }:
{ {
imports = [ (import ./hardware-configuration.nix) ]; imports = [
./hardware-configuration.nix
];
hardware.bluetooth.enable = true; hardware.bluetooth.enable = true;

35
hosts/laptop/home.nix Normal file
View file

@ -0,0 +1,35 @@
{ config, lib, pkgs, user, home-manager, ... }:
{
home-manager.nixosModules.home-manager {
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
extraSpecialArgs = { inherit user; };
users.${user} = {
imports = [
../../users/${user}.nix
../../modules/emacs.nix
../../../modules/git.nix
../../modules/fusuma.nix
../../modules/vim.nix
../../modules/wezterm.nix
../../modules/xdg.nix
../../modules/zsh.nix
];
};
users.nicholix = {
imports = [
../../users/nicholix.nix
../../modules/emacs.nix
../../modules/git.nix
../../modules/fusuma.nix
../../modules/vim.nix
../../modules/wezterm.nix
../../modules/xdg.nix
../../modules/zsh.nix
];
};
};
}
}

88
users/nicholix.nix Normal file
View file

@ -0,0 +1,88 @@
{ config, pkgs, ... }:
let
moz_overlay = import (builtins.fetchTarball https://github.com/mozilla/nixpkgs-mozilla/archive/master.tar.gz);
nixpkgs = import <nixpkgs> {
overlays = [ moz_overlay ];
};
ruststable = (nixpkgs.latest.rustChannels.stable.rust.override {
extensions = [ "rust-src" "rust-analysis" ];}
);
user = "nicholix";
in
{
# Let Home Manager install and manage itself.
programs.home-manager.enable = true;
programs.direnv.enable = true;
programs.direnv.nix-direnv.enable = true;
home = {
# Home Manager needs a bit of information about you and the
# paths it should manage.
username = user;
homeDirectory = "/home/${user}";
# This value determines the Home Manager release that your
# configuration is compatible with. This helps avoid breakage
# when a new Home Manager release introduces backwards
# incompatible changes.
#
# You can update Home Manager without changing this value. See
# the Home Manager release notes for a list of state version
# changes in each release.
stateVersion = "22.11";
packages = with pkgs; [
# utilities
ffmpeg-full
frei0r # kdenlive video plugins
pandoc
fontpreview
texlive.combined.scheme-medium
# commandline utils
pfetch
fortune
rmtrash
ripgrep
fd
neofetch
ranger
exa
xdotool
vhs
nodejs # required for coc-nvim
# Gui application
darktable # RAW processing
firefox # Internet access
inkscape # Vector drawing
jellyfin-media-player # plex-like media player client
kicad # PCB design
krita # Raster drawing
libreoffice # Office editing
obsidian # Markdown and notes
qalculate-gtk # unit-friendly calculator
vscodium # when vim isn't enough
libsForQt5.kate # kate/kwrite
libsForQt5.ark # kde archive manager
# Kdenlive and deps
libsForQt5.kdenlive
mediainfo
mlt
# Drawing tablet driver
opentabletdriver
];
sessionVariables = {
NIX_SHELL_PRESERVE_PROMPT = 1;
};
};
}