2023-05-08 04:17:40 +05:30
{
2023-06-11 20:56:47 +05:30
description = " F l a k e o f L i b r e P h o e n i x " ;
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 = " x 8 6 _ 6 4 - l i n u x " ; # system arch
hostname = " s n o w f i r e " ; # hostname
2024-03-10 04:06:51 +05:30
profile = " p e r s o n a l " ; # select a profile defined from my profiles directory
2024-03-08 18:59:53 +05:30
timezone = " A m e r i c a / C h i c a g o " ; # select timezone
locale = " e n _ U S . U T F - 8 " ; # select locale
bootMode = " u e f i " ; # uefi or bios
2024-03-10 04:06:51 +05:30
bootMountPath = " / b o o t " ; # 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-07-08 20:31:54 +05:30
gpuType = " a m d " ; # amd, intel or nvidia; only makes some slight mods for amd at the moment
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 = " e m m e t " ; # username
name = " E m m e t " ; # name/identifier
2024-03-10 04:06:51 +05:30
email = " e m m e t @ l i b r e p h o e n i x . c o m " ; # email (used for certain configurations)
2024-03-08 18:59:53 +05:30
dotfilesDir = " ~ / . d o t f i l e s " ; # absolute path of the local repo
2024-06-12 09:20:51 +05:30
theme = " i o " ; # selcted theme from my themes directory (./themes/)
2024-03-10 04:06:51 +05:30
wm = " h y p r l a n d " ; # 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 == " h y p r l a n d " ) then " w a y l a n d " else " x 1 1 " ;
2024-03-10 04:06:51 +05:30
browser = " q u t e b r o w s e r " ; # Default browser; must select one from ./user/app/browser/
2024-08-14 02:15:45 +05:30
spawnBrowser = if ( ( browser == " q u t e b r o w s e r " ) && ( wm == " h y p r l a n d " ) ) then " q u t e b r o w s e r - h y p r p r o f i l e " else ( if ( browser == " q u t e b r o w s e r " ) then " q u t e b r o w s e r - - q t - f l a g e n a b l e - g p u - r a s t e r i z a t i o n - - q t - f l a g e n a b l e - n a t i v e - g p u - m e m o r y - b u f f e r s - - q t - f l a g n u m - r a s t e r - t h r e a d s = 4 " else browser ) ; # Browser spawn command must be specail for qb, since it doesn't gpu accelerate by default (why?)
2024-03-10 04:06:51 +05:30
defaultRoamDir = " P e r s o n a l . p " ; # Default org roam directory relative to ~/Org
2024-03-08 18:59:53 +05:30
term = " a l a c r i t t y " ; # Default terminal command;
font = " I n t e l O n e M o n o " ; # Selected font
fontPkg = pkgs . intel-one-mono ; # Font package
editor = " e m a c s c l i e n t " ; # 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 == " e m a c s c l i e n t " ) then
2024-03-10 04:06:51 +05:30
" e m a c s c l i e n t - c - a ' e m a c s ' "
else
( if ( ( editor == " v i m " ) ||
( editor == " n v i m " ) ||
( editor == " n a n o " ) ) then
" e x e c " + 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-07-08 20:31:54 +05:30
( import inputs . nixpkgs { system = systemSettings . system ; rocmSupport = ( if systemSettings . gpu == " a m d " then true else false ) ; } ) . applyPatches {
2024-03-08 18:59:53 +05:30
name = " n i x p k g s - p a t c h e d " ;
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 == " h o m e l a b " ) || ( systemSettings . profile == " w o r k l a b " ) )
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-07-16 19:06:19 +05:30
pkgs-unstable = import inputs . nixpkgs-patched {
system = systemSettings . system ;
config = {
allowUnfree = true ;
allowUnfreePredicate = ( _ : true ) ;
} ;
overlays = [ inputs . rust-overlay . overlays . default ] ;
} ;
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-06-13 06:18:23 +05:30
pkgs-nwg-dock-hyprland = import inputs . nwg-dock-hyprland-pin-nixpkgs {
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 == " h o m e l a b " ) || ( systemSettings . profile == " w o r k l a b " ) )
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 == " h o m e l a b " ) || ( systemSettings . profile == " w o r k l a b " ) )
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 = [ " a a r c h 6 4 - l i n u x " " i 6 8 6 - l i n u x " " x 8 6 _ 6 4 - l i n u x " ] ;
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
( ./. + " / p r o f i l e s " + ( " / " + systemSettings . profile ) + " / h o m e . n i x " ) # 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-06-13 06:18:23 +05:30
inherit pkgs-nwg-dock-hyprland ;
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
( ./. + " / p r o f i l e s " + ( " / " + systemSettings . profile ) + " / c o n f i g u r a t i o n . n i x " )
2024-08-10 04:16:48 +05:30
inputs . lix-module . nixosModules . default
2024-04-14 20:10:46 +05:30
./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-06-24 06:56:21 +05:30
nixOnDroidConfigurations = {
2024-06-24 20:08:05 +05:30
inherit pkgs ;
default = inputs . nix-on-droid . lib . nixOnDroidConfiguration {
modules = [ ./profiles/nix-on-droid/configuration.nix ] ;
} ;
extraSpecialArgs = {
# pass config variables from above
inherit pkgs-stable ;
inherit pkgs-emacs ;
inherit systemSettings ;
inherit userSettings ;
inherit inputs ;
2024-06-24 06:56:21 +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 = " i n s t a l l " ;
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 = " a p p " ;
program = " ${ self . packages . ${ system } . install } / b i n / i n s t a l l " ;
} ;
} ) ;
2024-03-08 18:59:53 +05:30
} ;
2023-06-21 09:02:28 +05:30
inputs = {
2024-08-10 04:16:48 +05:30
lix-module = {
url = " h t t p s : / / g i t . l i x . s y s t e m s / l i x - p r o j e c t / n i x o s - m o d u l e / a r c h i v e / 2 . 9 0 . 0 . t a r . g z " ;
inputs . nixpkgs . follows = " n i x p k g s " ;
} ;
2023-06-21 09:02:28 +05:30
nixpkgs . url = " n i x p k g s / n i x o s - u n s t a b l e " ;
2024-07-16 19:06:19 +05:30
nixpkgs-stable . url = " n i x p k g s / n i x o s - 2 4 . 0 5 " ;
2024-04-03 10:39:55 +05:30
emacs-pin-nixpkgs . url = " n i x p k g s / f 7 2 1 2 3 1 5 8 9 9 6 b 8 d 4 4 4 9 d e 4 8 1 8 9 7 d 8 5 5 b c 4 7 c 7 b f 6 " ;
2024-03-17 00:45:10 +05:30
kdenlive-pin-nixpkgs . url = " n i x p k g s / c f e c 6 d 9 2 0 3 a 4 6 1 d 9 d 6 9 8 d 8 a 6 0 e f 0 0 3 c a c 6 d 0 d a 9 4 " ;
2024-06-13 06:18:23 +05:30
nwg-dock-hyprland-pin-nixpkgs . url = " n i x p k g s / 2 0 9 8 d 8 4 5 d 7 6 f 8 a 2 1 a e 4 f e 1 2 e d 7 c 7 d f 4 9 0 9 8 d 3 f 1 5 " ;
2024-01-19 03:06:52 +05:30
2024-04-06 19:18:57 +05:30
home-manager-unstable . url = " g i t h u b : n i x - c o m m u n i t y / h o m e - m a n a g e r / m a s t e r " ;
home-manager-unstable . inputs . nixpkgs . follows = " n i x p k g s " ;
2024-07-16 19:08:11 +05:30
home-manager-stable . url = " g i t h u b : n i x - c o m m u n i t y / h o m e - m a n a g e r / r e l e a s e - 2 4 . 0 5 " ;
2024-04-06 19:18:57 +05:30
home-manager-stable . inputs . nixpkgs . follows = " n i x p k g s - s t a b l e " ;
2024-01-19 03:06:52 +05:30
2024-06-24 06:56:21 +05:30
nix-on-droid = {
url = " g i t h u b : n i x - c o m m u n i t y / n i x - o n - d r o i d / m a s t e r " ;
inputs . nixpkgs . follows = " n i x p k g s " ;
inputs . home-manager . follows = " h o m e - m a n a g e r - u n s t a b l e " ;
} ;
2024-06-12 09:22:22 +05:30
hyprland = {
type = " g i t " ;
2024-08-12 19:42:02 +05:30
url = " h t t p s : / / c o d e . h y p r l a n d . o r g / h y p r w m / H y p r l a n d . g i t " ;
2024-06-12 09:22:22 +05:30
submodules = true ;
2024-08-13 06:15:04 +05:30
rev = " c 7 b 7 2 7 9 0 b d 6 3 1 7 2 f 0 4 e e 8 6 7 8 4 d 4 c b 2 a 4 0 0 5 3 2 9 2 7 " ; #v0.42.0
2024-08-12 19:42:02 +05:30
inputs . nixpkgs . follows = " n i x p k g s " ;
} ;
hyprland-plugins = {
type = " g i t " ;
url = " h t t p s : / / c o d e . h y p r l a n d . o r g / h y p r w m / h y p r l a n d - p l u g i n s . g i t " ;
rev = " b 7 3 d 7 b 9 0 1 d 8 c b 1 1 7 2 d d 2 5 c 7 b 7 1 5 9 f 0 2 4 2 c 6 2 5 a 7 7 " ; #v0.42.0
inputs . hyprland . follows = " h y p r l a n d " ;
} ;
hyprlock = {
type = " g i t " ;
url = " h t t p s : / / c o d e . h y p r l a n d . o r g / h y p r w m / h y p r l o c k . g i t " ;
2024-08-12 21:24:06 +05:30
rev = " 5 8 e 1 a 4 a 4 9 9 7 7 2 8 b e 8 8 6 a 4 6 d 0 3 1 5 1 4 b 3 f 0 9 7 6 3 c 5 d " ;
2024-08-12 19:42:02 +05:30
inputs . nixpkgs . follows = " n i x p k g s " ;
2024-06-12 09:22:22 +05:30
} ;
2024-08-12 19:42:02 +05:30
hyprgrass . url = " g i t h u b : h o r r i b l e n a m e / h y p r g r a s s / 0 b b 3 b 8 2 2 0 5 3 c 8 1 3 a b 6 f 6 9 5 c 9 1 9 4 0 8 9 c c b 5 1 8 6 c c 3 " ;
2024-06-26 07:00:45 +05:30
hyprgrass . inputs . hyprland . follows = " h y p r l a n d " ;
2024-05-11 07:23:22 +05:30
2024-08-14 06:18:37 +05:30
# FIXME emacsng doesn't build or dumps core
#emacsng.url = "github:emacs-ng/emacs-ng/58fcf8c";
#emacsng.inputs.nixpkgs.follows = "nixpkgs";
2024-08-14 03:24:45 +05:30
2024-02-04 21:06:13 +05:30
nix-doom-emacs . url = " g i t h u b : n i x - c o m m u n i t y / n i x - d o o m - e m a c s " ;
2024-04-03 10:39:55 +05:30
nix-doom-emacs . inputs . nixpkgs . follows = " e m a c s - p i n - n i x p k g s " ;
2024-02-04 21:06:13 +05:30
nix-straight . url = " g i t h u b : l i b r e p h o e n i x / n i x - s t r a i g h t . e l / p g t k - p a t c h " ;
nix-straight . flake = false ;
nix-doom-emacs . inputs . nix-straight . follows = " n i x - s t r a i g h t " ;
2023-06-21 09:02:28 +05:30
eaf = {
url = " g i t h u b : e m a c s - e a f / e m a c s - a p p l i c a t i o n - f r a m e w o r k " ;
flake = false ;
} ;
eaf-browser = {
url = " g i t h u b : e m a c s - e a f / e a f - b r o w s e r " ;
flake = false ;
} ;
org-nursery = {
url = " g i t h u b : c h r i s b a r r e t t / n u r s e r y " ;
flake = false ;
} ;
2023-09-23 22:24:31 +05:30
org-yaap = {
url = " g i t l a b : t y g r d e v / o r g - y a a p " ;
flake = false ;
} ;
2023-10-06 01:27:44 +05:30
org-side-tree = {
url = " g i t h u b : l o c a l a u t h o r / o r g - s i d e - t r e e " ;
flake = false ;
} ;
2023-10-13 07:19:37 +05:30
org-timeblock = {
url = " g i t h u b : i c h e r n y s h o v v v / o r g - t i m e b l o c k " ;
flake = false ;
} ;
2024-04-03 09:44:02 +05:30
org-krita = {
2024-04-14 01:31:51 +05:30
url = " g i t h u b : l i b r e p h o e n i x / o r g - k r i t a " ;
2024-04-03 09:44:02 +05:30
flake = false ;
} ;
2024-04-14 05:37:10 +05:30
org-xournalpp = {
url = " g i t l a b : v h e r r m a n n / o r g - x o u r n a l p p " ;
flake = false ;
} ;
2024-04-14 01:31:22 +05:30
org-sliced-images = {
url = " g i t h u b : j c f k / o r g - s l i c e d - i m a g e s " ;
flake = false ;
} ;
2024-06-26 01:25:20 +05:30
magit-file-icons = {
2024-06-28 23:03:40 +05:30
url = " g i t h u b : l i b r e p h o e n i x / m a g i t - f i l e - i c o n s / a b s t r a c t - i c o n - g e t t e r s - c o m p a t " ;
2024-06-26 01:25:20 +05:30
flake = false ;
} ;
2023-08-27 02:28:45 +05:30
phscroll = {
url = " g i t h u b : m i s o h e n a / p h s c r o l l " ;
flake = false ;
} ;
2024-04-02 07:38:41 +05:30
mini-frame = {
url = " g i t h u b : m u f f i n m a d / e m a c s - m i n i - f r a m e " ;
flake = false ;
} ;
2024-01-19 03:06:52 +05:30
stylix . url = " g i t h u b : d a n t h / s t y l i x " ;
rust-overlay . url = " g i t h u b : o x a l i c a / r u s t - o v e r l a y " ;
2023-06-21 09:02:28 +05:30
blocklist-hosts = {
url = " g i t h u b : S t e v e n B l a c k / h o s t s " ;
flake = false ;
} ;
} ;
2023-05-08 04:17:40 +05:30
}