mirror of
https://github.com/librephoenix/nixos-config
synced 2025-01-19 07:05:51 +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
|
username = "emmet"; # username
|
||||||
name = "Emmet"; # name/identifier
|
name = "Emmet"; # name/identifier
|
||||||
email = "librephoenix3@pm.me"; # email (used for certain configurations)
|
email = "librephoenix3@pm.me"; # email (used for certain configurations)
|
||||||
dotfilesDir = "~/.dotfiles"; # absolute path of the repo locally
|
dotfilesDir = "~/.dotfiles"; # absolute path of the local repo
|
||||||
theme = "ayu-dark"; # selcted theme from my themes directory
|
theme = "ayu-dark"; # selcted theme from my themes directory (./themes/)
|
||||||
wm = "xmonad"; # Selected window manager or desktop environment
|
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
|
font = "Inconsolata"; # Selected font
|
||||||
fontPkg = pkgs.inconsolata; # Font package
|
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 {
|
pkgs = import nixpkgs {
|
||||||
inherit system;
|
inherit system;
|
||||||
config = { allowUnfree = true; };
|
config = { allowUnfree = true; };
|
||||||
overlays = [ rust-overlay.overlays.default ];
|
overlays = [ rust-overlay.overlays.default ];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# configure lib
|
||||||
lib = nixpkgs.lib;
|
lib = nixpkgs.lib;
|
||||||
|
|
||||||
in {
|
in {
|
||||||
homeConfigurations = {
|
homeConfigurations = {
|
||||||
emmet = home-manager.lib.homeManagerConfiguration {
|
emmet = home-manager.lib.homeManagerConfiguration {
|
||||||
inherit pkgs;
|
inherit pkgs;
|
||||||
modules = [ (./. + "/profiles"+("/"+profile)+"/home.nix") ]; # load home.nix from profile
|
modules = [ (./. + "/profiles"+("/"+profile)+"/home.nix") ]; # load home.nix from selected PROFILE
|
||||||
extraSpecialArgs = {
|
extraSpecialArgs = {
|
||||||
|
# pass config variables from above
|
||||||
inherit username;
|
inherit username;
|
||||||
inherit name;
|
inherit name;
|
||||||
inherit hostname;
|
inherit hostname;
|
||||||
|
@ -44,6 +56,10 @@
|
||||||
inherit font;
|
inherit font;
|
||||||
inherit fontPkg;
|
inherit fontPkg;
|
||||||
inherit wm;
|
inherit wm;
|
||||||
|
inherit browser;
|
||||||
|
inherit editor;
|
||||||
|
inherit term;
|
||||||
|
inherit spawnEditor;
|
||||||
inherit (inputs) nix-doom-emacs;
|
inherit (inputs) nix-doom-emacs;
|
||||||
inherit (inputs) stylix;
|
inherit (inputs) stylix;
|
||||||
inherit (inputs) eaf;
|
inherit (inputs) eaf;
|
||||||
|
@ -55,8 +71,9 @@
|
||||||
nixosConfigurations = {
|
nixosConfigurations = {
|
||||||
snowfire = lib.nixosSystem {
|
snowfire = lib.nixosSystem {
|
||||||
inherit system;
|
inherit system;
|
||||||
modules = [ (./. + "/profiles"+("/"+profile)+"/configuration.nix") ]; # load configuration.nix from profile
|
modules = [ (./. + "/profiles"+("/"+profile)+"/configuration.nix") ]; # load configuration.nix from selected PROFILE
|
||||||
specialArgs = {
|
specialArgs = {
|
||||||
|
# pass config variables from above
|
||||||
inherit username;
|
inherit username;
|
||||||
inherit name;
|
inherit name;
|
||||||
inherit hostname;
|
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
|
# 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
|
# 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/ranger/ranger.nix # My ranger file manager config
|
||||||
../../user/app/git/git.nix # My git config
|
../../user/app/git/git.nix # My git config
|
||||||
../../user/app/keepass/keepass.nix # My password manager
|
../../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/virtualization/virtualization.nix # Virtual machines
|
||||||
../../user/app/flatpak/flatpak.nix # Flatpaks
|
../../user/app/flatpak/flatpak.nix # Flatpaks
|
||||||
../../user/style/stylix.nix # Styling and themes for my apps
|
../../user/style/stylix.nix # Styling and themes for my apps
|
||||||
|
@ -100,4 +100,11 @@
|
||||||
xdg.mime.enable = true;
|
xdg.mime.enable = true;
|
||||||
xdg.mimeApps.enable = true;
|
xdg.mimeApps.enable = true;
|
||||||
|
|
||||||
|
home.sessionVariables = {
|
||||||
|
EDITOR = editor;
|
||||||
|
SPAWNEDITOR = spawnEditor;
|
||||||
|
TERM = term;
|
||||||
|
BROWSER = browser;
|
||||||
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,8 +48,10 @@ myFocusedBorderColor = colorFocus
|
||||||
|
|
||||||
-- Default apps
|
-- Default apps
|
||||||
myTerminal, myBrowser :: String
|
myTerminal, myBrowser :: String
|
||||||
myTerminal = "alacritty -o font.size=20"
|
myTerminal = "$TERM"
|
||||||
myBrowser = "librewolf"
|
myBrowser = "$BROWSER"
|
||||||
|
myEditor = "$EDITOR"
|
||||||
|
mySpawnEditor = "$SPAWNEDITOR"
|
||||||
|
|
||||||
-- Whether focus follows the mouse pointer.
|
-- Whether focus follows the mouse pointer.
|
||||||
myFocusFollowsMouse :: Bool
|
myFocusFollowsMouse :: Bool
|
||||||
|
@ -108,7 +110,6 @@ myScratchPads =
|
||||||
w = 0.9
|
w = 0.9
|
||||||
t = 0.95 - h
|
t = 0.95 - h
|
||||||
l = 0.95 - w
|
l = 0.95 - w
|
||||||
--spawnRanger = myTerminal ++ " --title ranger-scratchpad -e ranger"
|
|
||||||
spawnRanger = "kitty --title ranger-scratchpad -e ranger"
|
spawnRanger = "kitty --title ranger-scratchpad -e ranger"
|
||||||
findRanger = title =? "ranger-scratchpad"
|
findRanger = title =? "ranger-scratchpad"
|
||||||
manageRanger = customFloating $ W.RationalRect l t w h
|
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),
|
((modm, xK_Return), spawn $ XMonad.terminal conf),
|
||||||
|
|
||||||
-- launch emacsclient
|
-- launch emacsclient
|
||||||
((modm, xK_a), spawn "emacsclient -c -a 'emacs'"),
|
((modm, xK_a), spawn mySpawnEditor),
|
||||||
|
|
||||||
-- launch browser
|
-- launch browser
|
||||||
((modm, xK_s), spawn myBrowser),
|
((modm, xK_s), spawn myBrowser),
|
||||||
|
|
|
@ -89,8 +89,10 @@ myFocusedBorderColor = colorFocus
|
||||||
#+BEGIN_SRC haskell :tangle xmonad.hs
|
#+BEGIN_SRC haskell :tangle xmonad.hs
|
||||||
-- Default apps
|
-- Default apps
|
||||||
myTerminal, myBrowser :: String
|
myTerminal, myBrowser :: String
|
||||||
myTerminal = "alacritty -o font.size=20"
|
myTerminal = "$TERM"
|
||||||
myBrowser = "librewolf"
|
myBrowser = "$BROWSER"
|
||||||
|
myEditor = "$EDITOR"
|
||||||
|
mySpawnEditor = "$SPAWNEDITOR"
|
||||||
|
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
*** Mouse Focus
|
*** Mouse Focus
|
||||||
|
@ -167,7 +169,6 @@ myScratchPads =
|
||||||
w = 0.9
|
w = 0.9
|
||||||
t = 0.95 - h
|
t = 0.95 - h
|
||||||
l = 0.95 - w
|
l = 0.95 - w
|
||||||
--spawnRanger = myTerminal ++ " --title ranger-scratchpad -e ranger"
|
|
||||||
spawnRanger = "kitty --title ranger-scratchpad -e ranger"
|
spawnRanger = "kitty --title ranger-scratchpad -e ranger"
|
||||||
findRanger = title =? "ranger-scratchpad"
|
findRanger = title =? "ranger-scratchpad"
|
||||||
manageRanger = customFloating $ W.RationalRect l t w h
|
manageRanger = customFloating $ W.RationalRect l t w h
|
||||||
|
@ -268,7 +269,7 @@ The following binds the following:
|
||||||
((modm, xK_Return), spawn $ XMonad.terminal conf),
|
((modm, xK_Return), spawn $ XMonad.terminal conf),
|
||||||
|
|
||||||
-- launch emacsclient
|
-- launch emacsclient
|
||||||
((modm, xK_a), spawn "emacsclient -c -a 'emacs'"),
|
((modm, xK_a), spawn mySpawnEditor),
|
||||||
|
|
||||||
-- launch browser
|
-- launch browser
|
||||||
((modm, xK_s), spawn myBrowser),
|
((modm, xK_s), spawn myBrowser),
|
||||||
|
|
Loading…
Reference in a new issue