Moved configuration.nix and home.nix to profiles

This commit is contained in:
Emmet 2023-06-20 22:03:14 -05:00
parent c4619cbe4f
commit 727b44b3a4
4 changed files with 45 additions and 32 deletions

View file

@ -28,15 +28,24 @@
outputs = { self, nixpkgs, home-manager, nix-doom-emacs, stylix, eaf, eaf-browser, org-nursery, blocklist-hosts, rust-overlay, ... }@inputs:
let
# --- SYSTEM SETTINGS --- #
system = "x86_64-linux"; # system arch
hostname = "snowfire"; # hostname
profile = "personal"; # select a profile defined from my profiles directory
timezone = "America/Chicago"; # select timezone
locale = "en_US.UTF-8"; # select locale
# ---- USER SETTINGS ---- #
name = "emmet"; # username
email = "librephoenix3@pm.me"; # email (used for certain configurations)
dotfilesDir = "~/.dotfiles"; # absolute path of the repo
theme = "ayu-dark"; # selcted theme from my themes directory
# calculates certain things for stylix
# ---- CALCULATIONS ----- #
profileWithSlash = "/" + profile; # I honestly don't know why this is necessary
homeNixPath = ./. + "/profiles" + profileWithSlash + "/home.nix";
configurationNixPath = ./. + "/profiles" + profileWithSlash + "/configuration.nix";
themePolarityPath = "/themes/"+theme+"/polarity.txt";
themePolarity = lib.removeSuffix "\n" (builtins.readFile (./. + themePolarityPath));
backgroundUrlPath = "/themes/"+theme+"/backgroundurl.txt";
@ -57,12 +66,11 @@
emmet = home-manager.lib.homeManagerConfiguration {
inherit pkgs;
modules = [
./user/home.nix
nix-doom-emacs.hmModule
stylix.homeManagerModules.stylix
homeNixPath
];
extraSpecialArgs = {
myName = name;
myHostname = hostname;
myHomeDir = "/home/"+name;
myEmail = email;
myDotfilesDir = dotfilesDir;
@ -70,6 +78,8 @@
myThemePolarity = themePolarity;
myBackgroundUrl = backgroundUrl;
myBackgroundSha256 = backgroundSha256;
inherit (inputs) nix-doom-emacs;
inherit (inputs) stylix;
inherit (inputs) eaf;
inherit (inputs) eaf-browser;
inherit (inputs) org-nursery;
@ -79,16 +89,15 @@
nixosConfigurations = {
snowfire = lib.nixosSystem {
inherit system;
modules = [
./system/configuration.nix
stylix.nixosModules.stylix
];
modules = [ configurationNixPath ];
specialArgs = {
myName = name;
myTheme = theme;
myHostname = hostname;
myThemePolarity = themePolarity;
myBackgroundUrl = backgroundUrl;
myBackgroundSha256 = backgroundSha256;
inherit (inputs) stylix;
inherit (inputs) blocklist-hosts;
};
};

View file

@ -2,13 +2,13 @@
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running nixos-help).
{ config, lib, pkgs, blocklist-hosts, myHostname, myTheme, myBackgroundUrl, myBackgroundSha256, ... }:
{ config, lib, pkgs, blocklist-hosts, myName, myHostname, myTheme, myBackgroundUrl, myBackgroundSha256, ... }:
let blocklist = builtins.readFile "${blocklist-hosts}/alternates/gambling-porn/hosts";
in
{
imports =
[ ./hardware-configuration.nix
./style/stylix.nix
[ ../../system/hardware-configuration.nix
../../system/style/stylix.nix
];
nix.nixPath = [ "nixpkgs=/nix/var/nix/profiles/per-user/root/channels/nixos"
@ -26,7 +26,7 @@ in
security.doas.enable = true;
security.sudo.enable = false;
security.doas.extraRules = [{
users = [ "emmet" ];
users = [ "${myName}" ];
keepEnv = true;
persist = true;
}];
@ -135,7 +135,7 @@ in
users.defaultUserShell = pkgs.zsh;
# Define a user account. Don't forget to set a password with passwd.
users.users.emmet = {
users.users.${myName} = {
isNormalUser = true;
description = "Emmet";
extraGroups = [ "networkmanager" "wheel" ];

View file

@ -1,4 +1,4 @@
{ config, lib, pkgs, python3Packages, myName, myEmail, myHomeDir, myDotfilesDir, myTheme, ... }:
{ config, lib, pkgs, python3Packages, nix-doom-emacs, stylix, myName, myEmail, myHomeDir, myDotfilesDir, myTheme, ... }:
{
# Home Manager needs a bit of information about you and the paths it should
@ -9,21 +9,23 @@
programs.home-manager.enable = true;
imports = [
./wm/xmonad/xmonad.nix # My xmonad config
./shell/sh.nix # My zsh and bash config
./shell/cli-collection.nix # Useful CLI apps
./bin/phoenix.nix # My nix command wrapper
./app/doom-emacs/doom.nix # My doom emacs config
./app/ranger/ranger.nix # My ranger file manager config
./app/git/git.nix # My git config
./app/keepass/keepass.nix # My password manager
./app/browser/librewolf.nix # My default browser
./app/games/games.nix # Various videogame apps
./app/virtualization/virtualization.nix # Virtual machines
./app/flatpak/flatpak.nix # Flatpaks
./style/stylix.nix # Styling and themes for my apps
./lang/cc/cc.nix # C and C++ tools
./lang/godot/godot.nix # Game development
nix-doom-emacs.hmModule
stylix.homeManagerModules.stylix
../../user/wm/xmonad/xmonad.nix # My xmonad config
../../user/shell/sh.nix # My zsh and bash config
../../user/shell/cli-collection.nix # Useful CLI apps
../../user/bin/phoenix.nix # My nix command wrapper
../../user/app/doom-emacs/doom.nix # My doom emacs config
../../user/app/ranger/ranger.nix # My ranger file manager config
../../user/app/git/git.nix # My git config
../../user/app/keepass/keepass.nix # My password manager
../../user/app/browser/librewolf.nix # My default browser
../../user/app/games/games.nix # Various videogame apps
../../user/app/virtualization/virtualization.nix # Virtual machines
../../user/app/flatpak/flatpak.nix # Flatpaks
../../user/style/stylix.nix # Styling and themes for my apps
../../user/lang/cc/cc.nix # C and C++ tools
../../user/lang/godot/godot.nix # Game development
];
home.stateVersion = "22.11"; # Please read the comment before changing.

View file

@ -1,4 +1,4 @@
{ config, pkgs, myTheme, myThemePolarity, myBackgroundUrl, myBackgroundSha256, ... }:
{ config, pkgs, stylix, myTheme, myThemePolarity, myBackgroundUrl, myBackgroundSha256, ... }:
let
myFont = "Inconsolata";
@ -7,11 +7,13 @@ let
myLightDMTheme = if myThemePolarity == "light" then "Adwaita" else "Adwaita-dark";
in
{
imports = [ stylix.nixosModules.stylix ];
stylix.autoEnable = false;
stylix.polarity = myThemePolarity;
stylix.image = pkgs.fetchurl {
url = myBackgroundUrl;
sha256 = myBackgroundSha256;
url = myBackgroundUrl;
sha256 = myBackgroundSha256;
};
stylix.base16Scheme = ./. + myThemePath;
stylix.fonts = {