mirror of
https://github.com/librephoenix/nixos-config
synced 2025-01-18 22:55:52 +05:30
More user config variables set in flake
This commit is contained in:
parent
976317527e
commit
86535623cf
29
flake.nix
29
flake.nix
|
@ -14,27 +14,39 @@
|
|||
username = "emmet"; # username
|
||||
name = "Emmet"; # name/identifier
|
||||
email = "librephoenix3@pm.me"; # email (used for certain configurations)
|
||||
dotfilesDir = "~/.dotfiles"; # absolute path of the repo locally
|
||||
theme = "ayu-dark"; # selcted theme from my themes directory
|
||||
wm = "xmonad"; # Selected window manager or desktop environment
|
||||
dotfilesDir = "~/.dotfiles"; # absolute path of the local repo
|
||||
theme = "ayu-dark"; # selcted theme from my themes directory (./themes/)
|
||||
wm = "xmonad"; # Selected window manager or desktop environment; must select one in both ./user/wm/ and ./system/wm/
|
||||
browser = "librewolf"; # Default browser; must select one from ./user/app/browser/
|
||||
editor = "emacsclient"; # Default editor;
|
||||
term = "alacritty -o font.size=20"; # Default terminal command;
|
||||
font = "Inconsolata"; # Selected font
|
||||
fontPkg = pkgs.inconsolata; # Font package
|
||||
|
||||
# set pkgs to correct type
|
||||
# editor spawning translator
|
||||
# generates a command that can be used to spawn editor inside a gui
|
||||
# EDITOR and TERM session variables must be set in home.nix or other module
|
||||
# I set the session variable SPAWNEDITOR to this in my home.nix for convenience
|
||||
spawnEditor = if (editor == "emacsclient") then "emacsclient -c -a 'emacs'"
|
||||
else (if (editor == ("vim" || "nvim" || "nano")) then "$TERM -e $EDITOR" else editor);
|
||||
|
||||
# configure pkgs
|
||||
pkgs = import nixpkgs {
|
||||
inherit system;
|
||||
config = { allowUnfree = true; };
|
||||
overlays = [ rust-overlay.overlays.default ];
|
||||
};
|
||||
|
||||
# configure lib
|
||||
lib = nixpkgs.lib;
|
||||
|
||||
in {
|
||||
homeConfigurations = {
|
||||
emmet = home-manager.lib.homeManagerConfiguration {
|
||||
inherit pkgs;
|
||||
modules = [ (./. + "/profiles"+("/"+profile)+"/home.nix") ]; # load home.nix from profile
|
||||
modules = [ (./. + "/profiles"+("/"+profile)+"/home.nix") ]; # load home.nix from selected PROFILE
|
||||
extraSpecialArgs = {
|
||||
# pass config variables from above
|
||||
inherit username;
|
||||
inherit name;
|
||||
inherit hostname;
|
||||
|
@ -44,6 +56,10 @@
|
|||
inherit font;
|
||||
inherit fontPkg;
|
||||
inherit wm;
|
||||
inherit browser;
|
||||
inherit editor;
|
||||
inherit term;
|
||||
inherit spawnEditor;
|
||||
inherit (inputs) nix-doom-emacs;
|
||||
inherit (inputs) stylix;
|
||||
inherit (inputs) eaf;
|
||||
|
@ -55,8 +71,9 @@
|
|||
nixosConfigurations = {
|
||||
snowfire = lib.nixosSystem {
|
||||
inherit system;
|
||||
modules = [ (./. + "/profiles"+("/"+profile)+"/configuration.nix") ]; # load configuration.nix from profile
|
||||
modules = [ (./. + "/profiles"+("/"+profile)+"/configuration.nix") ]; # load configuration.nix from selected PROFILE
|
||||
specialArgs = {
|
||||
# pass config variables from above
|
||||
inherit username;
|
||||
inherit name;
|
||||
inherit hostname;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{ config, lib, pkgs, python3Packages, nix-doom-emacs, stylix, username, email, dotfilesDir, theme, ... }:
|
||||
{ config, lib, pkgs, python3Packages, nix-doom-emacs, stylix, username, email, dotfilesDir, theme, wm, browser, editor, spawnEditor, term, ... }:
|
||||
|
||||
{
|
||||
# Home Manager needs a bit of information about you and the paths it should
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{ config, lib, pkgs, python3Packages, nix-doom-emacs, stylix, username, email, dotfilesDir, theme, wm, ... }:
|
||||
{ config, lib, pkgs, python3Packages, nix-doom-emacs, stylix, username, email, dotfilesDir, theme, wm, browser, editor, spawnEditor, term, ... }:
|
||||
|
||||
{
|
||||
# Home Manager needs a bit of information about you and the paths it should
|
||||
|
@ -19,7 +19,7 @@
|
|||
../../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/browser"+("/"+browser)+".nix") # My default browser selected from flake
|
||||
../../user/app/virtualization/virtualization.nix # Virtual machines
|
||||
../../user/app/flatpak/flatpak.nix # Flatpaks
|
||||
../../user/style/stylix.nix # Styling and themes for my apps
|
||||
|
@ -100,4 +100,11 @@
|
|||
xdg.mime.enable = true;
|
||||
xdg.mimeApps.enable = true;
|
||||
|
||||
home.sessionVariables = {
|
||||
EDITOR = editor;
|
||||
SPAWNEDITOR = spawnEditor;
|
||||
TERM = term;
|
||||
BROWSER = browser;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -48,8 +48,10 @@ myFocusedBorderColor = colorFocus
|
|||
|
||||
-- Default apps
|
||||
myTerminal, myBrowser :: String
|
||||
myTerminal = "alacritty -o font.size=20"
|
||||
myBrowser = "librewolf"
|
||||
myTerminal = "$TERM"
|
||||
myBrowser = "$BROWSER"
|
||||
myEditor = "$EDITOR"
|
||||
mySpawnEditor = "$SPAWNEDITOR"
|
||||
|
||||
-- Whether focus follows the mouse pointer.
|
||||
myFocusFollowsMouse :: Bool
|
||||
|
@ -108,7 +110,6 @@ myScratchPads =
|
|||
w = 0.9
|
||||
t = 0.95 - h
|
||||
l = 0.95 - w
|
||||
--spawnRanger = myTerminal ++ " --title ranger-scratchpad -e ranger"
|
||||
spawnRanger = "kitty --title ranger-scratchpad -e ranger"
|
||||
findRanger = title =? "ranger-scratchpad"
|
||||
manageRanger = customFloating $ W.RationalRect l t w h
|
||||
|
@ -191,7 +192,7 @@ myKeys conf@(XConfig {XMonad.modMask = modm}) =
|
|||
((modm, xK_Return), spawn $ XMonad.terminal conf),
|
||||
|
||||
-- launch emacsclient
|
||||
((modm, xK_a), spawn "emacsclient -c -a 'emacs'"),
|
||||
((modm, xK_a), spawn mySpawnEditor),
|
||||
|
||||
-- launch browser
|
||||
((modm, xK_s), spawn myBrowser),
|
||||
|
|
|
@ -89,8 +89,10 @@ myFocusedBorderColor = colorFocus
|
|||
#+BEGIN_SRC haskell :tangle xmonad.hs
|
||||
-- Default apps
|
||||
myTerminal, myBrowser :: String
|
||||
myTerminal = "alacritty -o font.size=20"
|
||||
myBrowser = "librewolf"
|
||||
myTerminal = "$TERM"
|
||||
myBrowser = "$BROWSER"
|
||||
myEditor = "$EDITOR"
|
||||
mySpawnEditor = "$SPAWNEDITOR"
|
||||
|
||||
#+END_SRC
|
||||
*** Mouse Focus
|
||||
|
@ -167,7 +169,6 @@ myScratchPads =
|
|||
w = 0.9
|
||||
t = 0.95 - h
|
||||
l = 0.95 - w
|
||||
--spawnRanger = myTerminal ++ " --title ranger-scratchpad -e ranger"
|
||||
spawnRanger = "kitty --title ranger-scratchpad -e ranger"
|
||||
findRanger = title =? "ranger-scratchpad"
|
||||
manageRanger = customFloating $ W.RationalRect l t w h
|
||||
|
@ -268,7 +269,7 @@ The following binds the following:
|
|||
((modm, xK_Return), spawn $ XMonad.terminal conf),
|
||||
|
||||
-- launch emacsclient
|
||||
((modm, xK_a), spawn "emacsclient -c -a 'emacs'"),
|
||||
((modm, xK_a), spawn mySpawnEditor),
|
||||
|
||||
-- launch browser
|
||||
((modm, xK_s), spawn myBrowser),
|
||||
|
|
Loading…
Reference in a new issue