Generic improvements to flake

This commit is contained in:
Emmet 2023-06-20 17:31:49 -05:00
parent 4d32d11d1d
commit c4619cbe4f
3 changed files with 23 additions and 17 deletions

View file

@ -28,12 +28,15 @@
outputs = { self, nixpkgs, home-manager, nix-doom-emacs, stylix, eaf, eaf-browser, org-nursery, blocklist-hosts, rust-overlay, ... }@inputs:
let
system = "x86_64-linux";
name = "emmet";
email = "librephoenix3@pm.me";
dotfilesDir = "~/.dotfiles";
theme = "ayu-dark";
system = "x86_64-linux"; # system arch
hostname = "snowfire"; # hostname
profile = "personal"; # select a profile defined from my profiles directory
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
themePolarityPath = "/themes/"+theme+"/polarity.txt";
themePolarity = lib.removeSuffix "\n" (builtins.readFile (./. + themePolarityPath));
backgroundUrlPath = "/themes/"+theme+"/backgroundurl.txt";
@ -78,11 +81,11 @@
inherit system;
modules = [
./system/configuration.nix
./system/style/stylix.nix
stylix.nixosModules.stylix
];
specialArgs = {
myTheme = theme;
myHostname = hostname;
myThemePolarity = themePolarity;
myBackgroundUrl = backgroundUrl;
myBackgroundSha256 = backgroundSha256;

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, myTheme, myBackgroundUrl, myBackgroundSha256, ... }:
{ config, lib, pkgs, blocklist-hosts, myHostname, myTheme, myBackgroundUrl, myBackgroundSha256, ... }:
let blocklist = builtins.readFile "${blocklist-hosts}/alternates/gambling-porn/hosts";
in
{
imports =
[ ./hardware-configuration.nix
#./style/stylix.nix
./style/stylix.nix
];
nix.nixPath = [ "nixpkgs=/nix/var/nix/profiles/per-user/root/channels/nixos"
@ -54,7 +54,7 @@ in
"/crypto_keyfile.bin" = null;
};
networking.hostName = "snowfire"; # Define your hostname.
networking.hostName = myHostname; # Define your hostname.
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
networking.extraHosts = ''

View file

@ -13,19 +13,22 @@ let
pushd ''+myDotfilesDir+'';
home-manager switch --flake .#''+myName+'';
popd;
killall xmobar;
xmonad --recompile && xmonad --restart;
emacsclient --no-wait --eval "(load-theme 'doom-stylix t nil)";
pushd ~/.emacs.d/eaf/app/browser;
rm package*.json;
npm install darkreader @mozilla/readability && rm package*.json;
popd;
~/.fehbg-stylix;
which xmobar &> /dev/null && killall xmobar;
which xmonad &> /dev/null && xmonad --recompile && xmonad --restart;
which emacsclient &> /dev/null && emacsclient --no-wait --eval "(load-theme 'doom-stylix t nil)";
[ -f ~/.fehbg-stylix ] &> /dev/null && ~/.fehbg-stylix;
fi
elif [ "$1" = "update" ]; then
pushd ''+myDotfilesDir+'';
nix flake update;
popd;
if [ -d ~/.emacs.d/eaf/app/browser ]
then
pushd ~/.emacs.d/eaf/app/browser;
rm package*.json;
npm install darkreader @mozilla/readability && rm package*.json;
popd;
fi
elif [ "$1" = "gc" ]; then
if [ "$2" = "full" ]; then
sudo nix-collect-garbage --delete-old;