mirror of
https://github.com/librephoenix/nixos-config
synced 2025-04-21 01:34:34 +05:30
Generic improvements to flake
This commit is contained in:
parent
4d32d11d1d
commit
c4619cbe4f
15
flake.nix
15
flake.nix
|
@ -28,12 +28,15 @@
|
||||||
|
|
||||||
outputs = { self, nixpkgs, home-manager, nix-doom-emacs, stylix, eaf, eaf-browser, org-nursery, blocklist-hosts, rust-overlay, ... }@inputs:
|
outputs = { self, nixpkgs, home-manager, nix-doom-emacs, stylix, eaf, eaf-browser, org-nursery, blocklist-hosts, rust-overlay, ... }@inputs:
|
||||||
let
|
let
|
||||||
system = "x86_64-linux";
|
system = "x86_64-linux"; # system arch
|
||||||
name = "emmet";
|
hostname = "snowfire"; # hostname
|
||||||
email = "librephoenix3@pm.me";
|
profile = "personal"; # select a profile defined from my profiles directory
|
||||||
dotfilesDir = "~/.dotfiles";
|
name = "emmet"; # username
|
||||||
theme = "ayu-dark";
|
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";
|
themePolarityPath = "/themes/"+theme+"/polarity.txt";
|
||||||
themePolarity = lib.removeSuffix "\n" (builtins.readFile (./. + themePolarityPath));
|
themePolarity = lib.removeSuffix "\n" (builtins.readFile (./. + themePolarityPath));
|
||||||
backgroundUrlPath = "/themes/"+theme+"/backgroundurl.txt";
|
backgroundUrlPath = "/themes/"+theme+"/backgroundurl.txt";
|
||||||
|
@ -78,11 +81,11 @@
|
||||||
inherit system;
|
inherit system;
|
||||||
modules = [
|
modules = [
|
||||||
./system/configuration.nix
|
./system/configuration.nix
|
||||||
./system/style/stylix.nix
|
|
||||||
stylix.nixosModules.stylix
|
stylix.nixosModules.stylix
|
||||||
];
|
];
|
||||||
specialArgs = {
|
specialArgs = {
|
||||||
myTheme = theme;
|
myTheme = theme;
|
||||||
|
myHostname = hostname;
|
||||||
myThemePolarity = themePolarity;
|
myThemePolarity = themePolarity;
|
||||||
myBackgroundUrl = backgroundUrl;
|
myBackgroundUrl = backgroundUrl;
|
||||||
myBackgroundSha256 = backgroundSha256;
|
myBackgroundSha256 = backgroundSha256;
|
||||||
|
|
|
@ -2,13 +2,13 @@
|
||||||
# your system. Help is available in the configuration.nix(5) man page
|
# your system. Help is available in the configuration.nix(5) man page
|
||||||
# and in the NixOS manual (accessible by running ‘nixos-help’).
|
# 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";
|
let blocklist = builtins.readFile "${blocklist-hosts}/alternates/gambling-porn/hosts";
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
imports =
|
imports =
|
||||||
[ ./hardware-configuration.nix
|
[ ./hardware-configuration.nix
|
||||||
#./style/stylix.nix
|
./style/stylix.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
nix.nixPath = [ "nixpkgs=/nix/var/nix/profiles/per-user/root/channels/nixos"
|
nix.nixPath = [ "nixpkgs=/nix/var/nix/profiles/per-user/root/channels/nixos"
|
||||||
|
@ -54,7 +54,7 @@ in
|
||||||
"/crypto_keyfile.bin" = null;
|
"/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.wireless.enable = true; # Enables wireless support via wpa_supplicant.
|
||||||
|
|
||||||
networking.extraHosts = ''
|
networking.extraHosts = ''
|
||||||
|
|
|
@ -13,19 +13,22 @@ let
|
||||||
pushd ''+myDotfilesDir+'';
|
pushd ''+myDotfilesDir+'';
|
||||||
home-manager switch --flake .#''+myName+'';
|
home-manager switch --flake .#''+myName+'';
|
||||||
popd;
|
popd;
|
||||||
killall xmobar;
|
which xmobar &> /dev/null && killall xmobar;
|
||||||
xmonad --recompile && xmonad --restart;
|
which xmonad &> /dev/null && xmonad --recompile && xmonad --restart;
|
||||||
emacsclient --no-wait --eval "(load-theme 'doom-stylix t nil)";
|
which emacsclient &> /dev/null && emacsclient --no-wait --eval "(load-theme 'doom-stylix t nil)";
|
||||||
pushd ~/.emacs.d/eaf/app/browser;
|
[ -f ~/.fehbg-stylix ] &> /dev/null && ~/.fehbg-stylix;
|
||||||
rm package*.json;
|
|
||||||
npm install darkreader @mozilla/readability && rm package*.json;
|
|
||||||
popd;
|
|
||||||
~/.fehbg-stylix;
|
|
||||||
fi
|
fi
|
||||||
elif [ "$1" = "update" ]; then
|
elif [ "$1" = "update" ]; then
|
||||||
pushd ''+myDotfilesDir+'';
|
pushd ''+myDotfilesDir+'';
|
||||||
nix flake update;
|
nix flake update;
|
||||||
popd;
|
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
|
elif [ "$1" = "gc" ]; then
|
||||||
if [ "$2" = "full" ]; then
|
if [ "$2" = "full" ]; then
|
||||||
sudo nix-collect-garbage --delete-old;
|
sudo nix-collect-garbage --delete-old;
|
||||||
|
|
Loading…
Reference in a new issue