nixos-config/flake.nix

163 lines
5.6 KiB
Nix
Raw Normal View History

2023-05-08 04:17:40 +05:30
{
2023-06-11 20:56:47 +05:30
description = "Flake of LibrePhoenix";
2023-05-08 04:17:40 +05:30
outputs = { self, nixpkgs, home-manager, nix-doom-emacs, stylix, eaf, eaf-browser, org-nursery, org-yaap, org-timeblock, phscroll, blocklist-hosts, rust-overlay, hyprland-plugins, ... }@inputs:
2023-05-08 04:17:40 +05:30
let
2023-06-21 20:44:07 +05:30
# ---- SYSTEM SETTINGS ---- #
2023-06-21 04:01:49 +05:30
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
2023-06-21 20:44:07 +05:30
# ----- USER SETTINGS ----- #
username = "emmet"; # username
name = "Emmet"; # name/identifier
2023-11-21 04:48:25 +05:30
email = "emmet@librephoenix.com"; # email (used for certain configurations)
dotfilesDir = "~/.dotfiles"; # absolute path of the local repo
2024-01-14 07:31:44 +05:30
theme = "uwunicorn-yt"; # selcted theme from my themes directory (./themes/)
2023-08-13 00:17:14 +05:30
wm = "hyprland"; # Selected window manager or desktop environment; must select one in both ./user/wm/ and ./system/wm/
wmType = "wayland"; # x11 or wayland
2023-09-28 06:47:55 +05:30
browser = "qutebrowser"; # Default browser; must select one from ./user/app/browser/
editor = "emacsclient"; # Default editor;
defaultRoamDir = "Personal.p"; # Default org roam directory relative to ~/Org
2023-08-13 22:45:04 +05:30
term = "alacritty"; # Default terminal command;
font = "Intel One Mono"; # Selected font
fontPkg = pkgs.intel-one-mono; # Font package
2023-05-08 04:17:40 +05:30
# 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") || (editor == "nvim") || (editor == "nano")) then "exec " + term + " -e " + editor else editor);
2023-09-09 16:48:41 +05:30
# create patched nixpkgs
nixpkgs-patched = (import nixpkgs { inherit system; }).applyPatches {
name = "nixpkgs-patched";
src = nixpkgs;
patches = [
./patches/emacs-no-version-check.patch
./patches/nixos-nixpkgs-268027.patch
];
};
# configure pkgs
pkgs = import nixpkgs-patched {
2023-05-08 04:17:40 +05:30
inherit system;
2023-12-02 22:16:03 +05:30
config = { allowUnfree = true;
allowUnfreePredicate = (_: true); };
2023-05-21 06:28:54 +05:30
overlays = [ rust-overlay.overlays.default ];
2023-05-08 04:17:40 +05:30
};
# configure lib
2023-05-08 04:17:40 +05:30
lib = nixpkgs.lib;
in {
homeConfigurations = {
user = home-manager.lib.homeManagerConfiguration {
inherit pkgs;
modules = [ (./. + "/profiles"+("/"+profile)+"/home.nix") # load home.nix from selected PROFILE
# inputs.nix-flatpak.homeManagerModules.nix-flatpak # Declarative flatpaks
];
extraSpecialArgs = {
# pass config variables from above
inherit username;
inherit name;
inherit hostname;
inherit profile;
inherit email;
inherit dotfilesDir;
inherit defaultRoamDir;
inherit theme;
inherit font;
inherit fontPkg;
inherit wm;
inherit wmType;
inherit browser;
inherit editor;
inherit term;
inherit spawnEditor;
inherit (inputs) nix-doom-emacs;
#inherit (inputs) nix-flatpak;
inherit (inputs) stylix;
2023-05-20 06:55:57 +05:30
inherit (inputs) eaf;
inherit (inputs) eaf-browser;
inherit (inputs) org-nursery;
2023-09-23 22:24:31 +05:30
inherit (inputs) org-yaap;
2023-10-06 01:27:44 +05:30
inherit (inputs) org-side-tree;
inherit (inputs) org-timeblock;
inherit (inputs) phscroll;
2023-09-04 00:20:27 +05:30
inherit (inputs) hyprland-plugins;
};
};
};
2023-05-08 04:17:40 +05:30
nixosConfigurations = {
system = lib.nixosSystem {
2023-05-08 04:17:40 +05:30
inherit system;
modules = [ (./. + "/profiles"+("/"+profile)+"/configuration.nix") ]; # load configuration.nix from selected PROFILE
specialArgs = {
# pass config variables from above
inherit username;
inherit name;
inherit hostname;
inherit timezone;
inherit locale;
inherit theme;
inherit font;
inherit fontPkg;
inherit wm;
inherit (inputs) stylix;
2023-06-18 09:18:58 +05:30
inherit (inputs) blocklist-hosts;
};
2023-05-08 04:17:40 +05:30
};
};
};
inputs = {
nixpkgs.url = "nixpkgs/nixos-unstable";
home-manager.url = "github:nix-community/home-manager/master";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
nix-doom-emacs.url = "github:librephoenix/nix-doom-emacs?ref=pgtk-patch";
stylix.url = "github:danth/stylix";
rust-overlay.url = "github:oxalica/rust-overlay";
#nix-flatpak.url = "github:gmodena/nix-flatpak/?ref=v0.2.0";
eaf = {
url = "github:emacs-eaf/emacs-application-framework";
flake = false;
};
eaf-browser = {
url = "github:emacs-eaf/eaf-browser";
flake = false;
};
org-nursery = {
url = "github:chrisbarrett/nursery";
flake = false;
};
2023-09-23 22:24:31 +05:30
org-yaap = {
url = "gitlab:tygrdev/org-yaap";
flake = false;
};
2023-10-06 01:27:44 +05:30
org-side-tree = {
url = "github:localauthor/org-side-tree";
flake = false;
};
org-timeblock = {
url = "github:ichernyshovvv/org-timeblock";
flake = false;
};
phscroll = {
url = "github:misohena/phscroll";
flake = false;
};
blocklist-hosts = {
url = "github:StevenBlack/hosts";
flake = false;
};
2023-09-04 00:20:27 +05:30
hyprland-plugins = {
url = "github:hyprwm/hyprland-plugins";
flake = false;
};
};
2023-05-08 04:17:40 +05:30
}