chore: cleanup all files

This commit is contained in:
DashieTM 2025-05-11 13:57:38 +02:00
parent f4e47cbf97
commit 9cc9955425
43 changed files with 2893 additions and 2834 deletions

View file

@ -1,4 +1,3 @@
<div align = center> <div align = center>
![Logo of DashNix](logo.svg) ![Logo of DashNix](logo.svg)
@ -7,7 +6,6 @@
An opinionated flake to bootstrap NixOS systems with default configurations for various programs and services from both NixOS and HomeManager which can be enabled, disabled, configured or replaced at will. An opinionated flake to bootstrap NixOS systems with default configurations for various programs and services from both NixOS and HomeManager which can be enabled, disabled, configured or replaced at will.
# Usage # Usage
This flake is intended to be used as an input to your own NixOS configuration: This flake is intended to be used as an input to your own NixOS configuration:
@ -57,26 +55,52 @@ Here is a minimal required configuration.nix (the TODOs mention a required chang
```nix ```nix
{config, ...}: { {config, ...}: {
# TODO denote important changes
# variables for system # variables for system
# TODO important changes
conf = { conf = {
# change this to your monitor and your pc name # TODO your username
username = "YOURNAME";
# TODO only needed when you use intel -> amd is default
# cpu = "intel";
# TODO your xkb layout
locale = "something.UTF-8";
# TODO your timezone
timezone = "CONTINENT/CITY";
};
# modules
mods = {
# default disk config has root home boot and swap partition, overwrite if you want something different
sops.enable = false;
nextcloud.enable = false;
hypr.hyprland = {
# TODO monitor configuration for hyprland (hyprland is default)
# should be something like DP-1 # should be something like DP-1
defaultMonitor = "YOURMONITOR"; defaultMonitor = "YOURMONITOR";
# width x height @ refreshrate # width x height @ refreshrate
defaultMonitorMode = "1920x1080@60"; defaultMonitorMode = "1920x1080@60";
# scale for your main monitor # scale for your main monitor
defaultMonitorScale = "1"; defaultMonitorScale = "1";
# your username # additional configruation can be done as well
username = "YOURNAME"; # customConfig = {
# TODO only needed when you use intel -> amd is default # monitor = [
# cpu = "intel"; # # default
locale = "something.UTF-8"; # "${config.mods.hypr.hyprland.defaultMonitor},${config.mods.hypr.hyprland.defaultMonitorMode},0x0,${config.mods.hypr.hyprland.defaultMonitorScale}"
timezone = "CONTINENT/CITY"; # # second example monitor
# "DP-2,3440x1440@180,auto,1"
# # all others
# ",highrr,auto,1"
# ];
# }
}; };
# modules gpu.nvidia.enable = true;
mods = { kdeConnect.enable = true;
# default disk config has root home boot and swap partition, overwrite if you want something different # login manager:
# default is greetd
# greetd = { };
# sddm = { };
# gdm = { };
drives = { drives = {
# default assumes ROOT, BOOT, HOME and SWAP labaled drives exist # default assumes ROOT, BOOT, HOME and SWAP labaled drives exist
# for an example without HOME see below # for an example without HOME see below
@ -102,26 +126,6 @@ Here is a minimal required configuration.nix (the TODOs mention a required chang
# You can also use disko to format your disks on installation. # You can also use disko to format your disks on installation.
# Please refer to the Documentation about the drives module for an example. # Please refer to the Documentation about the drives module for an example.
}; };
sops.enable = false;
nextcloud.enable = false;
# default hyprland monitor config -> uncomment when necessary
# TODO: Add more monitors when needed
# hyprland.monitor = [
# # default
# "${config.conf.defaultMonitor},${config.conf.defaultMonitorMode},0x0,${config.conf.defaultMonitorScale}"
# # second example monitor
# "DP-2,3440x1440@180,auto,1"
# # all others
# ",highrr,auto,1"
# ];
# or amd, whatever you have
gpu.nvidia.enable = true;
kdeConnect.enable = true;
# login manager:
# default is greetd
# greetd = { };
# sddm = { };
# gdm = { };
}; };
} }
``` ```

View file

@ -1,27 +1,51 @@
{config, ...}: { {config, ...}: {
# TODO denote important changes
# variables for system # variables for system
# TODO important changes
conf = { conf = {
# change this to your monitor and your pc name # TODO your username
username = "YOURNAME";
# TODO only needed when you use intel -> amd is default
# cpu = "intel";
# TODO your xkb layout
locale = "something.UTF-8";
# TODO your timezone
timezone = "CONTINENT/CITY";
};
# modules
mods = {
# default disk config has root home boot and swap partition, overwrite if you want something different
sops.enable = false;
nextcloud.enable = false;
hypr.hyprland = {
# TODO monitor configuration for hyprland (hyprland is default)
# should be something like DP-1 # should be something like DP-1
defaultMonitor = "YOURMONITOR"; defaultMonitor = "YOURMONITOR";
# width x height @ refreshrate # width x height @ refreshrate
defaultMonitorMode = "1920x1080@60"; defaultMonitorMode = "1920x1080@60";
# scale for your main monitor # scale for your main monitor
defaultMonitorScale = "1"; defaultMonitorScale = "1";
# your username # additional configruation can be done as well
username = "YOURNAME"; # customConfig = {
# TODO only needed when you use intel -> amd is default # monitor = [
# cpu = "intel"; # # default
locale = "something.UTF-8"; # "${config.mods.hypr.hyprland.defaultMonitor},${config.mods.hypr.hyprland.defaultMonitorMode},0x0,${config.mods.hypr.hyprland.defaultMonitorScale}"
timezone = "CONTINENT/CITY"; # # second example monitor
# "DP-2,3440x1440@180,auto,1"
# # all others
# ",highrr,auto,1"
# ];
# }
}; };
# modules gpu.nvidia.enable = true;
mods = { kdeConnect.enable = true;
# default disk config has root home boot and swap partition, overwrite if you want something different # login manager:
# default is greetd
# greetd = { };
# sddm = { };
# gdm = { };
drives = { drives = {
# WARNING: Only do this when installing for the first time, as I am not sure if disko would format your disk
variant = "disko";
# default assumes ROOT, BOOT, HOME and SWAP labaled drives exist # default assumes ROOT, BOOT, HOME and SWAP labaled drives exist
# for an example without HOME see below # for an example without HOME see below
# defaultDrives.enable = false; # defaultDrives.enable = false;
@ -31,12 +55,7 @@
# drive = { # drive = {
# device = "/dev/disk/by-label/BOOT"; # device = "/dev/disk/by-label/BOOT";
# fsType = "vfat"; # fsType = "vfat";
# options = [ # options = [ "rw" "fmask=0022" "dmask=0022" "noatime" ];
# "rw"
# "fmask=0022"
# "dmask=0022"
# "noatime"
# ];
# }; # };
# } # }
# { # {
@ -44,34 +63,12 @@
# drive = { # drive = {
# device = "/dev/disk/by-label/ROOT"; # device = "/dev/disk/by-label/ROOT";
# fsType = "ext4"; # fsType = "ext4";
# options = [ # options = [ "noatime" "nodiratime" "discard" ];
# "noatime"
# "nodiratime"
# "discard"
# ];
# }; # };
# } # }
# ]; # ];
# You can also use disko to format your disks on installation.
# Please refer to the Documentation about the drives module for an example.
}; };
sops.enable = false;
nextcloud.enable = false;
# default hyprland monitor config -> uncomment when necessary
# TODO: Add more monitors when needed
# hyprland.monitor = [
# # default
# "${config.conf.defaultMonitor},${config.conf.defaultMonitorMode},0x0,${config.conf.defaultMonitorScale}"
# # second example monitor
# "DP-2,3440x1440@180,auto,1"
# # all others
# ",highrr,auto,1"
# ];
# or amd, whatever you have
gpu.nvidia.enable = true;
kdeConnect.enable = true;
# login manager:
# default is greetd
# greetd = { };
# sddm = { };
# gdm = { };
}; };
} }

View file

@ -11,6 +11,9 @@
inputs.nixpkgs.follows = "unstable"; inputs.nixpkgs.follows = "unstable";
}; };
# Darkreader requires es20, hence a stable pin
pkgsDarkreader.url = "github:NixOs/nixpkgs/nixos-24.11";
home-manager = { home-manager = {
url = "github:nix-community/home-manager"; url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "unstable"; inputs.nixpkgs.follows = "unstable";
@ -78,30 +81,17 @@
"jitsi-meet-1.0.8043" "jitsi-meet-1.0.8043"
"nextcloud-27.1.11" "nextcloud-27.1.11"
]; ];
stable = import inputs.stable { stable = import ./lib/importPkgs.nix {
system = currentSystem; inherit inputs permittedPackages currentSystem;
config = { pkgs = inputs.stable;
allowUnfree = true;
permittedInsecurePackages = permittedPackages;
}; };
overlays = [ unstable = import ./lib/importPkgs.nix {
inputs.nur.overlays.default inherit inputs permittedPackages currentSystem;
inputs.chaoticNyx.overlays.default pkgs = inputs.unstable;
];
}; };
unstable = import inputs.unstable { pkgsDarkreader = import ./lib/importPkgs.nix {
system = currentSystem; inherit inputs permittedPackages currentSystem;
config = { pkgs = inputs.pkgsDarkreader;
allowUnsupportedSystem = true;
permittedInsecurePackages = permittedPackages;
# Often happens with neovim, this should not block everything.
allowBroken = true;
allowUnfree = true;
};
overlays = [
inputs.nur.overlays.default
inputs.chaoticNyx.overlays.default
];
}; };
in rec { in rec {
dashNixLib = import ./lib { dashNixLib = import ./lib {
@ -111,6 +101,9 @@
unstable unstable
stable stable
; ;
dashNixAdditionalProps = {
inherit pkgsDarkreader;
};
system = currentSystem; system = currentSystem;
lib = inputs.unstable.lib; lib = inputs.unstable.lib;
}; };

View file

@ -3,6 +3,7 @@
additionalHomeConfig, additionalHomeConfig,
additionalHomeMods, additionalHomeMods,
additionalInputs, additionalInputs,
dashNixAdditionalProps,
config, config,
homeMods, homeMods,
inputs, inputs,
@ -27,7 +28,16 @@
useGlobalPkgs = mkDashDefault true; useGlobalPkgs = mkDashDefault true;
useUserPackages = mkDashDefault true; useUserPackages = mkDashDefault true;
extraSpecialArgs = { extraSpecialArgs = {
inherit inputs root additionalInputs alternativePkgs system stable unstable; inherit
inputs
root
additionalInputs
alternativePkgs
system
stable
unstable
dashNixAdditionalProps
;
mkDashDefault = import ../lib/override.nix {inherit lib;}; mkDashDefault = import ../lib/override.nix {inherit lib;};
}; };

View file

@ -290,14 +290,18 @@
''; '';
browsername = config.mods.homePackages.browser; browsername = config.mods.homePackages.browser;
profiles = profiles =
if config.mods.homePackages.browser == "firefox" then if config.mods.homePackages.browser == "firefox"
config.mods.browser.firefox.profiles then config.mods.browser.firefox.profiles
else if config.mods.homePackages.browser == "zen" then else if config.mods.homePackages.browser == "zen"
config.mods.browser.zen.profiles then config.mods.browser.zen.profiles
else if config.mods.homePackages.browser == "librewolf" then else if config.mods.homePackages.browser == "librewolf"
[{name = "default"; value = {};}] then [
else {
[]; name = "default";
value = {};
}
]
else [];
profileNamesFn = profileNamesFn =
builtins.catAttrs "name"; builtins.catAttrs "name";
chromesFn = builtins.map ( chromesFn = builtins.map (
@ -315,11 +319,11 @@
else {} else {}
); );
moduleFn = lib.lists.foldr (attr1: attr2: attr1 // attr2) {}; moduleFn = lib.lists.foldr (attr1: attr2: attr1 // attr2) {};
mkFirefoxTheme = (profiles: mkFirefoxTheme = (
profiles:
profiles profiles
|> profileNamesFn |> profileNamesFn
|> chromesFn |> chromesFn
|> moduleFn |> moduleFn
); );
in in {home.file = mkFirefoxTheme profiles;}
{home.file = mkFirefoxTheme profiles;}

View file

@ -5,6 +5,7 @@
self, self,
stable, stable,
system, system,
dashNixAdditionalProps ? {},
... ...
}: { }: {
/* /*
@ -92,6 +93,8 @@
root root
stable stable
unstable unstable
additionalInputs
dashNixAdditionalProps
; ;
pkgs = lib.mkForce ( pkgs = lib.mkForce (
if overridePkgs if overridePkgs
@ -105,7 +108,6 @@
hostName = name; hostName = name;
homeMods = mods.home; homeMods = mods.home;
additionalHomeMods = additionalMods.home; additionalHomeMods = additionalMods.home;
additionalInputs = additionalInputs;
mkDashDefault = import ./override.nix {inherit lib;}; mkDashDefault = import ./override.nix {inherit lib;};
}; };
in in

View file

@ -1,6 +1,6 @@
{ {
lib, lib,
stable, dashNixAdditionalProps,
pkgs, pkgs,
name, name,
... ...
@ -24,9 +24,16 @@ in {
(mkExtension "@react-devtools" "https://addons.mozilla.org/firefox/downloads/latest/react-devtools/latest.xpi") (mkExtension "@react-devtools" "https://addons.mozilla.org/firefox/downloads/latest/react-devtools/latest.xpi")
(mkExtension "extension@redux.devtools" "https://addons.mozilla.org/firefox/downloads/latest/reduxdevtools/latest.xpi") (mkExtension "extension@redux.devtools" "https://addons.mozilla.org/firefox/downloads/latest/reduxdevtools/latest.xpi")
(mkExtension "private-relay@firefox.com" "https://addons.mozilla.org/firefox/downloads/latest/private-relay/latest.xpi") (mkExtension "private-relay@firefox.com" "https://addons.mozilla.org/firefox/downloads/latest/private-relay/latest.xpi")
(mkExtension "addon@darkreader.org" "file://${pkgs.callPackage ../../../patches/darkreader.nix {inherit lib stable;}}/latest.xpi") (mkExtension "addon@darkreader.org" "file://${pkgs.callPackage ../patches/darkreader.nix {inherit lib dashNixAdditionalProps;}}/latest.xpi")
];
example = [
{
"78272b6fa58f4a1abaac99321d503a20@proton.me" = {
install_url = "https://addons.mozilla.org/en-US/firefox/downloads/latest/proton-pass/latest.xpi";
installation_mode = "normal_installed";
};
}
]; ];
example = [];
type = with lib.types; listOf anything; type = with lib.types; listOf anything;
description = '' description = ''
List of extensions via attrsets: List of extensions via attrsets:

17
lib/importPkgs.nix Normal file
View file

@ -0,0 +1,17 @@
{
inputs,
currentSystem,
permittedPackages,
pkgs,
}:
import pkgs {
system = currentSystem;
config = {
allowUnfree = true;
permittedInsecurePackages = permittedPackages;
};
overlays = [
inputs.nur.overlays.default
inputs.chaoticNyx.overlays.default
];
}

View file

@ -76,7 +76,8 @@
additionalBootKernalParams = lib.mkOption { additionalBootKernalParams = lib.mkOption {
default = [ default = [
"video=${config.conf.defaultMonitor}:${config.conf.defaultMonitorMode}" # TODO test if needed
#"video=${config.conf.defaultMonitor}:${config.conf.defaultMonitorMode}"
]; ];
example = []; example = [];
type = with lib.types; listOf str; type = with lib.types; listOf str;
@ -85,33 +86,6 @@
''; '';
}; };
defaultMonitor = lib.mkOption {
default = "";
example = "eDP-1";
type = lib.types.str;
description = ''
main monitor
'';
};
defaultMonitorMode = lib.mkOption {
default = "";
example = "3440x1440@180";
type = lib.types.str;
description = ''
main monitor mode: width x height @ refreshrate
'';
};
defaultMonitorScale = lib.mkOption {
default = "1";
example = "1.5";
type = lib.types.str;
description = ''
main monitor scaling
'';
};
bootParams = lib.mkOption { bootParams = lib.mkOption {
default = []; default = [];
example = ["resume=something"]; example = ["resume=something"];

144
modules/programs/anyrun.nix Normal file
View file

@ -0,0 +1,144 @@
{
mkDashDefault,
lib,
config,
pkgs,
options,
inputs,
...
}: {
options.mods.anyrun = {
enable = lib.mkOption {
default = false;
example = true;
type = lib.types.bool;
description = "Enables anyrun";
};
useDefaultConfig = lib.mkOption {
default = true;
example = false;
type = lib.types.bool;
description = ''
Use preconfigured anyrun config.
'';
};
customConfig = lib.mkOption {
default = {};
example = {};
type = with lib.types; attrsOf anything;
description = ''
Custom anyrun configuration.
Will be merged with default configuration if enabled.
'';
};
useDefaultCss = lib.mkOption {
default = true;
example = false;
type = lib.types.bool;
description = ''
Use preconfigured anyrun css.
'';
};
customCss = lib.mkOption {
default = '''';
example = ''
#window {
border-radius: none;
}
'';
type = lib.types.lines;
description = ''
Custom anyrun css.
Will be merged with default css if enabled.
'';
};
};
config = lib.mkIf config.mods.anyrun.enable (
lib.optionalAttrs (options ? home.packages) {
programs.anyrun = lib.mkForce {
enable = true;
config =
if config.mods.anyrun.useDefaultConfig
then
lib.mkMerge
[
{
plugins = [
inputs.anyrun.packages.${pkgs.system}.applications
inputs.anyrun.packages.${pkgs.system}.rink
inputs.anyrun.packages.${pkgs.system}.translate
inputs.anyrun.packages.${pkgs.system}.websearch
];
hideIcons = mkDashDefault false;
width = {
fraction = mkDashDefault 0.3;
};
y = {
fraction = mkDashDefault 0.5;
};
layer = mkDashDefault "overlay";
hidePluginInfo = mkDashDefault true;
closeOnClick = mkDashDefault true;
}
config.mods.anyrun.customConfig
]
else config.mods.anyrun.customConfig;
extraCss =
if config.mods.anyrun.useDefaultCss
then
''
#window {
border-radius: 10px;
background-color: transparent;
}
box#main {
border-radius: 10px;
}
list#main {
border-radius: 10px;
margin: 0px 10px 10px 10px;
}
list#plugin {
border-radius: 10px;
}
list#match {
border-radius: 10px;
}
entry#entry {
border: 0;
border-radius: 10px;
margin: 10px 10px 0px 10px;
}
label#match-desc {
font-size: 12px;
border-radius: 10px;
}
label#match-title {
font-size: 12px;
border-radius: 10px;
}
label#plugin {
font-size: 16px;
border-radius: 10px;
}
* {
border-radius: 10px;
}
''
+ config.mods.anyrun.customCss
else config.mods.anyrun.customCss;
};
}
);
}

View file

@ -80,7 +80,7 @@
++ config.mods.basePackages.additionalPackages ++ config.mods.basePackages.additionalPackages
else config.mods.basePackages.additionalPackages; else config.mods.basePackages.additionalPackages;
gtk.iconCache.enable = false; gtk.iconCache.enable = mkDashDefault false;
services = services =
if config.mods.basePackages.enable if config.mods.basePackages.enable
then then
@ -102,6 +102,8 @@
programs = programs =
if config.mods.basePackages.enable if config.mods.basePackages.enable
then then
lib.mkMerge
[
{ {
nix-ld = { nix-ld = {
enable = mkDashDefault true; enable = mkDashDefault true;
@ -122,7 +124,8 @@
}; };
gnupg.agent.enable = mkDashDefault true; gnupg.agent.enable = mkDashDefault true;
} }
// config.mods.basePackages.specialPrograms config.mods.basePackages.specialPrograms
]
else config.mods.basePackages.specialPrograms; else config.mods.basePackages.specialPrograms;
}; };
} }

View file

@ -1,4 +1,5 @@
{ {
mkDashDefault,
lib, lib,
config, config,
options, options,
@ -18,8 +19,8 @@
config = lib.mkIf config.mods.bluetooth.enable ( config = lib.mkIf config.mods.bluetooth.enable (
lib.optionalAttrs (options ? hardware.bluetooth) { lib.optionalAttrs (options ? hardware.bluetooth) {
hardware.bluetooth = { hardware.bluetooth = {
enable = true; enable = mkDashDefault true;
powerOnBoot = true; powerOnBoot = mkDashDefault true;
}; };
} }
); );

View file

@ -1,16 +1,16 @@
{ {
lib, lib,
dashNixAdditionalProps,
config, config,
options, options,
pkgs, pkgs,
stable,
... ...
}: let }: let
name = "firefox"; name = "firefox";
in { in {
imports = [ imports = [
(import ./ffextensions.nix (import ../../../lib/foxextensions.nix
{inherit lib stable pkgs name;}) {inherit lib dashNixAdditionalProps pkgs name;})
]; ];
options.mods.browser.${name} = { options.mods.browser.${name} = {
enable = lib.mkOption { enable = lib.mkOption {

View file

@ -1,16 +1,16 @@
{ {
lib, lib,
dashNixAdditionalProps,
config, config,
options, options,
pkgs, pkgs,
stable,
... ...
}: let }: let
name = "librewolf"; name = "librewolf";
in { in {
imports = [ imports = [
(import ./ffextensions.nix (import ../../../lib/foxextensions.nix
{inherit lib stable pkgs name;}) {inherit lib dashNixAdditionalProps pkgs name;})
]; ];
options.mods.browser.${name} = { options.mods.browser.${name} = {
enable = lib.mkOption { enable = lib.mkOption {

View file

@ -1,10 +1,10 @@
# credits to Voronind for darkreader config https://github.com/voronind-com/nix/blob/main/home/program/firefox/default.nix # credits to Voronind for darkreader config https://github.com/voronind-com/nix/blob/main/home/program/firefox/default.nix
{ {
lib, lib,
dashNixAdditionalProps,
config, config,
options, options,
inputs, inputs,
stable,
system, system,
pkgs, pkgs,
... ...
@ -16,8 +16,8 @@
name = "zen"; name = "zen";
in { in {
imports = [ imports = [
(import ./ffextensions.nix (import ../../../lib/foxextensions.nix
{inherit lib stable pkgs name;}) {inherit lib dashNixAdditionalProps pkgs name;})
]; ];
options.mods.browser.${name} = { options.mods.browser.${name} = {
enable = lib.mkOption { enable = lib.mkOption {

View file

@ -1,4 +1,5 @@
{ {
mkDashDefault,
lib, lib,
config, config,
pkgs, pkgs,
@ -518,7 +519,7 @@ in {
}; };
programs.vscode = lib.mkIf config.mods.coding.vscodium.enable { programs.vscode = lib.mkIf config.mods.coding.vscodium.enable {
enable = true; enable = true;
package = pkgs.vscodium; package = mkDashDefault pkgs.vscodium;
profiles.default.extensions = config.mods.coding.vscodium.extensions; profiles.default.extensions = config.mods.coding.vscodium.extensions;
}; };
xdg.configFile."neovide/config.toml" = lib.mkIf (config.mods.coding.dashvim || config.mods.coding.neovide.enable) { xdg.configFile."neovide/config.toml" = lib.mkIf (config.mods.coding.dashvim || config.mods.coding.neovide.enable) {

View file

@ -1,4 +1,5 @@
{ {
mkDashDefault,
lib, lib,
config, config,
options, options,
@ -63,8 +64,8 @@
containers.enable = true; containers.enable = true;
podman = { podman = {
enable = true; enable = true;
dockerCompat = true; dockerCompat = mkDashDefault true;
defaultNetwork.settings.dns_enabled = true; defaultNetwork.settings.dns_enabled = mkDashDefault true;
}; };
} }
else if (config.mods.containers.variant == "docker") else if (config.mods.containers.variant == "docker")

View file

@ -1,6 +1,7 @@
{ {
imports = [ imports = [
./acpid.nix ./acpid.nix
./anyrun.nix
./basePackages.nix ./basePackages.nix
./bluetooth.nix ./bluetooth.nix
./browser ./browser
@ -19,7 +20,8 @@
./gpu.nix ./gpu.nix
./greetd.nix ./greetd.nix
./homePackages.nix ./homePackages.nix
./hyprland ./hypr
./ironbar.nix
./kde.nix ./kde.nix
./kdeConnect.nix ./kdeConnect.nix
./keepassxc.nix ./keepassxc.nix

View file

@ -1,32 +1,20 @@
{ {
mkDashDefault,
pkgs, pkgs,
lib, lib,
options, options,
config, config,
... ...
}: { }: {
options.mods = { options.mods.dashfetch = {
dashfetch = lib.mkOption { enable = lib.mkOption {
default = true; default = true;
example = false; example = false;
type = lib.types.bool; type = lib.types.bool;
description = "A custom configuration for fastfetch"; description = "A custom configuration for fastfetch";
}; };
}; modules = lib.mkOption {
default = [
config = lib.optionalAttrs (options ? home.packages) {
xdg.configFile."fastfetch/config.jsonc" = lib.mkIf (config.mods.dashfetch) {
source = (pkgs.formats.json {}).generate "config.jsonc" {
"$schema" = "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json";
logo = {
type = "kitty";
source = ../../assets/logo2.png;
width = 35;
padding = {
top = 1;
};
};
modules = [
"title" "title"
"separator" "separator"
{ {
@ -61,6 +49,25 @@
"break" "break"
"colors" "colors"
]; ];
example = [];
type = with lib.types; listOf anything;
description = "modules for fastfetch";
};
};
config = lib.optionalAttrs (options ? home.packages) {
xdg.configFile."fastfetch/config.jsonc" = lib.mkIf (config.mods.dashfetch.enable) {
source = (pkgs.formats.json {}).generate "config.jsonc" {
"$schema" = "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json";
logo = {
type = mkDashDefault "kitty";
source = mkDashDefault ../../assets/logo2.png;
width = mkDashDefault 35;
padding = mkDashDefault {
top = mkDashDefault 1;
};
};
modules = config.mods.dashfetch.modules;
}; };
}; };
}; };

View file

@ -1,4 +1,5 @@
{ {
mkDashDefault,
lib, lib,
config, config,
options, options,
@ -76,27 +77,27 @@
boot.kernelPackages = lib.mkForce pkgs.linuxPackages_cachyos; boot.kernelPackages = lib.mkForce pkgs.linuxPackages_cachyos;
programs = { programs = {
steam.enable = config.mods.gaming.steam; steam.enable = mkDashDefault config.mods.gaming.steam;
gamemode.enable = true; gamemode.enable = true;
gamemode = { gamemode = {
enableRenice = true; enableRenice = mkDashDefault true;
settings = { settings = {
general = { general = {
desiredgov = "performance"; desiredgov = mkDashDefault "performance";
}; };
cpu = { cpu = {
pin_cores = config.mods.gaming.pinCores; pin_cores = mkDashDefault config.mods.gaming.pinCores;
park_cores = config.mods.gaming.parkCores; park_cores = mkDashDefault config.mods.gaming.parkCores;
}; };
gpu = lib.mkIf config.mods.gaming.gpuOptimization { gpu = lib.mkIf config.mods.gaming.gpuOptimization {
apply_gpu_optimisations = "accept-responsibility"; apply_gpu_optimisations = mkDashDefault "accept-responsibility";
gpu_device = config.mods.gaming.gpuDevice; gpu_device = mkDashDefault config.mods.gaming.gpuDevice;
amd_performance_level = "high"; amd_performance_level = mkDashDefault "high";
nv_powermizer_mode = 1; nv_powermizer_mode = mkDashDefault 1;
}; };
custom = { custom = {
start = "notify-send -a 'Gamemode' 'Optimizations activated'"; start = mkDashDefault "notify-send -a 'Gamemode' 'Optimizations activated'";
end = "notify-send -a 'Gamemode' 'Optimizations deactivated'"; end = mkDashDefault "notify-send -a 'Gamemode' 'Optimizations deactivated'";
}; };
}; };
}; };

View file

@ -67,16 +67,16 @@
environment.variables = environment.variables =
if (config.mods.gpu.amdgpu.enable && config.mods.gpu.vapi.rocm.enable) if (config.mods.gpu.amdgpu.enable && config.mods.gpu.vapi.rocm.enable)
then { then {
RUSTICL_ENABLE = "radeonsi"; RUSTICL_ENABLE = mkDashDefault "radeonsi";
} }
else {}; else {};
hardware = { hardware = {
nvidia = lib.mkIf config.mods.gpu.nvidia.enable { nvidia = lib.mkIf config.mods.gpu.nvidia.enable {
modesetting.enable = true; modesetting.enable = mkDashDefault true;
open = true; open = mkDashDefault true;
nvidiaSettings = true; nvidiaSettings = mkDashDefault true;
package = config.boot.kernelPackages.nvidiaPackages.beta; package = mkDashDefault config.boot.kernelPackages.nvidiaPackages.beta;
}; };
graphics = let graphics = let
amdPackages = [ amdPackages = [

View file

@ -1,4 +1,5 @@
{ {
mkDashDefault,
config, config,
lib, lib,
inputs, inputs,
@ -17,7 +18,7 @@
''; '';
}; };
monitor = lib.mkOption { monitor = lib.mkOption {
default = "${config.conf.defaultMonitor}"; default = "${config.mods.hypr.hyprland.defaultMonitor}";
example = "eDP-1"; example = "eDP-1";
type = lib.types.str; type = lib.types.str;
description = '' description = ''
@ -26,7 +27,7 @@
''; '';
}; };
scale = lib.mkOption { scale = lib.mkOption {
default = "${config.conf.defaultMonitorScale}"; default = "${config.mods.hypr.hyprland.defaultMonitorScale}";
example = "1.5"; example = "1.5";
type = lib.types.str; type = lib.types.str;
description = '' description = ''
@ -45,7 +46,7 @@
description = "The compositor/greeter command to run"; description = "The compositor/greeter command to run";
}; };
resolution = lib.mkOption { resolution = lib.mkOption {
default = "${config.conf.defaultMonitorMode}"; default = "${config.mods.hypr.hyprland.defaultMonitorMode}";
example = "3440x1440@180"; example = "3440x1440@180";
type = lib.types.str; type = lib.types.str;
description = '' description = ''
@ -86,16 +87,16 @@
lib.mkIf config.mods.greetd.enable ( lib.mkIf config.mods.greetd.enable (
lib.optionalAttrs (options ? environment) { lib.optionalAttrs (options ? environment) {
# greetd display manager # greetd display manager
programs.hyprland.enable = true; programs.hyprland.enable = mkDashDefault true;
services = { services = {
displayManager.sessionPackages = config.mods.greetd.environments; displayManager.sessionPackages = config.mods.greetd.environments;
greetd = { greetd = {
enable = true; enable = true;
settings = { settings = {
terminal.vt = 1; terminal.vt = mkDashDefault 1;
default_session = { default_session = {
command = config.mods.greetd.greeterCommand; command = mkDashDefault config.mods.greetd.greeterCommand;
user = username; user = mkDashDefault username;
}; };
}; };
}; };
@ -129,9 +130,9 @@
''; '';
# unlock GPG keyring on login # unlock GPG keyring on login
security.pam.services.greetd.enableGnomeKeyring = true; security.pam.services.greetd.enableGnomeKeyring = mkDashDefault true;
security.pam.services.greetd.sshAgentAuth = true; security.pam.services.greetd.sshAgentAuth = mkDashDefault true;
security.pam.sshAgentAuth.enable = true; security.pam.sshAgentAuth.enable = mkDashDefault true;
} }
// lib.optionalAttrs (options ? home) { // lib.optionalAttrs (options ? home) {
xdg.configFile."regreet/regreet.toml".source = xdg.configFile."regreet/regreet.toml".source =

View file

@ -1,8 +1,6 @@
{ {
imports = [ imports = [
./hyprland.nix ./hyprland.nix
./anyrun.nix
./ironbar.nix
./hyprlock.nix ./hyprlock.nix
./hyprpaper.nix ./hyprpaper.nix
]; ];

View file

@ -14,7 +14,7 @@
then config.mods.homePackages.browser.meta.mainProgram then config.mods.homePackages.browser.meta.mainProgram
else config.mods.homePackages.browser.pname; else config.mods.homePackages.browser.pname;
in { in {
options.mods.hyprland = { options.mods.hypr.hyprland = {
enable = lib.mkOption { enable = lib.mkOption {
default = true; default = true;
example = false; example = false;
@ -23,10 +23,34 @@ in {
Enable Hyprland Enable Hyprland
''; '';
}; };
defaultMonitor = lib.mkOption {
default = "";
example = "eDP-1";
type = lib.types.str;
description = ''
main monitor
'';
};
defaultMonitorMode = lib.mkOption {
default = "";
example = "3440x1440@180";
type = lib.types.str;
description = ''
main monitor mode: width x height @ refreshrate
'';
};
defaultMonitorScale = lib.mkOption {
default = "1";
example = "1.5";
type = lib.types.str;
description = ''
main monitor scaling
'';
};
monitor = lib.mkOption { monitor = lib.mkOption {
default = [ default = [
# main monitor # main monitor
"${config.conf.defaultMonitor},${config.conf.defaultMonitorMode},0x0,${config.conf.defaultMonitorScale}" "${config.mods.hypr.hyprland.defaultMonitor},${config.mods.hypr.hyprland.defaultMonitorMode},0x0,${config.mods.hypr.hyprland.defaultMonitorScale}"
# all others # all others
]; ];
example = ["DP-1,3440x1440@180,2560x0,1,vrr,0"]; example = ["DP-1,3440x1440@180,2560x0,1,vrr,0"];
@ -59,6 +83,14 @@ in {
Extra exec_once. Extra exec_once.
''; '';
}; };
useIronbar = lib.mkOption {
default = true;
example = false;
type = lib.types.bool;
description = ''
Whether to use ironbar in hyprland.
'';
};
useDefaultConfig = lib.mkOption { useDefaultConfig = lib.mkOption {
default = true; default = true;
example = false; example = false;
@ -103,7 +135,7 @@ in {
}; };
}; };
config = lib.mkIf config.mods.hyprland.enable ( config = lib.mkIf config.mods.hypr.hyprland.enable (
lib.optionalAttrs (options ? wayland.windowManager.hyprland) { lib.optionalAttrs (options ? wayland.windowManager.hyprland) {
# install Hyprland related packages # install Hyprland related packages
home.packages = with pkgs; [ home.packages = with pkgs; [
@ -122,12 +154,12 @@ in {
wayland.windowManager.hyprland = { wayland.windowManager.hyprland = {
enable = true; enable = true;
settings = settings =
if config.mods.hyprland.useDefaultConfig if config.mods.hypr.hyprland.useDefaultConfig
then then
lib.mkMerge lib.mkMerge
[ [
{ {
"$mod" = "SUPER"; "$mod" = mkDashDefault "SUPER";
bindm = [ bindm = [
"$mod, mouse:272, movewindow" "$mod, mouse:272, movewindow"
@ -148,15 +180,15 @@ in {
"$mod SUPER,T,exec,kitty -1" "$mod SUPER,T,exec,kitty -1"
"$mod SUPER,E,exec,nautilus -w" "$mod SUPER,E,exec,nautilus -w"
"$mod SUPER,N,exec,neovide" "$mod SUPER,N,exec,neovide"
(lib.mkIf (config.mods.hyprland.anyrun.enable) "$mod SUPER,R,exec,anyrun") (lib.mkIf (config.mods.anyrun.enable) "$mod SUPER,R,exec,anyrun")
(lib.mkIf (config.mods.oxi.oxirun.enable) "$mod SUPER,R,exec,oxirun") (lib.mkIf (config.mods.oxi.oxirun.enable) "$mod SUPER,R,exec,oxirun")
(lib.mkIf (config.mods.oxi.oxidash.enable) "$mod SUPER,M,exec,oxidash") (lib.mkIf (config.mods.oxi.oxidash.enable) "$mod SUPER,M,exec,oxidash")
(lib.mkIf (config.mods.oxi.oxicalc.enable) "$mod SUPER,G,exec,oxicalc") (lib.mkIf (config.mods.oxi.oxicalc.enable) "$mod SUPER,G,exec,oxicalc")
(lib.mkIf (config.mods.oxi.oxishut.enable) "$mod SUPER,D,exec,oxishut") (lib.mkIf (config.mods.oxi.oxishut.enable) "$mod SUPER,D,exec,oxishut")
(lib.mkIf (config.mods.oxi.oxipaste.enable) "$mod SUPER,A,exec,oxipaste-iced") (lib.mkIf (config.mods.oxi.oxipaste.enable) "$mod SUPER,A,exec,oxipaste-iced")
(lib.mkIf (config.mods.oxi.hyprdock.enable) "$mod SUPERSHIFT,P,exec,hyprdock --gui") (lib.mkIf (config.mods.oxi.hyprdock.enable) "$mod SUPERSHIFT,P,exec,hyprdock --gui")
"$mod SUPERSHIFT,L,exec, playerctl -a pause & hyprlock & systemctl suspend" (lib.mkIf (config.mods.hypr.hyprlock.enable) "$mod SUPERSHIFT,L,exec, playerctl -a pause & hyprlock & systemctl suspend")
"$mod SUPERSHIFT,K,exec, playerctl -a pause & hyprlock & systemctl hibernate" (lib.mkIf (config.mods.hypr.hyprlock.enable) "$mod SUPERSHIFT,K,exec, playerctl -a pause & hyprlock & systemctl hibernate")
# media keys # media keys
(lib.mkIf config.mods.scripts.audioControl ",XF86AudioMute,exec, audioControl mute") (lib.mkIf config.mods.scripts.audioControl ",XF86AudioMute,exec, audioControl mute")
@ -243,15 +275,15 @@ in {
]; ];
general = { general = {
gaps_out = "3,5,5,5"; gaps_out = mkDashDefault "3,5,5,5";
border_size = 3; border_size = mkDashDefault 3;
"col.active_border" = lib.mkOverride 51 "0xFFFF0000 0xFF00FF00 0xFF0000FF 45deg"; "col.active_border" = lib.mkOverride 51 "0xFFFF0000 0xFF00FF00 0xFF0000FF 45deg";
# "col.inactive_border" = "0x66333333"; # "col.inactive_border" = "0x66333333";
allow_tearing = lib.mkIf config.mods.hyprland.noAtomic true; allow_tearing = lib.mkIf config.mods.hypr.hyprland.noAtomic true;
}; };
decoration = { decoration = {
rounding = 4; rounding = mkDashDefault 4;
}; };
render = { render = {
@ -259,7 +291,7 @@ in {
}; };
animations = { animations = {
bezier = "penguin,0.05,0.9,0.1,1.0"; bezier = mkDashDefault "penguin,0.05,0.9,0.1,1.0";
animation = [ animation = [
"windowsMove,1,4,default" "windowsMove,1,4,default"
"windows,1,7,default,popin 70%" "windows,1,7,default,popin 70%"
@ -272,51 +304,51 @@ in {
}; };
dwindle = { dwindle = {
preserve_split = true; preserve_split = mkDashDefault true;
pseudotile = 0; pseudotile = mkDashDefault 0;
permanent_direction_override = false; permanent_direction_override = mkDashDefault false;
}; };
input = { input = {
kb_layout = "${config.mods.xkb.layout}"; kb_layout = mkDashDefault "${config.mods.xkb.layout}";
kb_variant = "${config.mods.xkb.variant}"; kb_variant = mkDashDefault "${config.mods.xkb.variant}";
repeat_delay = 200; repeat_delay = mkDashDefault 200;
force_no_accel = true; force_no_accel = mkDashDefault true;
touchpad = { touchpad = {
natural_scroll = true; natural_scroll = mkDashDefault true;
tap-to-click = true; tap-to-click = mkDashDefault true;
tap-and-drag = true; tap-and-drag = mkDashDefault true;
}; };
}; };
misc = { misc = {
animate_manual_resizes = 1; animate_manual_resizes = mkDashDefault 1;
enable_swallow = true; enable_swallow = mkDashDefault true;
disable_splash_rendering = true; disable_splash_rendering = mkDashDefault true;
disable_hyprland_logo = true; disable_hyprland_logo = mkDashDefault true;
swallow_regex = "^(.*)(kitty)(.*)$"; swallow_regex = mkDashDefault "^(.*)(kitty)(.*)$";
initial_workspace_tracking = 1; initial_workspace_tracking = mkDashDefault 1;
# just doesn't work # just doesn't work
enable_anr_dialog = false; enable_anr_dialog = false;
}; };
cursor = { cursor = {
enable_hyprcursor = true; enable_hyprcursor = mkDashDefault true;
no_hardware_cursors = mkDashDefault ( no_hardware_cursors = mkDashDefault (
if config.mods.gpu.nvidia.enable if config.mods.gpu.nvidia.enable
then 2 then 2
else 0 else 0
); );
# done with nix, this would break the current setup otherwise # done with nix, this would break the current setup otherwise
sync_gsettings_theme = false; sync_gsettings_theme = mkDashDefault false;
}; };
gestures = { gestures = {
workspace_swipe = true; workspace_swipe = mkDashDefault true;
}; };
monitor = config.mods.hyprland.monitor; monitor = mkDashDefault config.mods.hypr.hyprland.monitor;
workspace = config.mods.hyprland.workspace; workspace = mkDashDefault config.mods.hypr.hyprland.workspace;
env = [ env = [
"GTK_CSD,0" "GTK_CSD,0"
@ -335,7 +367,7 @@ in {
"QT_WAYLAND_DISABLE_WINDOWDECORATION,1" "QT_WAYLAND_DISABLE_WINDOWDECORATION,1"
"QT_SCALE_FACTOR,1" "QT_SCALE_FACTOR,1"
''EDITOR,"neovide --novsync --nofork"'' ''EDITOR,"neovide --novsync --nofork"''
(lib.mkIf config.mods.hyprland.noAtomic "WLR_DRM_NO_ATOMIC,1") (lib.mkIf config.mods.hypr.hyprland.noAtomic "WLR_DRM_NO_ATOMIC,1")
"GTK_USE_PORTAL, 1" "GTK_USE_PORTAL, 1"
(lib.mkIf config.mods.gpu.nvidia.enable "LIBVA_DRIVER_NAME,nvidia") (lib.mkIf config.mods.gpu.nvidia.enable "LIBVA_DRIVER_NAME,nvidia")
@ -375,35 +407,35 @@ in {
"hyprctl setcursor Bibata-Modern-Classic 24" "hyprctl setcursor Bibata-Modern-Classic 24"
# other programs # other programs
"hyprpaper"
"ironbar"
"${browserName}" "${browserName}"
"oxipaste_daemon" (lib.mkIf config.mods.hypr.hyprpaper.enable "hyprpaper")
"oxinoti" (lib.mkIf config.mods.hypr.hyprland.useIronbar "ironbar")
(lib.mkIf config.mods.oxi.oxipaste.enable "oxipaste_daemon")
(lib.mkIf config.mods.oxi.oxinoti.enable "oxinoti")
] ]
++ config.mods.hyprland.extraAutostart; ++ config.mods.hypr.hyprland.extraAutostart;
plugin = plugin =
lib.mkMerge lib.mkMerge
[ [
{ {
hyprspace = lib.mkIf config.mods.hyprland.hyprspaceEnable { hyprspace = lib.mkIf config.mods.hypr.hyprland.hyprspaceEnable {
bind = [ bind = [
"SUPER, W, overview:toggle, toggle" "SUPER, W, overview:toggle, toggle"
]; ];
}; };
} }
config.mods.hyprland.pluginConfig config.mods.hypr.hyprland.pluginConfig
]; ];
} }
config.mods.hyprland.customConfig config.mods.hypr.hyprland.customConfig
] ]
else lib.mkForce config.mods.hyprland.customConfig; else lib.mkForce config.mods.hypr.hyprland.customConfig;
plugins = plugins =
[ [
(lib.mkIf config.mods.hyprland.hyprspaceEnable inputs.Hyprspace.packages.${pkgs.system}.Hyprspace) (lib.mkIf config.mods.hypr.hyprland.hyprspaceEnable inputs.Hyprspace.packages.${pkgs.system}.Hyprspace)
] ]
++ config.mods.hyprland.plugins; ++ config.mods.hypr.hyprland.plugins;
}; };
} }
); );

View file

@ -0,0 +1,61 @@
{
config,
lib,
options,
pkgs,
...
}: {
options.mods.hypr.hyprlock = {
enable = lib.mkOption {
default = true;
example = false;
type = lib.types.bool;
description = "Enables Hyprlock";
};
config = lib.mkOption {
default = {
background = [
{
monitor = "";
path = "";
color = "rgba(26, 27, 38, 1.0)";
}
];
input-field = [
{
monitor = "${config.mods.hypr.hyprland.defaultMonitor}";
placeholder_text = "password or something";
}
];
label = [
{
monitor = "${config.mods.hypr.hyprland.defaultMonitor}";
text = "$TIME";
font_size = 50;
position = "0, 200";
valign = "center";
halign = "center";
}
];
};
example = {};
type = with lib.types; attrsOf anything;
description = "config";
};
};
config = lib.mkIf config.mods.hypr.hyprlock.enable (
lib.optionalAttrs (options ? xdg.configFile) {
stylix.targets.hyprlock = {
enable = false;
};
home.packages = with pkgs; [hyprlock];
programs.hyprlock = lib.mkIf config.mods.hypr.hyprlock.enable {
enable = true;
settings = config.mods.hypr.hyprlock.config;
};
}
);
}

View file

@ -0,0 +1,36 @@
{
config,
lib,
options,
pkgs,
...
}: {
options.mods.hypr.hyprpaper = {
enable = lib.mkOption {
default = true;
example = false;
type = lib.types.bool;
description = "Enables Hyprpaper";
};
config = lib.mkOption {
default = "";
example = ''
preload = path/to/wallpaper
wallpaper = YOURMONITOR,path/to/wallpaper
'';
type = lib.types.lines;
description = ''
Hyprpaper config
'';
};
};
config = lib.mkIf config.mods.hypr.hyprpaper.enable (
lib.optionalAttrs (options ? xdg.configFile) {
home.packages = with pkgs; [hyprpaper];
xdg.configFile."hypr/hyprpaper.conf" = lib.mkIf config.mods.hypr.hyprpaper.enable {
text = config.mods.hypr.hyprpaper.config;
};
}
);
}

View file

@ -1,144 +0,0 @@
{
lib,
config,
pkgs,
options,
inputs,
...
}: {
options.mods = {
hyprland = {
anyrun = {
enable = lib.mkOption {
default = false;
example = true;
type = lib.types.bool;
description = "Enables anyrun";
};
useDefaultConfig = lib.mkOption {
default = true;
example = false;
type = lib.types.bool;
description = ''
Use preconfigured anyrun config.
'';
};
customConfig = lib.mkOption {
default = {};
example = {};
type = with lib.types; attrsOf anything;
description = ''
Custom anyrun configuration.
Will be merged with default configuration if enabled.
'';
};
useDefaultCss = lib.mkOption {
default = true;
example = false;
type = lib.types.bool;
description = ''
Use preconfigured anyrun css.
'';
};
customCss = lib.mkOption {
default = '''';
example = ''
#window {
border-radius: none;
}
'';
type = lib.types.lines;
description = ''
Custom anyrun css.
Will be merged with default css if enabled.
'';
};
};
};
};
config = lib.mkIf config.mods.hyprland.anyrun.enable (
lib.optionalAttrs (options ? home.packages) {
programs.anyrun = lib.mkForce {
enable = true;
config =
if config.mods.hyprland.anyrun.useDefaultConfig
then
{
plugins = [
inputs.anyrun.packages.${pkgs.system}.applications
inputs.anyrun.packages.${pkgs.system}.rink
inputs.anyrun.packages.${pkgs.system}.translate
inputs.anyrun.packages.${pkgs.system}.websearch
];
hideIcons = false;
width = {
fraction = 0.3;
};
y = {
fraction = 0.5;
};
layer = "overlay";
hidePluginInfo = true;
closeOnClick = true;
}
// config.mods.hyprland.anyrun.customConfig
else config.mods.hyprland.anyrun.customConfig;
extraCss =
if config.mods.hyprland.anyrun.useDefaultCss
then
''
#window {
border-radius: 10px;
background-color: transparent;
}
box#main {
border-radius: 10px;
}
list#main {
border-radius: 10px;
margin: 0px 10px 10px 10px;
}
list#plugin {
border-radius: 10px;
}
list#match {
border-radius: 10px;
}
entry#entry {
border: 0;
border-radius: 10px;
margin: 10px 10px 0px 10px;
}
label#match-desc {
font-size: 12px;
border-radius: 10px;
}
label#match-title {
font-size: 12px;
border-radius: 10px;
}
label#plugin {
font-size: 16px;
border-radius: 10px;
}
* {
border-radius: 10px;
}
''
+ config.mods.hyprland.anyrun.customCss
else config.mods.hyprland.anyrun.customCss;
};
}
);
}

View file

@ -1,58 +0,0 @@
{
config,
lib,
options,
pkgs,
...
}: {
options.mods = {
hyprland.hyprlock = {
enable = lib.mkOption {
default = true;
example = false;
type = lib.types.bool;
description = "Enables Hyprlock";
};
};
};
config = lib.mkIf config.mods.hyprland.hyprlock.enable (
lib.optionalAttrs (options ? xdg.configFile) {
stylix.targets.hyprlock = {
enable = false;
};
home.packages = with pkgs; [hyprlock];
programs.hyprlock = lib.mkIf config.mods.hyprland.hyprlock.enable {
enable = true;
settings = {
background = [
{
monitor = "";
path = "";
color = "rgba(26, 27, 38, 1.0)";
}
];
input-field = [
{
monitor = "${config.conf.defaultMonitor}";
placeholder_text = "password or something";
}
];
label = [
{
monitor = "${config.conf.defaultMonitor}";
text = "$TIME";
font_size = 50;
position = "0, 200";
valign = "center";
halign = "center";
}
];
};
};
}
);
}

View file

@ -1,38 +0,0 @@
{
config,
lib,
options,
pkgs,
...
}: {
options.mods = {
hyprland.hyprpaper = {
enable = lib.mkOption {
default = true;
example = false;
type = lib.types.bool;
description = "Enables Hyprpaper";
};
config = lib.mkOption {
default = "";
example = ''
preload = path/to/wallpaper
wallpaper = YOURMONITOR,path/to/wallpaper
'';
type = lib.types.lines;
description = ''
Hyprpaper config
'';
};
};
};
config = lib.mkIf config.mods.hyprland.hyprpaper.enable (
lib.optionalAttrs (options ? xdg.configFile) {
home.packages = with pkgs; [hyprpaper];
xdg.configFile."hypr/hyprpaper.conf" = lib.mkIf config.mods.hyprland.hyprpaper.enable {
text = config.mods.hyprland.hyprpaper.config;
};
}
);
}

View file

@ -9,12 +9,127 @@
username = config.conf.username; username = config.conf.username;
base16 = pkgs.callPackage inputs.base16.lib {}; base16 = pkgs.callPackage inputs.base16.lib {};
scheme = base16.mkSchemeAttrs config.stylix.base16Scheme; scheme = base16.mkSchemeAttrs config.stylix.base16Scheme;
ironbarDefaultConfig = {
end = [
{
type = "sys_info";
format = [" {memory_percent}"];
interval.memory = 30;
class = "memory-usage";
}
{
type = "custom";
bar = [
{
type = "button";
class = "popup-button";
label = "";
on_click = "popup:toggle";
}
];
class = "popup-button-box";
popup = [
{
type = "box";
orientation = "vertical";
class = "audio-box";
widgets = [
{
type = "box";
orientation = "horizontal";
widgets = [
{
type = "button";
class = "audio-button";
label = "";
on_click = lib.mkIf config.mods.scripts.audioControl "!audioControl bluetooth";
}
{
type = "button";
class = "audio-button";
label = "󰋋";
on_click = lib.mkIf config.mods.scripts.audioControl "!audioControl internal";
}
];
class = "audio-button-box";
}
{
type = "label";
label = "Output";
}
{
type = "slider";
class = "audio-slider";
step = 1.0;
length = 200;
value = "pactl get-sink-volume @DEFAULT_SINK@ | awk -F'/' '{ print $2 }' | tr -d ' %'";
on_change = "!pactl set-sink-volume @DEFAULT_SINK@ $0%";
}
{
type = "label";
label = "Input";
}
{
type = "slider";
class = "audio-slider";
step = 1.0;
length = 200;
value = "pactl get-source-volume @DEFAULT_SOURCE@ | awk -F'/' '{ print $2 }' | tr -d ' %'";
on_change = "!pactl set-source-volume @DEFAULT_SOURCE@ $0%";
}
];
}
];
}
{
type = "custom";
bar = [
{
type = "button";
class = "popup-button";
label = "";
on_click = "!oxidash --css /home/${username}/gits/oxidash/style.css";
}
];
class = "popup-button-box";
}
{
type = "clock";
format = "%I:%M";
format_popup = "%I:%M:%S";
locale = "en_US";
}
{type = "tray";}
];
position = "top";
height = 10;
anchor_to_edges = true;
start = [
{
type = "workspaces";
all_monitors = true;
}
];
center = [
{
type = "focused";
show_icon = true;
show_title = true;
icon_size = 20;
truncate = "end";
}
];
};
monitorConfig =
if config.mods.hypr.hyprland.enable
then {monitors.${config.mods.hypr.hyprland.defaultMonitor} = ironbarDefaultConfig;}
else ironbarDefaultConfig;
in { in {
options.mods = { options.mods = {
hyprland.ironbar = { ironbar = {
enable = lib.mkOption { enable = lib.mkOption {
default = true; default = false;
example = false; example = true;
type = lib.types.bool; type = lib.types.bool;
description = "Enables ironbar"; description = "Enables ironbar";
}; };
@ -26,19 +141,6 @@ in {
Use preconfigured ironbar config. Use preconfigured ironbar config.
''; '';
}; };
modules = lib.mkOption {
default = [];
example = [
{
type = "upower";
class = "memory-usage";
}
];
type = with lib.types; listOf attrs;
description = ''
Adds modules to ironbar. See https://github.com/JakeStanger/ironbar/wiki/ for more information.
'';
};
customConfig = lib.mkOption { customConfig = lib.mkOption {
default = {}; default = {};
example = {}; example = {};
@ -71,12 +173,12 @@ in {
}; };
}; };
}; };
config = lib.mkIf config.mods.hyprland.ironbar.enable ( config = lib.mkIf (config.mods.ironbar.enable || config.mods.hypr.hyprland.useIronbar) (
lib.optionalAttrs (options ? programs.ironbar) { lib.optionalAttrs (options ? programs.ironbar) {
programs.ironbar = { programs.ironbar = {
enable = true; enable = true;
style = style =
if config.mods.hyprland.ironbar.useDefaultCss if config.mods.ironbar.useDefaultCss
then then
/* /*
css css
@ -212,131 +314,20 @@ in {
background-color: #${scheme.base02}; background-color: #${scheme.base02};
} }
'' ''
+ config.mods.hyprland.ironbar.customCss + config.mods.ironbar.customCss
else config.mods.hyprland.ironbar.customCss; else config.mods.ironbar.customCss;
features = [ features = [
#"another_feature" #"another_feature"
]; ];
config = { config =
monitors."${config.conf.defaultMonitor}" = if config.mods.ironbar.useDefaultConfig
if config.mods.hyprland.ironbar.useDefaultConfig
then then
{ lib.mkMerge
end = [
config.mods.hyprland.ironbar.modules monitorConfig
++ [ config.mods.ironbar.customConfig
{ ]
type = "sys_info"; else config.mods.ironbar.customConfig;
format = [" {memory_percent}"];
interval.memory = 30;
class = "memory-usage";
}
{
type = "custom";
bar = [
{
type = "button";
class = "popup-button";
label = "";
on_click = "popup:toggle";
}
];
class = "popup-button-box";
popup = [
{
type = "box";
orientation = "vertical";
class = "audio-box";
widgets = [
{
type = "box";
orientation = "horizontal";
widgets = [
{
type = "button";
class = "audio-button";
label = "";
on_click = lib.mkIf config.mods.scripts.audioControl "!audioControl bluetooth";
}
{
type = "button";
class = "audio-button";
label = "󰋋";
on_click = lib.mkIf config.mods.scripts.audioControl "!audioControl internal";
}
];
class = "audio-button-box";
}
{
type = "label";
label = "Output";
}
{
type = "slider";
class = "audio-slider";
step = 1.0;
length = 200;
value = "pactl get-sink-volume @DEFAULT_SINK@ | awk -F'/' '{ print $2 }' | tr -d ' %'";
on_change = "!pactl set-sink-volume @DEFAULT_SINK@ $0%";
}
{
type = "label";
label = "Input";
}
{
type = "slider";
class = "audio-slider";
step = 1.0;
length = 200;
value = "pactl get-source-volume @DEFAULT_SOURCE@ | awk -F'/' '{ print $2 }' | tr -d ' %'";
on_change = "!pactl set-source-volume @DEFAULT_SOURCE@ $0%";
}
];
}
];
}
{
type = "custom";
bar = [
{
type = "button";
class = "popup-button";
label = "";
on_click = "!oxidash --css /home/${username}/gits/oxidash/style.css";
}
];
class = "popup-button-box";
}
{
type = "clock";
format = "%I:%M";
format_popup = "%I:%M:%S";
locale = "en_US";
}
{type = "tray";}
];
position = "top";
height = 10;
anchor_to_edges = true;
start = [
{
type = "workspaces";
all_monitors = true;
}
];
center = [
{
type = "focused";
show_icon = true;
show_title = true;
icon_size = 20;
truncate = "end";
}
];
}
// config.mods.hyprland.ironbar.customConfig
else config.mods.hyprland.ironbar.customConfig;
};
}; };
} }
); );

View file

@ -12,30 +12,14 @@
type = lib.types.bool; type = lib.types.bool;
description = "Enables the piper program and its daemon"; description = "Enables the piper program and its daemon";
}; };
use_cache_config = lib.mkOption { useConfig = lib.mkOption {
default = true; default = true;
example = false; example = false;
type = lib.types.bool; type = lib.types.bool;
description = "Whether to overwrite the cache config of keepassxc. Note, this means that changes can't be applied via the program anymore!"; description = "Whether to overwrite the config of keepassxc. Note, this means that changes can't be applied via the program anymore!";
}; };
cache_config = lib.mkOption { config = lib.mkOption {
default = '' default = ''
[General]
LastDatabases=/home/${config.conf.username}/pws/Passwords.kdbx
LastActiveDatabase=/home/${config.conf.username}/pws/Passwords.kdbx
LastOpenedDatabases=/home/${config.conf.username}/pws/Passwords.kdbx
LastKeyFiles=@Variant(\0\0\0\x1c\0\0\0\x1\0\0\0>\0/\0h\0o\0m\0\x65\0/\0\x64\0\x61\0s\0h\0i\0\x65\0/\0p\0w\0s\0/\0P\0\x61\0s\0s\0w\0o\0r\0\x64\0s\0.\0k\0\x64\0\x62\0x\0\0\0\n\0\0\0>\0/\0h\0o\0m\0\x65\0/\0\x64\0\x61\0s\0h\0i\0\x65\0/\0p\0w\0s\0/\0l\0o\0g\0i\0n\0_\0k\0\x65\0y\0.\0k\0\x65\0y\0x)
'';
example = "";
type = lib.types.lines;
description = "Cache config to be used.";
};
};
config = lib.mkIf config.mods.keepassxc.enable (
lib.optionalAttrs (options ? home.file) {
home.packages = [pkgs.keepassxc];
xdg.configFile."keepassxc/keepassxc.ini" = {
text = ''
[General] [General]
ConfigVersion=2 ConfigVersion=2
@ -56,10 +40,35 @@
[Security] [Security]
EnableCopyOnDoubleClick=true EnableCopyOnDoubleClick=true
''; '';
example = "";
type = lib.types.lines;
description = "Cache config to be used.";
};
useCacheConfig = lib.mkOption {
default = false;
example = true;
type = lib.types.bool;
description = "Whether to overwrite the cache config of keepassxc. Note, this means that changes can't be applied via the program anymore!";
};
cacheConfig = lib.mkOption {
default = '''';
example = ''
[General]
LastDatabases=/path/to/database
'';
type = lib.types.lines;
description = "Cache config to be used.";
};
};
config = lib.mkIf config.mods.keepassxc.enable (
lib.optionalAttrs (options ? home.file) {
home.packages = [pkgs.keepassxc];
xdg.configFile."keepassxc/keepassxc.ini" = lib.mkIf config.mods.keepassxc.useConfig {
text = config.mods.keepassxc.config;
}; };
home.file.".cache/keepassxc/keepassxc.ini" = lib.mkIf config.mods.keepassxc.use_cache_config { home.file.".cache/keepassxc/keepassxc.ini" = lib.mkIf config.mods.keepassxc.useCacheConfig {
text = config.mods.keepassxc.cache_config; text = config.mods.keepassxc.cacheConfig;
}; };
} }
); );

View file

@ -41,6 +41,12 @@ in {
type = lib.types.bool; type = lib.types.bool;
description = "Enables kitty"; description = "Enables kitty";
}; };
useDefaultConfig = lib.mkOption {
default = true;
example = false;
type = lib.types.bool;
description = "Enable default config for kitty";
};
additionalConfig = lib.mkOption { additionalConfig = lib.mkOption {
default = {}; default = {};
example = { example = {
@ -48,7 +54,7 @@ in {
enable_audio_bell = "yes"; enable_audio_bell = "yes";
}; };
type = with lib.types; attrsOf anything; type = with lib.types; attrsOf anything;
description = "Additional kitty configuration"; description = "Additional kitty configuration. Will be the only configuration if useDefaultConfig is disabled.";
}; };
}; };
config = lib.mkIf config.mods.kitty.enable ( config = lib.mkIf config.mods.kitty.enable (
@ -59,6 +65,8 @@ in {
programs.kitty = { programs.kitty = {
enable = true; enable = true;
settings = settings =
if config.mods.kitty.useDefaultConfig
then
{ {
enable_audio_bell = "no"; enable_audio_bell = "no";
window_alert_on_bell = "no"; window_alert_on_bell = "no";
@ -111,28 +119,10 @@ in {
color13 = "#" + scheme.base06; color13 = "#" + scheme.base06;
color14 = "#" + scheme.base0C; color14 = "#" + scheme.base0C;
color15 = "#" + scheme.base0B; color15 = "#" + scheme.base0B;
# color0 = base;
# color1 = "#" + scheme.base08;
# color2 = "#" + scheme.base0B;
# color3 = "#" + scheme.base0A;
# color4 = "#" + scheme.base0D;
# color5 = "#" + scheme.base0E;
# color6 = "#" + scheme.base0C;
# color7 = "#" + scheme.base05;
#
# color8 = "#" + scheme.base03;
# color9 = "#" + scheme.base08;
# color10 = "#" + scheme.base0B;
# color11 = "#" + scheme.base0A;
# color12 = "#" + scheme.base0D;
# color13 = "#" + scheme.base0E;
# color14 = "#" + scheme.base0C;
# color15 = "#" + scheme.base07;
shell = lib.mkIf config.mods.fish.enable "fish"; shell = lib.mkIf config.mods.fish.enable "fish";
} }
// config.mods.kitty.additionalConfig; // config.mods.kitty.additionalConfig
else config.mods.kitty.additionalConfig;
}; };
} }
); );

View file

@ -1,6 +1,7 @@
# Copyright (c) 2020-2021 Mihai Fufezan # Copyright (c) 2020-2021 Mihai Fufezan
# credits to fufexan https://github.com/fufexan/dotfiles/blob/main/home/terminal/programs/xdg.nix # credits to fufexan https://github.com/fufexan/dotfiles/blob/main/home/terminal/programs/xdg.nix
{ {
mkDashDefault,
config, config,
lib, lib,
options, options,
@ -148,11 +149,11 @@ in {
}; };
userDirs = { userDirs = {
enable = true; enable = mkDashDefault true;
createDirectories = true; createDirectories = mkDashDefault true;
extraConfig = { extraConfig = {
XDG_SCREENSHOTS_DIR = "${config.xdg.userDirs.pictures}/Screenshots"; XDG_SCREENSHOTS_DIR = mkDashDefault "${config.xdg.userDirs.pictures}/Screenshots";
pws = "${config.home.homeDirectory}/pws"; pws = mkDashDefault "${config.home.homeDirectory}/pws";
}; };
}; };
}; };

View file

@ -12,11 +12,8 @@
type = lib.types.bool; type = lib.types.bool;
description = "Enables ncspot with a config"; description = "Enables ncspot with a config";
}; };
}; config = lib.mkOption {
config = lib.mkIf config.mods.ncspot.enable ( default = {
lib.optionalAttrs (options ? home.packages) {
home.packages = with pkgs; [ncspot];
xdg.configFile."ncspot/config.toml".source = (pkgs.formats.toml {}).generate "ncspot" {
notify = true; notify = true;
shuffle = true; shuffle = true;
cover_max_scale = 2; cover_max_scale = 2;
@ -52,6 +49,16 @@
body = "%title"; body = "%title";
}; };
}; };
example = {};
type = with lib.types; attrsOf anything;
description = "config";
};
};
config = lib.mkIf config.mods.ncspot.enable (
lib.optionalAttrs (options ? home.packages) {
home.packages = with pkgs; [ncspot];
xdg.configFile."ncspot/config.toml".source =
lib.mkIf config.mods.ncspot.useConfig (pkgs.formats.toml {}).generate "ncspot" config.mods.ncspot.config;
} }
); );
} }

View file

@ -1,4 +1,5 @@
{ {
mkDashDefault,
lib, lib,
config, config,
options, options,
@ -45,7 +46,7 @@
code_format = "[](bg:prev_bg fg:#5256c3)[ $symbol ($version)](bg:#5256c3)"; code_format = "[](bg:prev_bg fg:#5256c3)[ $symbol ($version)](bg:#5256c3)";
in { in {
enable = true; enable = true;
interactiveOnly = true; interactiveOnly = mkDashDefault true;
presets = lib.mkIf config.mods.starship.useDefaultPrompt ["pastel-powerline"]; presets = lib.mkIf config.mods.starship.useDefaultPrompt ["pastel-powerline"];
settings = settings =
lib.mkIf config.mods.starship.useDefaultPrompt { lib.mkIf config.mods.starship.useDefaultPrompt {

View file

@ -1,4 +1,5 @@
{ {
mkDashDefault,
lib, lib,
config, config,
options, options,
@ -88,11 +89,11 @@
(lib.optionalAttrs (options ? stylix) { (lib.optionalAttrs (options ? stylix) {
stylix = { stylix = {
enable = true; enable = true;
image = ../../base/black.jpg; image = mkDashDefault ../../base/black.jpg;
polarity = "dark"; polarity = mkDashDefault "dark";
targets = { targets = {
nixvim.enable = false; nixvim.enable = mkDashDefault false;
fish.enable = false; fish.enable = mkDashDefault false;
}; };
fonts = config.mods.stylix.fonts; fonts = config.mods.stylix.fonts;
cursor = config.mods.stylix.cursor; cursor = config.mods.stylix.cursor;

View file

@ -1,4 +1,5 @@
{ {
mkDashDefault,
lib, lib,
config, config,
options, options,
@ -41,15 +42,15 @@ in {
libvirtd = { libvirtd = {
enable = true; enable = true;
qemu = { qemu = {
package = pkgs.qemu_kvm; package = mkDashDefault pkgs.qemu_kvm;
swtpm.enable = true; swtpm.enable = mkDashDefault true;
ovmf.enable = true; ovmf.enable = mkDashDefault true;
ovmf.packages = [pkgs.OVMFFull.fd]; ovmf.packages = [pkgs.OVMFFull.fd];
}; };
}; };
spiceUSBRedirection.enable = true; spiceUSBRedirection.enable = mkDashDefault true;
}; };
services.spice-vdagentd.enable = true; services.spice-vdagentd.enable = mkDashDefault true;
users.users.${config.conf.username}.extraGroups = [ users.users.${config.conf.username}.extraGroups = [
"libvirtd" "libvirtd"

View file

@ -1,9 +1,11 @@
# credits to Voronind for darkreader config https://github.com/voronind-com/nix/blob/main/home/program/firefox/default.nix # credits to Voronind for darkreader config https://github.com/voronind-com/nix/blob/main/home/program/firefox/default.nix
{ {
lib, lib,
stable, dashNixAdditionalProps,
... ...
}: }: let
stable = dashNixAdditionalProps.pkgsDarkreader;
in
stable.buildNpmPackage rec { stable.buildNpmPackage rec {
version = "4.9.99"; version = "4.9.99";
pname = "dark-reader"; pname = "dark-reader";