From 4349ad8a1f6e1599d500f25b34e726bf4809936e Mon Sep 17 00:00:00 2001 From: Nicholas Young Date: Thu, 16 Feb 2023 11:28:00 -0800 Subject: [PATCH] trying to add a second user on one machine --- flake.nix | 25 +++++++- hosts/default.nix | 14 ++++- hosts/laptop/default.nix | 4 +- hosts/laptop/home.nix | 35 ++++++++++++ users/nicholix.nix | 88 +++++++++++++++++++++++++++++ hosts/home.nix => users/nixolas.nix | 0 6 files changed, 162 insertions(+), 4 deletions(-) create mode 100644 hosts/laptop/home.nix create mode 100644 users/nicholix.nix rename hosts/home.nix => users/nixolas.nix (100%) diff --git a/flake.nix b/flake.nix index 58fba6f..1a40a97 100644 --- a/flake.nix +++ b/flake.nix @@ -7,17 +7,38 @@ url = github:nix-community/home-manager; inputs.nixpkgs.follows = "nixpkgs"; }; - kmonad.url = "github:kmonad/kmonad?dir=nix"; + }; outputs = inputs@{ self, nixpkgs, home-manager, kmonad }: let user = "nixolas"; + system = "x86_64-linux"; + pkgs = import nixpkgs { + inherit system; + config.allowUnfree = true; + }; in { - nixosConfigurations = import ./hosts { + nixosConfigurations = { inherit (nixpkgs) lib; 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 + ]; + } }; }; } diff --git a/hosts/default.nix b/hosts/default.nix index dabadcb..7e23e6a 100644 --- a/hosts/default.nix +++ b/hosts/default.nix @@ -27,7 +27,7 @@ in { extraSpecialArgs = { inherit user; }; users.${user} = { imports = [ - ./home.nix + ../users/${user}.nix ../modules/emacs.nix ../modules/git.nix ../modules/fusuma.nix @@ -37,6 +37,18 @@ in { ../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 + ] + } }; } ]; diff --git a/hosts/laptop/default.nix b/hosts/laptop/default.nix index 8c52e9b..f6a3658 100644 --- a/hosts/laptop/default.nix +++ b/hosts/laptop/default.nix @@ -1,7 +1,9 @@ { ... }: { - imports = [ (import ./hardware-configuration.nix) ]; + imports = [ + ./hardware-configuration.nix + ]; hardware.bluetooth.enable = true; diff --git a/hosts/laptop/home.nix b/hosts/laptop/home.nix new file mode 100644 index 0000000..7cafdd6 --- /dev/null +++ b/hosts/laptop/home.nix @@ -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 + ]; + }; + }; + } +} \ No newline at end of file diff --git a/users/nicholix.nix b/users/nicholix.nix new file mode 100644 index 0000000..6d3a617 --- /dev/null +++ b/users/nicholix.nix @@ -0,0 +1,88 @@ +{ config, pkgs, ... }: + +let + moz_overlay = import (builtins.fetchTarball https://github.com/mozilla/nixpkgs-mozilla/archive/master.tar.gz); + nixpkgs = import { + 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; + }; + }; +} diff --git a/hosts/home.nix b/users/nixolas.nix similarity index 100% rename from hosts/home.nix rename to users/nixolas.nix