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
|
|
|
|
2024-04-14 01:51:51 +05:30
|
|
|
outputs = inputs@{ self, ... }:
|
2024-03-08 18:59:53 +05:30
|
|
|
let
|
|
|
|
# ---- SYSTEM SETTINGS ---- #
|
|
|
|
systemSettings = {
|
|
|
|
system = "x86_64-linux"; # system arch
|
|
|
|
hostname = "snowfire"; # hostname
|
2024-03-10 04:06:51 +05:30
|
|
|
profile = "personal"; # select a profile defined from my profiles directory
|
2024-03-08 18:59:53 +05:30
|
|
|
timezone = "America/Chicago"; # select timezone
|
|
|
|
locale = "en_US.UTF-8"; # select locale
|
|
|
|
bootMode = "uefi"; # uefi or bios
|
2024-03-10 04:06:51 +05:30
|
|
|
bootMountPath = "/boot"; # mount path for efi boot partition; only used for uefi boot mode
|
|
|
|
grubDevice = ""; # device identifier for grub; only used for legacy (bios) boot mode
|
2024-03-08 18:59:53 +05:30
|
|
|
};
|
2023-05-08 04:17:40 +05:30
|
|
|
|
2024-03-08 18:59:53 +05:30
|
|
|
# ----- USER SETTINGS ----- #
|
|
|
|
userSettings = rec {
|
|
|
|
username = "emmet"; # username
|
|
|
|
name = "Emmet"; # name/identifier
|
2024-03-10 04:06:51 +05:30
|
|
|
email = "emmet@librephoenix.com"; # email (used for certain configurations)
|
2024-03-08 18:59:53 +05:30
|
|
|
dotfilesDir = "~/.dotfiles"; # absolute path of the local repo
|
2024-06-12 09:20:51 +05:30
|
|
|
theme = "io"; # selcted theme from my themes directory (./themes/)
|
2024-03-10 04:06:51 +05:30
|
|
|
wm = "hyprland"; # Selected window manager or desktop environment; must select one in both ./user/wm/ and ./system/wm/
|
2024-03-08 18:59:53 +05:30
|
|
|
# window manager type (hyprland or x11) translator
|
|
|
|
wmType = if (wm == "hyprland") then "wayland" else "x11";
|
2024-03-10 04:06:51 +05:30
|
|
|
browser = "qutebrowser"; # Default browser; must select one from ./user/app/browser/
|
|
|
|
defaultRoamDir = "Personal.p"; # Default org roam directory relative to ~/Org
|
2024-03-08 18:59:53 +05:30
|
|
|
term = "alacritty"; # Default terminal command;
|
|
|
|
font = "Intel One Mono"; # Selected font
|
|
|
|
fontPkg = pkgs.intel-one-mono; # Font package
|
|
|
|
editor = "emacsclient"; # Default editor;
|
|
|
|
# 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
|
2024-03-10 04:06:51 +05:30
|
|
|
"emacsclient -c -a 'emacs'"
|
|
|
|
else
|
|
|
|
(if ((editor == "vim") ||
|
|
|
|
(editor == "nvim") ||
|
|
|
|
(editor == "nano")) then
|
|
|
|
"exec " + term + " -e " + editor
|
|
|
|
else
|
|
|
|
editor);
|
2024-03-08 18:59:53 +05:30
|
|
|
};
|
2023-06-23 02:18:09 +05:30
|
|
|
|
2024-03-08 18:59:53 +05:30
|
|
|
# create patched nixpkgs
|
|
|
|
nixpkgs-patched =
|
2024-04-14 01:51:51 +05:30
|
|
|
(import inputs.nixpkgs { system = systemSettings.system; }).applyPatches {
|
2024-03-08 18:59:53 +05:30
|
|
|
name = "nixpkgs-patched";
|
2024-04-14 01:51:51 +05:30
|
|
|
src = inputs.nixpkgs;
|
2024-03-08 18:59:53 +05:30
|
|
|
patches = [ ./patches/emacs-no-version-check.patch ];
|
|
|
|
};
|
2023-09-09 08:16:32 +05:30
|
|
|
|
2024-03-08 18:59:53 +05:30
|
|
|
# configure pkgs
|
2024-04-05 00:39:46 +05:30
|
|
|
# use nixpkgs if running a server (homelab or worklab profile)
|
|
|
|
# otherwise use patched nixos-unstable nixpkgs
|
|
|
|
pkgs = (if ((systemSettings.profile == "homelab") || (systemSettings.profile == "worklab"))
|
|
|
|
then
|
|
|
|
pkgs-stable
|
|
|
|
else
|
|
|
|
(import nixpkgs-patched {
|
|
|
|
system = systemSettings.system;
|
|
|
|
config = {
|
|
|
|
allowUnfree = true;
|
|
|
|
allowUnfreePredicate = (_: true);
|
|
|
|
};
|
2024-04-14 01:51:51 +05:30
|
|
|
overlays = [ inputs.rust-overlay.overlays.default ];
|
2024-04-05 00:39:46 +05:30
|
|
|
}));
|
2023-05-08 04:17:40 +05:30
|
|
|
|
2024-04-14 01:51:51 +05:30
|
|
|
pkgs-stable = import inputs.nixpkgs-stable {
|
2024-03-08 18:59:53 +05:30
|
|
|
system = systemSettings.system;
|
|
|
|
config = {
|
|
|
|
allowUnfree = true;
|
|
|
|
allowUnfreePredicate = (_: true);
|
|
|
|
};
|
|
|
|
};
|
2024-01-27 20:09:32 +05:30
|
|
|
|
2024-04-14 01:51:51 +05:30
|
|
|
pkgs-emacs = import inputs.emacs-pin-nixpkgs {
|
2024-03-23 00:13:56 +05:30
|
|
|
system = systemSettings.system;
|
|
|
|
};
|
|
|
|
|
2024-04-14 01:51:51 +05:30
|
|
|
pkgs-kdenlive = import inputs.kdenlive-pin-nixpkgs {
|
2024-03-17 00:45:10 +05:30
|
|
|
system = systemSettings.system;
|
|
|
|
};
|
|
|
|
|
2024-03-08 18:59:53 +05:30
|
|
|
# configure lib
|
2024-04-05 00:39:46 +05:30
|
|
|
# use nixpkgs if running a server (homelab or worklab profile)
|
|
|
|
# otherwise use patched nixos-unstable nixpkgs
|
|
|
|
lib = (if ((systemSettings.profile == "homelab") || (systemSettings.profile == "worklab"))
|
|
|
|
then
|
2024-04-14 01:51:51 +05:30
|
|
|
inputs.nixpkgs-stable.lib
|
2024-04-05 00:39:46 +05:30
|
|
|
else
|
2024-04-14 01:51:51 +05:30
|
|
|
inputs.nixpkgs.lib);
|
2023-05-08 04:17:40 +05:30
|
|
|
|
2024-04-06 19:18:57 +05:30
|
|
|
# use home-manager-stable if running a server (homelab or worklab profile)
|
|
|
|
# otherwise use home-manager-unstable
|
|
|
|
home-manager = (if ((systemSettings.profile == "homelab") || (systemSettings.profile == "worklab"))
|
|
|
|
then
|
2024-04-14 01:51:51 +05:30
|
|
|
inputs.home-manager-stable
|
2024-04-06 19:18:57 +05:30
|
|
|
else
|
2024-04-14 01:51:51 +05:30
|
|
|
inputs.home-manager-unstable);
|
2024-04-06 19:18:57 +05:30
|
|
|
|
2024-03-08 18:59:53 +05:30
|
|
|
# Systems that can run tests:
|
|
|
|
supportedSystems = [ "aarch64-linux" "i686-linux" "x86_64-linux" ];
|
2024-02-25 23:31:59 +05:30
|
|
|
|
2024-03-08 18:59:53 +05:30
|
|
|
# Function to generate a set based on supported systems:
|
|
|
|
forAllSystems = inputs.nixpkgs.lib.genAttrs supportedSystems;
|
2024-02-25 23:31:59 +05:30
|
|
|
|
2024-03-08 18:59:53 +05:30
|
|
|
# Attribute set of nixpkgs for each system:
|
|
|
|
nixpkgsFor =
|
|
|
|
forAllSystems (system: import inputs.nixpkgs { inherit system; });
|
2024-02-25 23:31:59 +05:30
|
|
|
|
2024-03-08 18:59:53 +05:30
|
|
|
in {
|
|
|
|
homeConfigurations = {
|
|
|
|
user = home-manager.lib.homeManagerConfiguration {
|
2023-05-09 07:36:37 +05:30
|
|
|
inherit pkgs;
|
2024-03-08 18:59:53 +05:30
|
|
|
modules = [
|
2024-04-14 20:10:46 +05:30
|
|
|
(./. + "/profiles" + ("/" + systemSettings.profile) + "/home.nix") # load home.nix from selected PROFILE
|
2024-03-08 18:59:53 +05:30
|
|
|
];
|
2023-05-14 01:49:11 +05:30
|
|
|
extraSpecialArgs = {
|
2023-06-23 02:18:09 +05:30
|
|
|
# pass config variables from above
|
2024-01-27 20:09:32 +05:30
|
|
|
inherit pkgs-stable;
|
2024-03-23 00:13:56 +05:30
|
|
|
inherit pkgs-emacs;
|
2024-03-17 00:45:10 +05:30
|
|
|
inherit pkgs-kdenlive;
|
2024-01-19 03:06:52 +05:30
|
|
|
inherit systemSettings;
|
|
|
|
inherit userSettings;
|
2024-04-14 01:51:51 +05:30
|
|
|
inherit inputs;
|
2023-05-14 01:49:11 +05:30
|
|
|
};
|
2024-03-08 18:59:53 +05:30
|
|
|
};
|
2023-05-09 07:36:37 +05:30
|
|
|
};
|
2024-03-08 18:59:53 +05:30
|
|
|
nixosConfigurations = {
|
|
|
|
system = lib.nixosSystem {
|
|
|
|
system = systemSettings.system;
|
|
|
|
modules = [
|
2024-04-14 20:10:46 +05:30
|
|
|
(./. + "/profiles" + ("/" + systemSettings.profile) + "/configuration.nix")
|
|
|
|
./system/bin/phoenix.nix
|
2024-03-08 18:59:53 +05:30
|
|
|
]; # load configuration.nix from selected PROFILE
|
|
|
|
specialArgs = {
|
|
|
|
# pass config variables from above
|
|
|
|
inherit pkgs-stable;
|
|
|
|
inherit systemSettings;
|
|
|
|
inherit userSettings;
|
2024-04-14 01:51:51 +05:30
|
|
|
inherit inputs;
|
2024-03-08 18:59:53 +05:30
|
|
|
};
|
2023-05-23 07:09:15 +05:30
|
|
|
};
|
2023-05-08 04:17:40 +05:30
|
|
|
};
|
2024-02-25 23:31:59 +05:30
|
|
|
|
2024-03-08 18:59:53 +05:30
|
|
|
packages = forAllSystems (system:
|
|
|
|
let pkgs = nixpkgsFor.${system};
|
|
|
|
in {
|
|
|
|
default = self.packages.${system}.install;
|
2024-02-25 23:31:59 +05:30
|
|
|
|
2024-03-08 18:59:53 +05:30
|
|
|
install = pkgs.writeShellApplication {
|
|
|
|
name = "install";
|
2024-03-09 22:58:18 +05:30
|
|
|
runtimeInputs = with pkgs; [ git ]; # I could make this fancier by adding other deps
|
2024-03-08 18:59:53 +05:30
|
|
|
text = ''${./install.sh} "$@"'';
|
|
|
|
};
|
|
|
|
});
|
2024-02-25 23:44:05 +05:30
|
|
|
|
2024-03-09 06:13:56 +05:30
|
|
|
apps = forAllSystems (system: {
|
|
|
|
default = self.apps.${system}.install;
|
2024-02-25 23:44:05 +05:30
|
|
|
|
2024-03-09 06:13:56 +05:30
|
|
|
install = {
|
|
|
|
type = "app";
|
|
|
|
program = "${self.packages.${system}.install}/bin/install";
|
|
|
|
};
|
|
|
|
});
|
2024-03-08 18:59:53 +05:30
|
|
|
};
|
2023-06-21 09:02:28 +05:30
|
|
|
|
|
|
|
inputs = {
|
|
|
|
nixpkgs.url = "nixpkgs/nixos-unstable";
|
2024-01-27 20:09:32 +05:30
|
|
|
nixpkgs-stable.url = "nixpkgs/nixos-23.11";
|
2024-04-03 10:39:55 +05:30
|
|
|
emacs-pin-nixpkgs.url = "nixpkgs/f72123158996b8d4449de481897d855bc47c7bf6";
|
2024-03-17 00:45:10 +05:30
|
|
|
kdenlive-pin-nixpkgs.url = "nixpkgs/cfec6d9203a461d9d698d8a60ef003cac6d0da94";
|
2024-01-19 03:06:52 +05:30
|
|
|
|
2024-04-06 19:18:57 +05:30
|
|
|
home-manager-unstable.url = "github:nix-community/home-manager/master";
|
|
|
|
home-manager-unstable.inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
|
|
|
|
home-manager-stable.url = "github:nix-community/home-manager/release-23.11";
|
|
|
|
home-manager-stable.inputs.nixpkgs.follows = "nixpkgs-stable";
|
2024-01-19 03:06:52 +05:30
|
|
|
|
2024-06-07 16:45:38 +05:30
|
|
|
hyprland.url = "github:hyprwm/Hyprland/0b215c5f246d3fde6c023e78b3e3579f7498c172?submodules=1";
|
2024-06-01 07:38:10 +05:30
|
|
|
hyprland.inputs.nixpkgs.follows = "nixpkgs";
|
2024-05-11 07:23:22 +05:30
|
|
|
hyprland-plugins.url = "github:hyprwm/hyprland-plugins";
|
|
|
|
hyprland-plugins.inputs.hyprland.follows = "hyprland";
|
|
|
|
hycov.url = "github:DreamMaoMao/hycov/115cba558d439cc25d62ce38b7c62cde83f50ef5";
|
|
|
|
hycov.inputs.hyprland.follows = "hyprland";
|
2024-06-02 08:30:00 +05:30
|
|
|
hyprgrass.url = "github:horriblename/hyprgrass/6d8dbbcfb14ebdb2a2a2551b7d495d01d8ef6917";
|
|
|
|
hyprgrass.inputs.hyprland.follows = "hyprland";
|
2024-05-11 07:23:22 +05:30
|
|
|
|
2024-02-04 21:06:13 +05:30
|
|
|
nix-doom-emacs.url = "github:nix-community/nix-doom-emacs";
|
2024-04-03 10:39:55 +05:30
|
|
|
nix-doom-emacs.inputs.nixpkgs.follows = "emacs-pin-nixpkgs";
|
2024-02-04 21:06:13 +05:30
|
|
|
|
|
|
|
nix-straight.url = "github:librephoenix/nix-straight.el/pgtk-patch";
|
|
|
|
nix-straight.flake = false;
|
|
|
|
nix-doom-emacs.inputs.nix-straight.follows = "nix-straight";
|
|
|
|
|
2023-06-21 09:02:28 +05:30
|
|
|
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;
|
|
|
|
};
|
2023-10-13 07:19:37 +05:30
|
|
|
org-timeblock = {
|
|
|
|
url = "github:ichernyshovvv/org-timeblock";
|
|
|
|
flake = false;
|
|
|
|
};
|
2024-04-03 09:44:02 +05:30
|
|
|
org-krita = {
|
2024-04-14 01:31:51 +05:30
|
|
|
url = "github:librephoenix/org-krita";
|
2024-04-03 09:44:02 +05:30
|
|
|
flake = false;
|
|
|
|
};
|
2024-04-14 05:37:10 +05:30
|
|
|
org-xournalpp = {
|
|
|
|
url = "gitlab:vherrmann/org-xournalpp";
|
|
|
|
flake = false;
|
|
|
|
};
|
2024-04-14 01:31:22 +05:30
|
|
|
org-sliced-images = {
|
|
|
|
url = "github:jcfk/org-sliced-images";
|
|
|
|
flake = false;
|
|
|
|
};
|
2023-08-27 02:28:45 +05:30
|
|
|
phscroll = {
|
|
|
|
url = "github:misohena/phscroll";
|
|
|
|
flake = false;
|
|
|
|
};
|
2024-04-02 07:38:41 +05:30
|
|
|
mini-frame = {
|
|
|
|
url = "github:muffinmad/emacs-mini-frame";
|
|
|
|
flake = false;
|
|
|
|
};
|
2024-01-19 03:06:52 +05:30
|
|
|
|
|
|
|
stylix.url = "github:danth/stylix";
|
|
|
|
|
|
|
|
rust-overlay.url = "github:oxalica/rust-overlay";
|
|
|
|
|
2023-06-21 09:02:28 +05:30
|
|
|
blocklist-hosts = {
|
|
|
|
url = "github:StevenBlack/hosts";
|
|
|
|
flake = false;
|
|
|
|
};
|
|
|
|
};
|
2023-05-08 04:17:40 +05:30
|
|
|
}
|