Compare commits

..

1 commit

Author SHA1 Message Date
62e462a0df disko test 2025-02-28 18:32:19 +01:00
91 changed files with 4978 additions and 6252 deletions

View file

@ -1,34 +1,58 @@
# by https://github.com/danth/stylix/blob/master/.github/workflows/docs.yml # by https://github.com/danth/stylix/blob/master/.github/workflows/docs.yml
name: Docs name: Docs
on: on:
push: push:
branches: branches:
- main - main
jobs: jobs:
build: build:
name: Build name: Build
permissions: permissions:
contents: read contents: read
runs-on: nixos-latest
runs-on: ubuntu-latest
steps: steps:
- name: Nix Config - name: Install Nix
run: | uses: DeterminateSystems/nix-installer-action@main
mkdir -p $HOME/.config with:
mkdir -p $HOME/.config/nix github-token: ${{ secrets.GITHUB_TOKEN }}
echo experimental-features = nix-command flakes pipe-operators >> $HOME/.config/nix/nix.conf extra-conf: |
echo access-tokens = github.com=${{ secrets.GITHUBTOKEN }} >> $HOME/.config/nix/nix.conf extra-experimental-features = nix-command flakes
nix profile install nixpkgs#nodejs
- name: Set up cache
uses: DeterminateSystems/magic-nix-cache-action@main
- name: Build docs - name: Build docs
run: nix -L build git+https://git.dashie.org/${{ forgejo.repository }}.git?rev=${{ forgejo.sha }}#docs --no-write-lock-file run: nix -L build github:${{ github.repository }}/${{ github.sha }}#docs --no-write-lock-file
- name: Prepare docs for upload - name: Prepare docs for upload
run: cp -r --dereference --no-preserve=mode,ownership result/ public/ run: cp -r --dereference --no-preserve=mode,ownership result/ public/
# - name: Upload artifact
# uses: https://data.forgejo.org/forgejo/upload-artifact@v4 - name: Upload artifact
# with: uses: actions/upload-pages-artifact@v3
# path: public/
- name: Publish Page
uses: https://data.forgejo.org/actions/git-pages@v2
with: with:
site: https://username.pages.dashie.org/reponame/ path: public/
token: ${{ forge.token }}
source: public/ deploy:
name: Deploy
needs: build
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Deploy docs to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4

View file

@ -1,35 +0,0 @@
# inspired by https://github.com/danth/stylix/blob/master/.github/workflows/docs.yml
name: PR check
on:
pull_request:
branches: ["main"]
jobs:
build:
name: check
permissions:
contents: read
runs-on: ubuntu-latest
steps:
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@main
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
extra-conf: |
extra-experimental-features = nix-command flakes pipe-operators
- name: Set up cache
uses: DeterminateSystems/magic-nix-cache-action@main
- name: action
uses: cachix/install-nix-action@v25
with:
nix_path: nixpkgs=channel:nixos-unstable
- name: cache
uses: cachix/cachix-action@v16
with:
name: dashnix
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- name: Linter check
run: nix run --no-write-lock-file github:${{ github.repository }}/${{ github.sha }}#lint -- check
- name: Format check
run: nix run --no-write-lock-file github:${{ github.repository }}/${{ github.sha }}#format -- --check .
- name: Build docs
run: nix -L build github:${{ github.repository }}/${{ github.sha }}#docs --no-write-lock-file

View file

@ -1,29 +1,30 @@
# by https://github.com/danth/stylix/blob/master/.github/workflows/docs.yml # by https://github.com/danth/stylix/blob/master/.github/workflows/docs.yml
name: Release name: Release
on: on:
release: release:
types: [created] types: [created]
jobs: jobs:
build: build:
name: Release name: Release
permissions: write-all permissions:
runs-on: ubuntu-latest contents: read
steps: runs-on: ubuntu-latest
- name: Install Nix steps:
uses: DeterminateSystems/nix-installer-action@main - name: Install Nix
with: uses: DeterminateSystems/nix-installer-action@main
github-token: ${{ secrets.GITHUB_TOKEN }} with:
extra-conf: | github-token: ${{ secrets.GITHUB_TOKEN }}
extra-experimental-features = nix-command flakes pipe-operators extra-conf: |
- name: Set up cache extra-experimental-features = nix-command flakes
uses: DeterminateSystems/magic-nix-cache-action@main - name: Set up cache
- name: Build ISO uses: DeterminateSystems/magic-nix-cache-action@main
run: nix build github:${{ github.repository }}/${{ github.sha }}#iso --no-write-lock-file - name: Build ISO
- name: Prepare ISO for upload run: nix build github:${{ github.repository }}/${{ github.sha }}#iso --no-write-lock-file
run: | - name: Prepare ISO for upload
cp -r --dereference --no-preserve=mode,ownership result/iso/DashNix.iso DashNix.iso run: |
- name: upload ISO cp -r --dereference --no-preserve=mode,ownership result/ public/
uses: softprops/action-gh-release@v1 - name: upload ISO
with: uses: softprops/action-gh-release@v1
files: | with:
DashNix.iso path: path/

1
.gitignore vendored
View file

@ -1,3 +1,2 @@
result/* result/*
result result
flake.lock

Binary file not shown.

Before

Width:  |  Height:  |  Size: 38 KiB

View file

@ -1,141 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
inkscape:export-ydpi="96"
inkscape:export-xdpi="96"
inkscape:export-filename="nixos-catpuccin.png"
sodipodi:docname="catppuccinnix.svg"
inkscape:version="1.4.2 (ebf0e940d0, 2025-05-08)"
version="1.1"
id="svg2"
viewBox="0 0 3225.0001 1350"
height="1440"
width="3440"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/">
<defs
id="defs4" />
<sodipodi:namedview
inkscape:showpageshadow="false"
borderlayer="true"
inkscape:pagecheckerboard="false"
units="px"
inkscape:document-rotation="0"
fit-margin-bottom="0"
fit-margin-right="0"
fit-margin-left="0"
fit-margin-top="0"
inkscape:snap-global="true"
inkscape:window-maximized="1"
inkscape:window-y="0"
inkscape:window-x="0"
inkscape:window-height="1440"
inkscape:window-width="3440"
showgrid="false"
inkscape:current-layer="g2"
inkscape:document-units="px"
inkscape:cy="745.58828"
inkscape:cx="2124.2232"
inkscape:zoom="0.63976327"
inkscape:pageshadow="2"
inkscape:pageopacity="1"
borderopacity="1.0"
bordercolor="#666666"
pagecolor="#ffffff"
id="base"
inkscape:deskcolor="#d1d1d1" />
<metadata
id="metadata7">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
</cc:Work>
</rdf:RDF>
</metadata>
<g
id="g2"
inkscape:label="nix"
inkscape:export-filename="2kwide.png"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96"
inkscape:groupmode="layer">
<rect
style="display:inline;fill:#1e1e2e;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:3.54331;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1;paint-order:stroke markers fill"
id="rect1"
width="3225"
height="1350"
x="0"
y="0"
inkscape:label="background"
inkscape:export-filename="2kwidepng"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96" />
<g
transform="translate(-233.46209,403.59287)"
style="display:inline;opacity:1"
inkscape:label="logo"
id="layer3"
inkscape:groupmode="layer">
<g
style="stroke-width:11.0512"
transform="matrix(0.11707329,0,0,0.11707336,1503.267,99.424817)"
id="g955">
<g
transform="matrix(11.047619,0,0,11.047619,-1572.2888,9377.7107)"
id="g869"
inkscape:export-filename="g869.svg"
inkscape:export-xdpi="600"
inkscape:export-ydpi="600">
<g
transform="rotate(-60,226.35754,-449.37199)"
id="g932"
style="fill:#f9e2af;fill-opacity:1;stroke-width:11.0512">
<path
sodipodi:nodetypes="cccccccccc"
inkscape:connector-curvature="0"
id="path3336-6"
d="m 449.71876,-420.51322 122.19683,211.67512 -56.15706,0.5268 -32.6236,-56.8692 -32.85645,56.5653 -27.90237,-0.011 -14.29086,-24.6896 46.81047,-80.4901 -33.22946,-57.8257 z"
style="opacity:1;fill:#f9e2af;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:33.1535;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
</g>
<path
sodipodi:nodetypes="cccccccccc"
inkscape:connector-curvature="0"
id="path4260-0"
d="m 309.54892,-710.38827 122.19683,211.67512 -56.15706,0.5268 -32.6236,-56.8692 -32.85645,56.5653 -27.90237,-0.011 -14.29086,-24.6896 46.81047,-80.4901 -33.22946,-57.8256 z"
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#fab387;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:33.1535;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" />
<path
sodipodi:nodetypes="cccccccccc"
inkscape:connector-curvature="0"
id="use3439-6"
d="m 353.65459,-797.57947 -122.21762,211.66311 -28.53475,-48.37004 32.93837,-56.68746 -65.41521,-0.17187 -13.94166,-24.16966 14.23639,-24.72105 93.11171,0.294 33.46379,-57.6904 z"
style="fill:#f38ba8;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:33.1535;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<path
sodipodi:nodetypes="cccccccccc"
inkscape:connector-curvature="0"
id="use3449-5"
d="m 505.28844,-721.12474 -122.19683,-211.67512 56.15706,-0.5268 32.6236,56.8692 32.85645,-56.5653 27.90237,0.011 14.29086,24.6896 -46.81047,80.4901 33.22946,57.8257 z"
style="fill:#89b4fa;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:33.1535;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<path
sodipodi:nodetypes="cccccccccc"
inkscape:connector-curvature="0"
id="use4354-5"
d="m 451.30201,-803.62004 -244.41444,-0.012 27.62231,-48.89684 65.56197,0.18174 -32.55876,-56.73718 13.96071,-24.15866 28.52725,-0.0314 46.30123,80.7841 66.69317,0.13525 z"
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#cba6f7;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:33.1535;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" />
<path
sodipodi:nodetypes="cccccccccc"
inkscape:connector-curvature="0"
id="use4362-2"
d="m 460.90516,-633.96606 122.21762,-211.66312 28.53475,48.37004 -32.93837,56.68746 65.41521,0.17187 13.94166,24.16966 -14.23639,24.72105 -93.11171,-0.294 -33.46371,57.69035 z"
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#a6e3a1;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:33.1535;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" />
</g>
</g>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 7.3 KiB

View file

@ -1,5 +1,4 @@
{ {
mkDashDefault,
pkgs, pkgs,
config, config,
lib, lib,
@ -11,36 +10,22 @@
in { in {
imports = [ imports = [
(modulesPath + "/installer/scan/not-detected.nix") (modulesPath + "/installer/scan/not-detected.nix")
#(modulesPath + "/misc/nixpkgs/read-only.nix")
]; ];
wsl.enable = mkDashDefault config.conf.wsl;
# Bootloader. # Bootloader.
boot = lib.mkIf (!config.conf.wsl) { boot = {
consoleLogLevel = mkDashDefault 0; consoleLogLevel = 0;
lanzaboote = lib.mkIf config.conf.secureBoot {
enable = mkDashDefault true;
pkiBundle = mkDashDefault "/var/lib/sbctl";
settings.reboot-for-bitlocker = mkDashDefault true;
};
loader = { loader = {
systemd-boot = { systemd-boot = lib.mkIf config.conf.useSystemdBootloader {
enable = enable = true;
if config.conf.secureBoot
then lib.mkForce false
else if config.conf.useSystemdBootloader
then true
else mkDashDefault false;
configurationLimit = 5; configurationLimit = 5;
}; };
efi.canTouchEfiVariables = mkDashDefault true; efi.canTouchEfiVariables = true;
}; };
kernelPackages = lib.mkDefault pkgs.linuxPackages_latest;
kernelPackages = mkDashDefault pkgs.linuxPackages_latest;
initrd = { initrd = {
verbose = mkDashDefault false; verbose = false;
availableKernelModules = [ availableKernelModules = [
"nvme" "nvme"
"xhci_pci" "xhci_pci"
@ -59,98 +44,72 @@ in {
++ config.conf.bootParams; ++ config.conf.bootParams;
}; };
# Enable networking
networking = { networking = {
useDHCP = mkDashDefault true; useDHCP = lib.mkDefault true;
networkmanager.enable = mkDashDefault true; networkmanager.enable = true;
hostName = mkDashDefault hostName; hostName = hostName;
}; };
time = { # Set your time zone.
timeZone = mkDashDefault config.conf.timezone; time.timeZone = config.conf.timezone;
hardwareClockInLocalTime = mkDashDefault config.conf.systemLocalTime;
};
i18n.defaultLocale = mkDashDefault config.conf.locale; # Select internationalisation properties.
i18n.defaultLocale = config.conf.locale;
# Enable the X11 windowing system.
services = { services = {
lorri.enable = mkDashDefault true; lorri.enable = true;
xserver.enable = mkDashDefault true; flatpak.enable = true;
fstrim.enable = mkDashDefault true; xserver.enable = true;
pulseaudio.enable = mkDashDefault false; fstrim.enable = lib.mkDefault true;
# Enable sound with pipewire.
pulseaudio.enable = false;
pipewire = { pipewire = {
enable = mkDashDefault true; enable = true;
alsa = { alsa = {
enable = mkDashDefault true; enable = true;
support32Bit = mkDashDefault true; support32Bit = true;
}; };
jack.enable = mkDashDefault true; jack.enable = true;
pulse.enable = mkDashDefault true; pulse.enable = true;
}; };
}; };
nixpkgs.hostPlatform = mkDashDefault config.conf.system; nixpkgs.hostPlatform = lib.mkDefault config.conf.system;
nix = { nix = {
gc = { gc = {
automatic = mkDashDefault true; automatic = true;
dates = mkDashDefault "weekly"; dates = "weekly";
options = mkDashDefault "--delete-older-than 7d --delete-generations +5"; options = "--delete-older-than 7d --delete-generations +5";
}; };
settings = { settings = {
trusted-users = [username]; trusted-users = [username];
auto-optimise-store = mkDashDefault true; auto-optimise-store = true;
builders-use-substitutes = mkDashDefault true; experimental-features = "nix-command flakes";
trusted-substituters = [
"https://hyprland.cachix.org"
"https://anyrun.cachix.org"
"https://oxipaste.cachix.org"
"https://oxinoti.cachix.org"
"https://oxishut.cachix.org"
"https://oxidash.cachix.org"
"https://oxicalc.cachix.org"
"https://hyprdock.cachix.org"
"https://reset.cachix.org"
"https://dashvim.cachix.org"
];
trusted-public-keys = [
"hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="
"anyrun.cachix.org-1:pqBobmOjI7nKlsUMV25u9QHa9btJK65/C8vnO3p346s="
"oxipaste.cachix.org-1:n/oA3N3Z+LJP7eIWOwuoLd9QnPyZXqFjLgkahjsdDGc="
"oxinoti.cachix.org-1:dvSoJl2Pjo5HMaNngdBbSaixK9BSf2N8gzjP2MdGvfc="
"oxishut.cachix.org-1:axyAGF3XMh1IyMAW4UMbQCdMNovDH0KH6hqLLRJH8jU="
"oxidash.cachix.org-1:5K2FNHp7AS8VF7LmQkJAUG/dm6UHCz4ngshBVbjFX30="
"oxicalc.cachix.org-1:qF3krFc20tgSmtR/kt6Ku/T5QiG824z79qU5eRCSBTQ="
"hyprdock.cachix.org-1:HaROK3fBvFWIMHZau3Vq1TLwUoJE8yRbGLk0lEGzv3Y="
"reset.cachix.org-1:LfpnUUdG7QM/eOkN7NtA+3+4Ar/UBeYB+3WH+GjP9Xo="
"dashvim.cachix.org-1:uLRdxp1WOWHnsZZtu3SwUWZRsvC7SXo0Gyk3tIefuL0="
];
experimental-features = mkDashDefault "nix-command flakes pipe-operators";
}; };
}; };
hardware = { hardware = {
cpu.${config.conf.cpu}.updateMicrocode = cpu.${config.conf.cpu}.updateMicrocode =
mkDashDefault lib.mkDefault config.hardware.enableRedistributableFirmware;
config.hardware.enableRedistributableFirmware;
}; };
security.rtkit.enable = mkDashDefault true; security.rtkit.enable = true;
environment.variables = { environment.variables = {
XDG_CACHE_HOME = mkDashDefault "$HOME/.cache"; XDG_CACHE_HOME = "$HOME/.cache";
DIRENV_LOG_FORMAT = mkDashDefault ""; DIRENV_LOG_FORMAT = "";
QT_QPA_PLATFORMTHEME = mkDashDefault "qt5ct"; QT_QPA_PLATFORMTHEME = "qt5ct";
}; };
# allows user change later on # allows user change later on
users = { users = {
mutableUsers = mkDashDefault true; mutableUsers = true;
users.${username} = { users.${username} = {
isNormalUser = mkDashDefault true; isNormalUser = true;
description = mkDashDefault username; description = username;
extraGroups = [ extraGroups = [
"networkmanager" "networkmanager"
"wheel" "wheel"
@ -159,8 +118,6 @@ in {
"vboxusers" "vboxusers"
"video" "video"
"audio" "audio"
"scanner"
"lp"
]; ];
packages = with pkgs; [ packages = with pkgs; [
home-manager home-manager
@ -168,7 +125,7 @@ in {
]; ];
# this password will only last for the first login # this password will only last for the first login
# e.g. login, then change to whatever else, this also ensures no public hash is available # e.g. login, then change to whatever else, this also ensures no public hash is available
password = mkDashDefault "firstlogin"; password = "firstlogin";
}; };
}; };
} }

View file

@ -1,24 +1,21 @@
{ {
mkDashDefault,
pkgs, pkgs,
config, config,
lib,
... ...
}: { }: {
environment = { environment = {
variables = { variables = {
GSETTINGS_SCHEMA_DIR = mkDashDefault "${pkgs.glib.getSchemaPath pkgs.gsettings-desktop-schemas}"; GSETTINGS_SCHEMA_DIR = "${pkgs.glib.getSchemaPath pkgs.gsettings-desktop-schemas}";
NEOVIDE_MAXIMIZED = mkDashDefault "0"; NEOVIDE_MAXIMIZED = "0";
GPG_TTY = mkDashDefault "$(tty)"; GPG_TTY = "$(tty)";
EDITOR = mkDashDefault "neovide --no-fork"; EDITOR = "neovide --no-fork";
SUDO_EDITOR = mkDashDefault "neovide --no-fork"; SUDO_EDITOR = "neovide --no-fork";
SCRIPTS = mkDashDefault "$HOME/.config/scripts"; SCRIPTS = "$HOME/.config/scripts";
}; };
sessionVariables = { sessionVariables = {
NIXOS_OZONE_WL = mkDashDefault "1"; NIXOS_OZONE_WL = "1";
GOPATH = mkDashDefault "$HOME/.go"; GOPATH = "$HOME/.go";
FLAKE = mkDashDefault config.conf.nixosConfigPath; FLAKE = config.conf.nixosConfigPath;
NH_FLAKE = mkDashDefault config.conf.nixosConfigPath;
}; };
}; };
} }

View file

@ -1,10 +1,6 @@
{ {pkgs, ...}: let
mkDashDefault, layout = pkgs.writeText "dashie" ''
pkgs, xkb_symbols "dashie"
...
}: let
layout = pkgs.writeText "enIntUmlaut" ''
xkb_symbols "enIntUmlaut"
{ {
include "us(basic)" include "us(basic)"
include "level3(ralt_switch)" include "level3(ralt_switch)"
@ -14,8 +10,8 @@
}; };
''; '';
in { in {
environment.systemPackages = mkDashDefault [pkgs.xorg.xkbcomp]; environment.systemPackages = [pkgs.xorg.xkbcomp];
services.xserver.xkb.extraLayouts.enIntUmlaut = { services.xserver.xkb.extraLayouts.dashie = {
description = "US layout with 'umlaut'"; description = "US layout with 'umlaut'";
languages = ["eng"]; languages = ["eng"];
symbolsFile = "${layout}"; symbolsFile = "${layout}";

View file

@ -1,7 +1,7 @@
# with friendly help by stylix: https://github.com/danth/stylix/blob/master/docs/default.nix # with friendly help by stylix: https://github.com/danth/stylix/blob/master/docs/default.nix
{ {
pkgs, pkgs,
buildSystems, build_systems,
lib, lib,
... ...
}: let }: let
@ -13,36 +13,16 @@
summaryAppend = name: '' summaryAppend = name: ''
echo "- [${name}](${name}.md)" >> src/SUMMARY.md echo "- [${name}](${name}.md)" >> src/SUMMARY.md
''; '';
system = (buildSystems {root = ../example/.;})."example".options; system = (build_systems {root = ../example/.;})."example".options;
makeOptionsDocPrograms = names: pkgs.nixosOptionsDoc {options = lib.attrByPath (lib.splitString "." names) null system.mods;}; makeOptionsDocPrograms = name: pkgs.nixosOptionsDoc {options = system.mods.${name};};
conf = makeOptionsDoc system.conf; conf = makeOptionsDoc system.conf;
basePath = ../modules/programs; paths = builtins.readDir ../modules/programs;
pathToAttrs = path: names = lib.lists.remove "default" (
lib.attrsets.mapAttrsToList ( map (name: lib.strings.removeSuffix ".nix" name) (lib.attrsets.mapAttrsToList (name: _: name) paths)
name: meta: {
inherit name;
inherit meta;
}
)
(builtins.readDir path);
pathToStrings = path: prefix: let
mapFn = attrs:
if attrs.meta == "directory"
then pathToStrings "${basePath}/${attrs.name}" attrs.name
else if prefix != ""
then "${prefix}.${attrs.name}"
else attrs.name;
in
map
mapFn
(pathToAttrs path);
filteredNames = builtins.filter (names: !(lib.strings.hasInfix "default" names)) (
map (name: lib.strings.removeSuffix ".nix" name) (lib.lists.flatten (pathToStrings basePath ""))
); );
deduplicatedNames = map (name: lib.strings.splitString "." name |> lib.lists.unique |> lib.strings.concatStringsSep ".") filteredNames; mods = map makeOptionsDocPrograms names;
mods = map makeOptionsDocPrograms deduplicatedNames; docs = lib.strings.concatLines (map generateDocs (lib.lists.zipLists names mods));
docs = lib.strings.concatLines (map generateDocs (lib.lists.zipLists deduplicatedNames mods)); summary = lib.strings.concatStringsSep " " (map summaryAppend names);
summary = lib.strings.concatStringsSep " " (map summaryAppend deduplicatedNames);
in in
pkgs.stdenvNoCC.mkDerivation { pkgs.stdenvNoCC.mkDerivation {
name = "dashNix-book"; name = "dashNix-book";

View file

@ -1,10 +1,12 @@
<div align = center> <div align = center>
![Logo of DashNix](logo.svg) ![Logo of DashNix](logo.svg)
</div> </div>
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 HomeManger which can be enabled, disabled, configured or replaced at will.
# Usage # Usage
@ -12,7 +14,7 @@ This flake is intended to be used as an input to your own NixOS configuration:
```nix ```nix
dashNix = { dashNix = {
url = "github:Xetibo/DashNix"; url = "github:DashieTM/DashNix";
inputs = { inputs = {
# ensure these are here to update the packages on your own # ensure these are here to update the packages on your own
nixpkgs.follows = "nixpkgs"; nixpkgs.follows = "nixpkgs";
@ -23,42 +25,8 @@ dashNix = {
You can then configure your systems in your flake outputs with a provided library command: You can then configure your systems in your flake outputs with a provided library command:
Please note that overriding inputs will invalidate the cache configuration, this means you will have to add this manually:
```nix ```nix
builders-use-substitutes = true; nixosConfigurations = inputs.dashNix.dashNixLib.build_systems { root = ./.; };
extra-substituters = [
"https://hyprland.cachix.org"
"https://anyrun.cachix.org"
"https://cache.garnix.io"
"https://oxipaste.cachix.org"
"https://oxinoti.cachix.org"
"https://oxishut.cachix.org"
"https://oxidash.cachix.org"
"https://oxicalc.cachix.org"
"https://hyprdock.cachix.org"
"https://reset.cachix.org"
"https://dashvim.cachix.org"
];
extra-trusted-public-keys = [
"hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="
"anyrun.cachix.org-1:pqBobmOjI7nKlsUMV25u9QHa9btJK65/C8vnO3p346s="
"cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g="
"oxipaste.cachix.org-1:n/oA3N3Z+LJP7eIWOwuoLd9QnPyZXqFjLgkahjsdDGc="
"oxinoti.cachix.org-1:dvSoJl2Pjo5HMaNngdBbSaixK9BSf2N8gzjP2MdGvfc="
"oxishut.cachix.org-1:axyAGF3XMh1IyMAW4UMbQCdMNovDH0KH6hqLLRJH8jU="
"oxidash.cachix.org-1:5K2FNHp7AS8VF7LmQkJAUG/dm6UHCz4ngshBVbjFX30="
"oxicalc.cachix.org-1:qF3krFc20tgSmtR/kt6Ku/T5QiG824z79qU5eRCSBTQ="
"hyprdock.cachix.org-1:HaROK3fBvFWIMHZau3Vq1TLwUoJE8yRbGLk0lEGzv3Y="
"reset.cachix.org-1:LfpnUUdG7QM/eOkN7NtA+3+4Ar/UBeYB+3WH+GjP9Xo="
"dashvim.cachix.org-1:uLRdxp1WOWHnsZZtu3SwUWZRsvC7SXo0Gyk3tIefuL0="
];
```
```nix
nixosConfigurations = inputs.dashNix.dashNixLib.buildSystems { root = ./.; };
``` ```
This command will build each system that is placed within the hosts/ directory. This command will build each system that is placed within the hosts/ directory.
@ -89,71 +57,69 @@ 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 = {
# TODO your username # change this to your monitor and your pc name
# should be something like DP-1
defaultMonitor = "YOURMONITOR";
# width x height @ refreshrate
defaultMonitorMode = "1920x1080@60";
# scale for your main monitor
defaultMonitorScale = "1";
# your username
username = "YOURNAME"; username = "YOURNAME";
# TODO only needed when you use intel -> amd is default # TODO only needed when you use intel -> amd is default
# cpu = "intel"; # cpu = "intel";
# TODO your xkb layout
locale = "something.UTF-8"; locale = "something.UTF-8";
# TODO your timezone
timezone = "CONTINENT/CITY"; timezone = "CONTINENT/CITY";
}; };
# modules # modules
mods = { mods = {
# default disk config has root home boot and swap partition, overwrite if you want something different # default disk config has root home boot and swap partition, overwrite if you want something different
drives = {
# default assumes ROOT, BOOT, HOME and SWAP labaled drives exist
# for an example without HOME see below
# defaultDrives.enable = false;
# extraDrives = [
# {
# name = "boot";
# drive = {
# device = "/dev/disk/by-label/BOOT";
# fsType = "vfat";
# options = [ "rw" "fmask=0022" "dmask=0022" "noatime" ];
# };
# }
# {
# name = "";
# drive = {
# device = "/dev/disk/by-label/ROOT";
# fsType = "ext4";
# options = [ "noatime" "nodiratime" "discard" ];
# };
# }
# ];
};
sops.enable = false; sops.enable = false;
nextcloud.enable = false; nextcloud.enable = false;
wm.monitors = [ # default hyprland monitor config -> uncomment when necessary
# Example # TODO: Add more monitors when needed
# { # hyprland.monitor = [
# name = "DP-1"; # # default
# resolutionX = 3440; # "${config.conf.defaultMonitor},${config.conf.defaultMonitorMode},0x0,${config.conf.defaultMonitorScale}"
# resolutionY = 1440; # # second example monitor
# refreshrate = 180; # "DP-2,3440x1440@180,auto,1"
# positionX = 2560; # # all others
# positionY = 0; # ",highrr,auto,1"
# scale = 1; # ];
# transform = "0"; # or amd, whatever you have
# vrr = false;
# }
];
gpu.nvidia.enable = true; gpu.nvidia.enable = true;
kdeConnect.enable = true; kde_connect.enable = true;
# login manager: # login manager:
# default is greetd # default is greetd
# greetd = { }; # greetd = { };
# sddm = { }; # sddm = { };
# gdm = { }; # gdm = { };
drives = {
# default assumes ROOT, BOOT, HOME and SWAP labaled drives exist
# for an example without HOME see below
# defaultDrives.enable = false;
# extraDrives = [
# {
# name = "boot";
# drive = {
# device = "/dev/disk/by-label/BOOT";
# fsType = "vfat";
# options = [ "rw" "fmask=0022" "dmask=0022" "noatime" ];
# };
# }
# {
# name = "";
# drive = {
# device = "/dev/disk/by-label/ROOT";
# fsType = "ext4";
# options = [ "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.
};
}; };
} }
``` ```
@ -162,120 +128,73 @@ Here is a minimal required configuration.nix (the TODOs mention a required chang
After logging in the first time, your password will be set to "firstlogin", please change this to whatever you like. After logging in the first time, your password will be set to "firstlogin", please change this to whatever you like.
## Configuring pkgs ## Nixos and Home-manager Modules
While DashNix offers a default pkgs config, you may want to permit an unsecure packages, You can add additional modules or remove all of them by overriding parameters to the build_systems command:
add additional modules/inputs, or add an overlay to them.
You can configure both stable and unstable pkgs the following way:
Please note that modules and inputs are merged together to ensure functionality.
```nix ```nix
currentSystem = "x86_64-linux"; nixosConfigurations =
permittedPackages = [ let
"some package" additionalMods = {
]; nixos = [
config = { # your modules
system = currentSystem; ]; home = [
config = { # your modules
allowUnfree = true; ];
permittedInsecurePackages = permittedPackages; }
}; # passing this parameter will override the existing modules
inputs = { mods = {
# Some inputs nixos = [];
} home = [];
mods = { }
home = [ in
# Some home manager module inputs.dashNix.dashNixLib.build_systems { root = ./.; inherit mods additionalMods; };
];
nixos = [
# Some nixos module
];
}
};
unstableBundle = {
pkgs = inputs.unstable;
inherit config mods;
};
inputs.dashNix.dashNixLib.buildSystems {
root = ./.;
inherit unstableBundle;
}
``` ```
With this you could also change your input to something different should you wish to do so. ## Additional Inputs
Note that overriding inputs via the flake still works,
this way however ensures you can also configure the inputs. Just like modules, you can add additional inputs to your configuration.
```nix
nixosConfigurations =
let
additionalInputs = {
something.url = "yoururl"
}
in
inputs.dashNix.dashNixLib.build_systems { root = ./.; inherit additionalInputs; };
```
## Stable/Unstable ## Stable/Unstable
Sometimes you want to differentiate between systems that are stable and unstable, e.g. for servers and desktops/laptops. Sometimes you want to differentiate between systems that are stable and unstable, e.g. for servers and desktops/laptops.
This can be done with the overridePkgs flag for the lib function: This can be done with the overridePkgs flag for the lib function:
(overridePkgs simply inverts the default bundle that is used for the nix standard library as well as NixOS itself)
```nix ```nix
nixosConfigurations = nixosConfigurations =
inputs.dashNix.dashNixLib.buildSystems { inputs.dashNix.dashNixLib.build_systems {
root = ./stable; root = ./stable;
inherit stableBundle; inherit additionalInputs;
overridePkgs = true; overridePkgs = true;
} }
// inputs.dashNix.dashNixLib.buildSystems { // inputs.dashNix.dashNixLib.build_systems {
inherit unstableBundle; root = ./unstable;
root = ./unstable; inherit additionalInputs;
}; };
``` ```
You can now place your systems in the respective directories. You can now place your systems in the respective directories.
Keep in mind that the hosts directory will still need to exist in each variant. Keep in mind that the hosts directory will still need to exist in each variant.
E.g. stable/hosts/yourserver and unstable/hosts/yourdesktop E.g. stable/hosts/yourserver and unstable/hosts/yourdesktop
# Installation via ISO # Installation
You can find a custom ISO in the releases: [Link](https://github.com/Xetibo/DashNix/releases). You can find a custom ISO on my NextCloud server: [Link](https://cloud.dashie.org/s/z7G3zS9SXeEt2ERD).
With this, you will receive the example config in /iso/example alongside the gnome desktop environment, With this, you will receive the example config in /iso/example alongside the gnome desktop environment,
as well as a few tools like gnome-disks, Neovim, Vscodium, a browser etc. as well as a few tools like gnome-disks, neovim, vscodium, a browser etc.
Alternatively, you can use whatever NixOS installer and just install your config from there, just make sure to set the drive configuration before. Alternatively, you can use whatever NixOS installer and just install your config from there, just make sure to set the drive configuration before.
## Commands
First, copy the read-only config from /iso/example-config to a location of your choice.
```sh
cp /iso/example-config ~/config -r
```
Then configure as you please and choose a command below depending on your disk installation variant.
Installation via manual configuration:
```sh
sudo nixos-install --flake <flakelocation>#<hostname> --root <mountpoint> --option experimental-features "nix-command flakes pipe-operators"
#example
#nixos-install --flake ~/config#globi --root /mnt --option experimental-features "nix-command flakes pipe-operators"
```
Installation via disko:
```sh
sudo disko-install --flake <flakelocation>#<hostname> --disk <disk-name> <disk-device> --option experimental-features "nix-command flakes pipe-operators"
#example
#disko-install -- --flake ~/config#globi --disk main /dev/nvme0n1 --option experimental-features "nix-command flakes pipe-operators"
```
# Installation via flake
If you already have nix installed, you can instead just copy the default config onto your system and install DashNix with it.
To create the example config for a base to start with, you can just run this flake with the mkFlake command:
```sh
nix run github:Xetibo/DashNix#mkFlake
```
This command will put the default configuration into $HOME/gits/nixos
# Modules # Modules
This configuration features several modules that can be used as preconfigured "recipies". This configuration features several modules that can be used as preconfigured "recipies".
@ -283,7 +202,6 @@ These modules attempt to combine the home-manager and nixos packages/options to
For package lists, please check the individual modules, as the lists can be long. For package lists, please check the individual modules, as the lists can be long.
- Hyprland: Installs and configures Hyprland with various additional packages - Hyprland: Installs and configures Hyprland with various additional packages
- Niri: Installs and configures Niri with various additional packages
- acpid : Enables the acpid daemon - acpid : Enables the acpid daemon
- base packages : A list of system packages to be installed by default - base packages : A list of system packages to be installed by default
- bluetooth : Configures/enables bluetooth and installs tools for bluetooth - bluetooth : Configures/enables bluetooth and installs tools for bluetooth
@ -291,6 +209,7 @@ For package lists, please check the individual modules, as the lists can be long
- drives : A drive configuration module - drives : A drive configuration module
- firefox: Enables and configures firefox (extensions and settings) - firefox: Enables and configures firefox (extensions and settings)
- fish: Enables and configures fish shell - fish: Enables and configures fish shell
- flatpak : Installs and enables declarative flatpak
- gaming : Configures gaming related features (launchers, gamemode) - gaming : Configures gaming related features (launchers, gamemode)
- git : Git key and config module - git : Git key and config module
- gnome_services : Gnome services for minimal enviroments -> Window managers etc - gnome_services : Gnome services for minimal enviroments -> Window managers etc
@ -321,9 +240,6 @@ For package lists, please check the individual modules, as the lists can be long
# Credits # Credits
- [Fufexan](https://github.com/fufexan) for the xdg-mime config: - [Fufexan](https://github.com/fufexan) for the xdg-mime config:
- [Catppuccin](https://github.com/catppuccin) for base16 colors and zen-browser css - [Catppuccin](https://github.com/catppuccin) for base16 colors
- [Danth](https://github.com/danth) for providing a base for the nix docs - [Danth](https://github.com/danth) for providing a base for the nix docs
- [chermnyx](https://github.com/chermnyx) for providing a base for zen configuration
- [voronind-com](https://github.com/voronind-com) for providing the darkreader configuration
- [Nix-Artwork](https://github.com/NixOS/nixos-artwork/tree/master/logo) for the Nix/NixOS logo (Tim Cuthbertson (@timbertson)) - [Nix-Artwork](https://github.com/NixOS/nixos-artwork/tree/master/logo) for the Nix/NixOS logo (Tim Cuthbertson (@timbertson))
- [xddxdd](https://github.com/xddxdd) for the CachyOS-Kernel flake

View file

@ -2,19 +2,27 @@
description = "some dots"; description = "some dots";
inputs = { inputs = {
dashvim.url = "github:DashieTM/DashVim";
hyprland.url = "git+https://github.com/hyprwm/Hyprland?submodules=1";
ironbar.url = "github:JakeStanger/ironbar?ref=3a1c60442382f970cdb7669814b6ef3594d9f048";
anyrun.url = "github:Kirottu/anyrun";
nixpkgs.url = "github:NixOs/nixpkgs/nixos-unstable"; nixpkgs.url = "github:NixOs/nixpkgs/nixos-unstable";
stable.url = "github:NixOs/nixpkgs/nixos-24.05"; stable.url = "github:NixOs/nixpkgs/nixos-24.05";
dashNix = { dashNix = {
url = "github:Xetibo/DashNix"; url = "github:DashieTM/DashNix";
inputs = { inputs = {
nixpkgs.follows = "nixpkgs"; nixpkgs.follows = "nixpkgs";
stable.follows = "stable"; stable.follows = "stable";
dashvim.follows = "dashvim";
hyprland.follows = "hyprland";
ironbar.follows = "ironbar";
anyrun.follows = "anyrun";
}; };
}; };
}; };
outputs = inputs: { outputs = {...} @ inputs: {
nixosConfigurations = inputs.dashNix.dashNixLib.buildSystems {root = ./.;}; nixosConfigurations = inputs.dashNix.dashNixLib.build_systems {root = ./.;};
}; };
nixConfig = { nixConfig = {
@ -24,28 +32,12 @@
"https://hyprland.cachix.org" "https://hyprland.cachix.org"
"https://anyrun.cachix.org" "https://anyrun.cachix.org"
"https://cache.garnix.io" "https://cache.garnix.io"
"https://oxipaste.cachix.org"
"https://oxinoti.cachix.org"
"https://oxishut.cachix.org"
"https://oxidash.cachix.org"
"https://oxicalc.cachix.org"
"https://hyprdock.cachix.org"
"https://reset.cachix.org"
"https://dashvim.cachix.org"
]; ];
extra-trusted-public-keys = [ extra-trusted-public-keys = [
"hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc=" "hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="
"anyrun.cachix.org-1:pqBobmOjI7nKlsUMV25u9QHa9btJK65/C8vnO3p346s=" "anyrun.cachix.org-1:pqBobmOjI7nKlsUMV25u9QHa9btJK65/C8vnO3p346s="
"cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g=" "cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g="
"oxipaste.cachix.org-1:n/oA3N3Z+LJP7eIWOwuoLd9QnPyZXqFjLgkahjsdDGc="
"oxinoti.cachix.org-1:dvSoJl2Pjo5HMaNngdBbSaixK9BSf2N8gzjP2MdGvfc="
"oxishut.cachix.org-1:axyAGF3XMh1IyMAW4UMbQCdMNovDH0KH6hqLLRJH8jU="
"oxidash.cachix.org-1:5K2FNHp7AS8VF7LmQkJAUG/dm6UHCz4ngshBVbjFX30="
"oxicalc.cachix.org-1:qF3krFc20tgSmtR/kt6Ku/T5QiG824z79qU5eRCSBTQ="
"hyprdock.cachix.org-1:HaROK3fBvFWIMHZau3Vq1TLwUoJE8yRbGLk0lEGzv3Y="
"reset.cachix.org-1:LfpnUUdG7QM/eOkN7NtA+3+4Ar/UBeYB+3WH+GjP9Xo="
"dashvim.cachix.org-1:uLRdxp1WOWHnsZZtu3SwUWZRsvC7SXo0Gyk3tIefuL0="
]; ];
}; };
} }

View file

@ -1,37 +1,69 @@
{config, ...}: { {config, ...}: {
# TODO denote important changes
# variables for system # variables for system
# TODO important changes
conf = { conf = {
# TODO your username # change this to your monitor and your pc name
username = "exampleName"; # should be something like DP-1
defaultMonitor = "YOURMONITOR";
# width x height @ refreshrate
defaultMonitorMode = "1920x1080@60";
# scale for your main monitor
defaultMonitorScale = "1";
# your username
username = "YOURNAME";
# TODO only needed when you use intel -> amd is default # TODO only needed when you use intel -> amd is default
# cpu = "intel"; # cpu = "intel";
# TODO your xkb layout locale = "something.UTF-8";
locale = "en_US.UTF-8"; timezone = "CONTINENT/CITY";
# TODO your timezone
timezone = "Europe/Zurich";
}; };
# modules # modules
mods = { mods = {
# default disk config has root home boot and swap partition, overwrite if you want something different # default disk config has root home boot and swap partition, overwrite if you want something different
drives = {
# default assumes ROOT, BOOT, HOME and SWAP labaled drives exist
# for an example without HOME see below
#defaultDrives.enable = false;
#extraDrives = [
# {
# name = "boot";
# drive = {
# device = "/dev/disk/by-label/BOOT";
# fsType = "vfat";
# options = [
# "rw"
# "fmask=0022"
# "dmask=0022"
# "noatime"
# ];
# };
# }
# {
# name = "";
# drive = {
# device = "/dev/disk/by-label/ROOT";
# fsType = "ext4";
# options = [
# "noatime"
# "nodiratime"
# "discard"
# ];
# };
# }
#];
};
sops.enable = false; sops.enable = false;
nextcloud.enable = false; nextcloud.enable = false;
wm.monitors = [ # default hyprland monitor config -> uncomment when necessary
# Example # TODO: Add more monitors when needed
# { # hyprland.monitor = [
# name = "DP-1"; # # default
# resolutionX = 3440; # "${config.conf.defaultMonitor},${config.conf.defaultMonitorMode},0x0,${config.conf.defaultMonitorScale}"
# resolutionY = 1440; # # second example monitor
# refreshrate = 180; # "DP-2,3440x1440@180,auto,1"
# positionX = 2560; # # all others
# positionY = 0; # ",highrr,auto,1"
# scale = 1; # ];
# transform = "0"; # or amd, whatever you have
# vrr = false;
# }
];
gpu.nvidia.enable = true; gpu.nvidia.enable = true;
kdeConnect.enable = true; kdeConnect.enable = true;
# login manager: # login manager:
@ -39,30 +71,5 @@
# greetd = { }; # greetd = { };
# sddm = { }; # sddm = { };
# gdm = { }; # gdm = { };
drives = {
# default assumes ROOT, BOOT, HOME and SWAP labaled drives exist
# for an example without HOME see below
# defaultDrives.enable = false;
# extraDrives = [
# {
# name = "boot";
# drive = {
# device = "/dev/disk/by-label/BOOT";
# fsType = "vfat";
# options = [ "rw" "fmask=0022" "dmask=0022" "noatime" ];
# };
# }
# {
# name = "";
# drive = {
# device = "/dev/disk/by-label/ROOT";
# fsType = "ext4";
# options = [ "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.
};
}; };
} }

2585
flake.lock generated Normal file

File diff suppressed because it is too large Load diff

159
flake.nix
View file

@ -2,31 +2,31 @@
description = "DashNix"; description = "DashNix";
inputs = { inputs = {
unstable.url = "github:NixOs/nixpkgs/nixos-unstable"; nixpkgs.url = "github:NixOs/nixpkgs/nixos-unstable";
stable.url = "github:NixOs/nixpkgs/nixos-25.05"; stable.url = "github:NixOs/nixpkgs/nixos-24.11";
nixos-wsl.url = "github:nix-community/NixOS-WSL/main";
nur.url = "github:nix-community/NUR"; nur.url = "github:nix-community/NUR";
lanzaboote = {
url = "github:nix-community/lanzaboote/v0.4.2"; nix-flatpak = {
inputs.nixpkgs.follows = "unstable"; url = "github:gmodena/nix-flatpak";
}; };
statix.url = "github:oppiliappan/statix?ref=master";
# 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 = "nixpkgs";
}; };
cachy.url = "github:xddxdd/nix-cachyos-kernel?rev=bb7b8aa687464f24dcd452354d9621331d6b0737";
sops-nix.url = "github:Mic92/sops-nix"; sops-nix.url = "github:Mic92/sops-nix";
hyprland.url = "github:hyprwm/Hyprland"; Hyprspace = {
url = "github:KZDKM/Hyprspace";
inputs.hyprland.follows = "hyprland";
};
hyprland.url = "git+https://github.com/hyprwm/Hyprland?submodules=1";
ironbar = { ironbar = {
url = "github:JakeStanger/ironbar"; url = "github:JakeStanger/ironbar";
inputs.nixpkgs.follows = "unstable"; inputs.nixpkgs.follows = "nixpkgs";
}; };
zen-browser.url = "github:youwen5/zen-browser-flake"; zen-browser.url = "github:youwen5/zen-browser-flake";
@ -36,78 +36,119 @@
disko.url = "github:nix-community/disko/latest"; disko.url = "github:nix-community/disko/latest";
anyrun.url = "github:Kirottu/anyrun"; anyrun.url = "github:Kirottu/anyrun";
oxicalc.url = "github:Xetibo/OxiCalc"; oxicalc.url = "github:DashieTM/OxiCalc";
oxishut.url = "github:Xetibo/OxiShut"; oxishut.url = "github:DashieTM/OxiShut";
oxinoti.url = "github:Xetibo/OxiNoti"; oxinoti.url = "github:DashieTM/OxiNoti";
oxidash.url = "github:Xetibo/OxiDash"; oxidash.url = "github:DashieTM/OxiDash";
oxipaste.url = "github:Xetibo/OxiPaste"; oxipaste.url = "github:DashieTM/OxiPaste";
oxirun.url = "github:Xetibo/OxiRun"; hyprdock.url = "github:DashieTM/hyprdock";
dashvim.url = "github:Xetibo/DashVim";
hyprdock.url = "github:Xetibo/hyprdock";
reset.url = "github:Xetibo/ReSet"; reset.url = "github:Xetibo/ReSet";
reset-plugins.url = "github:Xetibo/ReSet-Plugins"; reset-plugins.url = "github:Xetibo/ReSet-Plugins";
superfreq.url = "github:NotAShelf/superfreq"; # absolute insanity
chaoticNyx.url = "github:chaotic-cx/nyx/nyxpkgs-unstable";
compose.url = "github:garnix-io/nixos-compose"; dashvim = {
url = "github:DashieTM/DashVim";
};
}; };
outputs = {self, ...} @ inputs: let outputs = {self, ...} @ inputs: let
currentSystem = "x86_64-linux"; currentSystem = "x86_64-linux";
permittedPackages = [ permittedPackages = [
"olm-3.2.16" "olm-3.2.16"
# well done dotnet...
# this is just for omnisharp
"dotnet-core-combined"
"dotnet-wrapped-combined"
"dotnet-combined"
"dotnet-sdk-6.0.428"
"dotnet-sdk-wrapped-6.0.428"
"dotnet-sdk-6.0.136"
"dotnet-sdk-wrapped-6.0.136"
"dotnet-sdk-7.0.120"
"dotnet-sdk-wrapped-7.0.120"
"dotnet-sdk-7.0.410"
"dotnet-sdk-wrapped-7.0.410"
"jitsi-meet-1.0.8043"
"nextcloud-27.1.11"
]; ];
importPkgsFn = import ./lib/importPkgs.nix; stable = import inputs.stable {
defaultConfigureFn = pkgs: system = currentSystem;
importPkgsFn { config = {
inherit inputs currentSystem permittedPackages pkgs; allowUnfree = true;
permittedInsecurePackages = permittedPackages;
}; };
stable = defaultConfigureFn inputs.stable; overlays = [
unstable = defaultConfigureFn inputs.unstable; inputs.nur.overlays.default
pkgsDarkreader = defaultConfigureFn inputs.pkgsDarkreader; inputs.chaoticNyx.overlays.default
];
};
pkgs = import inputs.nixpkgs {
system = currentSystem;
config = {
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 {
inherit inherit
self self
inputs inputs
unstable pkgs
permittedPackages stable
; ;
dashNixAdditionalProps = { lib = inputs.nixpkgs.lib;
inherit pkgsDarkreader;
};
system = currentSystem;
}; };
docs = import ./docs { docs = import ./docs {
inherit inputs; inherit inputs pkgs stable;
pkgs = unstable; lib = inputs.nixpkgs.lib;
system = currentSystem; build_systems = dashNixLib.build_systems;
inherit (inputs.unstable) lib;
inherit (dashNixLib) buildSystems;
}; };
lint = inputs.statix.packages.${currentSystem}.default;
format = unstable.alejandra;
dashNixInputs = inputs; dashNixInputs = inputs;
stablePkgs = stable; stablePkgs = stable;
unstablePkgs = unstable; unstablePkgs = pkgs;
modules = ./modules; modules = ./modules;
iso = dashNixLib.buildIso.config.system.build.isoImage; iso = dashNixLib.buildIso.config.system.build.isoImage;
nixosConfigurations = dashNixLib.buildSystems {root = ./example/.;}; };
mkFlake = stablePkgs.writeShellApplication { nixConfig = {
name = "Create example config"; builders-use-substitutes = true;
text =
/*
bash
*/
''
mkdir -p ~/gits/nixos
mkdir -p ~/gits/backup_nixos
mv ~/gits/nixos/* ~/gits/backup_nixos/ extra-substituters = [
cp -r ${./example}/* ~/gits/nixos/ "https://hyprland.cachix.org"
''; "https://anyrun.cachix.org"
}; "https://cache.garnix.io"
"https://oxipaste.cachix.org"
"https://oxinoti.cachix.org"
"https://oxishut.cachix.org"
"https://oxidash.cachix.org"
"https://oxicalc.cachix.org"
"https://hyprdock.cachix.org"
"https://reset.cachix.org"
"https://chaotic-nyx.cachix.org/"
];
extra-trusted-public-keys = [
"hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="
"anyrun.cachix.org-1:pqBobmOjI7nKlsUMV25u9QHa9btJK65/C8vnO3p346s="
"cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g="
"oxipaste.cachix.org-1:n/oA3N3Z+LJP7eIWOwuoLd9QnPyZXqFjLgkahjsdDGc="
"oxinoti.cachix.org-1:dvSoJl2Pjo5HMaNngdBbSaixK9BSf2N8gzjP2MdGvfc="
"oxishut.cachix.org-1:axyAGF3XMh1IyMAW4UMbQCdMNovDH0KH6hqLLRJH8jU="
"oxidash.cachix.org-1:5K2FNHp7AS8VF7LmQkJAUG/dm6UHCz4ngshBVbjFX30="
"oxicalc.cachix.org-1:qF3krFc20tgSmtR/kt6Ku/T5QiG824z79qU5eRCSBTQ="
"hyprdock.cachix.org-1:HaROK3fBvFWIMHZau3Vq1TLwUoJE8yRbGLk0lEGzv3Y="
"reset.cachix.org-1:LfpnUUdG7QM/eOkN7NtA+3+4Ar/UBeYB+3WH+GjP9Xo="
"chaotic-nyx.cachix.org-1:HfnXSw4pj95iI/n17rIDy40agHj12WfF+Gqk6SonIT8="
];
}; };
} }

View file

@ -1,37 +1,40 @@
{ {
mkDashDefault,
config, config,
lib, lib,
pkgs,
... ...
}: let }: let
username = config.conf.username; username = config.conf.username;
in { in {
manual = { manual = {
html.enable = mkDashDefault false; html.enable = false;
json.enable = mkDashDefault false; json.enable = false;
manpages.enable = mkDashDefault false; manpages.enable = false;
}; };
fonts.fontconfig.enable = mkDashDefault true; fonts.fontconfig.enable = true;
home = { home = {
username = mkDashDefault username; username = username;
homeDirectory = mkDashDefault "/home/${username}"; homeDirectory = "/home/${username}";
sessionPath = ["$HOME/.cargo/bin"]; sessionPath = ["$HOME/.cargo/bin"];
enableNixpkgsReleaseCheck = mkDashDefault false; enableNixpkgsReleaseCheck = false;
sessionVariables = { sessionVariables = {
GOROOT = mkDashDefault "$HOME/.go"; GOROOT = "$HOME/.go";
QT_QPA_PLATFORMTHEME = mkDashDefault "qt5ct"; QT_QPA_PLATFORMTHEME = "qt5ct";
}; };
keyboard = mkDashDefault null; keyboard = null;
file.".local/share/flatpak/overrides/global".text = ''
[Context]
filesystems=xdg-config/gtk-3.0;xdg-config/gtk-4.0
'';
}; };
programs.nix-index = { programs.nix-index = {
enable = mkDashDefault true; enable = true;
enableFishIntegration = mkDashDefault true; enableFishIntegration = true;
}; };
nix = { nix = {

View file

@ -1,66 +1,42 @@
{ {
mkDashDefault, additionalHomeConfig,
dashNixAdditionalProps, additionalHomeMods,
additionalInputs,
config, config,
homeMods, homeMods,
inputs, inputs,
lib, lib,
additionalHomeConfig,
mod, mod,
pkgs, pkgs,
root, root,
alternativePkgs, alternativePkgs,
system,
stable,
unstable,
... ...
}: { }: {
xdg = { xdg = {
portal.config.common = { portal.config.common.default = "*";
default = mkDashDefault "hyprland;gtk";
"org.freedesktop.impl.portal.FileChooser" = lib.mkIf (config.mods.media.filePickerPortal != "Default") "shana";
};
portal = { portal = {
enable = mkDashDefault true; enable = true;
extraPortals = with pkgs; [ extraPortals = [pkgs.xdg-desktop-portal-gtk];
xdg-desktop-portal-gtk # prob needed either way
(lib.mkIf (config.mods.media.filePickerPortal != "Default") xdg-desktop-portal-shana)
(lib.mkIf (config.mods.media.filePickerPortal == "Kde") kdePackages.xdg-desktop-portal-kde)
# Gnome uses their file manager, kinda cool tbh
(lib.mkIf (config.mods.media.filePickerPortal == "Gnome" && !config.mods.nautilus.enable) nautilus)
(lib.mkIf (config.mods.media.filePickerPortal == "Lxqt") xdg-desktop-portal-lxqt)
(lib.mkIf (config.mods.media.filePickerPortal == "Term") xdg-desktop-portal-termfilechooser)
];
}; };
}; };
home-manager = { home-manager = {
useGlobalPkgs = mkDashDefault true; useGlobalPkgs = true;
useUserPackages = mkDashDefault true; useUserPackages = true;
extraSpecialArgs = { extraSpecialArgs = {
inherit inherit inputs root additionalInputs alternativePkgs;
inputs
root
alternativePkgs
system
stable
unstable
dashNixAdditionalProps
;
mkDashDefault = import ../lib/override.nix {inherit lib;};
}; };
users.${config.conf.username} = { users.${config.conf.username} = {
disabledModules = ["programs/anyrun.nix"];
imports = imports =
[ [
./common.nix ./common.nix
./themes ./themes
./sync.nix ./sync.nix
../lib/foxwrappers.nix
] ]
++ homeMods ++ homeMods
++ lib.optional (builtins.pathExists additionalHomeConfig) additionalHomeConfig ++ additionalHomeMods
++ lib.optional (builtins.pathExists mod) mod; ++ lib.optional (builtins.pathExists mod) mod
++ lib.optional (builtins.pathExists additionalHomeConfig) additionalHomeConfig;
}; };
}; };
} }

View file

@ -15,40 +15,44 @@
in in
lib.mkIf config.mods.nextcloud.enable { lib.mkIf config.mods.nextcloud.enable {
systemd.user = { systemd.user = {
services = builtins.listToAttrs ( services = (
map (opts: { builtins.listToAttrs (
name = "${opts.name}"; map (opts: {
value = { name = "${opts.name}";
Unit = { value = {
Description = "Auto sync Nextcloud"; Unit = {
After = "network-online.target"; Description = "Auto sync Nextcloud";
After = "network-online.target";
};
Service = {
Type = "simple";
ExecStart = "${pkgs.bash}/bin/bash -c '${pkgs.nextcloud-client}/bin/nextcloudcmd -h --path ${opts.remote} ${opts.local} https://${username}:$(bat ${password})@${url}'";
TimeoutStopSec = "180";
KillMode = "process";
KillSignal = "SIGINT";
};
Install.WantedBy = ["multi-user.target"];
}; };
Service = { })
Type = "simple"; synclist
ExecStart = "${pkgs.bash}/bin/bash -c '${pkgs.nextcloud-client}/bin/nextcloudcmd -h --path ${opts.remote} ${opts.local} https://${username}:$(bat ${password})@${url}'"; )
TimeoutStopSec = "180";
KillMode = "process";
KillSignal = "SIGINT";
};
Install.WantedBy = ["multi-user.target"];
};
})
synclist
); );
timers = builtins.listToAttrs ( timers = (
map (opts: { builtins.listToAttrs (
name = "${opts.name}"; map (opts: {
value = { name = "${opts.name}";
Unit.Description = "Automatic sync files with Nextcloud when booted up after 1 minute then rerun every 60 minutes"; value = {
Timer.OnBootSec = "1min"; Unit.Description = "Automatic sync files with Nextcloud when booted up after 1 minute then rerun every 60 minutes";
Timer.OnUnitActiveSec = "60min"; Timer.OnBootSec = "1min";
Install.WantedBy = [ Timer.OnUnitActiveSec = "60min";
"multi-user.target" Install.WantedBy = [
"timers.target" "multi-user.target"
]; "timers.target"
}; ];
}) };
synclist })
synclist
)
); );
startServices = true; startServices = true;
}; };

View file

@ -3,6 +3,5 @@
./qt.nix ./qt.nix
./kdeglobals.nix ./kdeglobals.nix
./oxiced.nix ./oxiced.nix
./firefoxTheme.nix
]; ];
} }

View file

@ -1,327 +0,0 @@
# css from https://github.com/catppuccin/zen-browser/tree/main/themes
{
config,
inputs,
pkgs,
lib,
...
}: let
# at time of using this here, stylix might not be evaluated yet
# hence ensure it is by using base16 mkSchemeAttrs
base16 = pkgs.callPackage inputs.base16.lib {};
scheme = base16.mkSchemeAttrs config.stylix.base16Scheme;
userChrome =
/*
css
*/
''
/* Catppuccin Mocha Blue userContent.css*/
@media (prefers-color-scheme: dark) {
/* Common variables affecting all pages */
@-moz-document url-prefix("about:") {
:root {
--in-content-page-color: #${scheme.base05} !important;
--color-accent-primary: #${scheme.base0D} !important;
--color-accent-primary-hover: rgb(163, 197, 251) !important; // TODO
--color-accent-primary-active: rgb(138, 153, 250) !important; // TODO
background-color: #${scheme.base00} !important;
--in-content-page-background: #${scheme.base00} !important;
}
}
/* Variables and styles specific to about:newtab and about:home */
@-moz-document url("about:newtab"), url("about:home") {
:root {
--newtab-background-color: #${scheme.base00} !important;
--newtab-background-color-secondary: #${scheme.base02} !important;
--newtab-element-hover-color: #${scheme.base02} !important;
--newtab-text-primary-color: #${scheme.base05} !important;
--newtab-wordmark-color: #${scheme.base05} !important;
--newtab-primary-action-background: #${scheme.base0D} !important;
}
.icon {
color: #${scheme.base0D} !important;
}
.search-wrapper .logo-and-wordmark .logo {
//background: url("zen-logo-mocha.svg"), url("https://raw.githubusercontent.com/IAmJafeth/zen-browser/main/themes/Mocha/Blue/zen-logo-mocha.svg") no-repeat center !important; // TODO
display: inline-block !important;
height: 82px !important;
width: 82px !important;
background-size: 82px !important;
}
@media (max-width: 609px) {
.search-wrapper .logo-and-wordmark .logo {
background-size: 64px !important;
height: 64px !important;
width: 64px !important;
}
}
.card-outer:is(:hover, :focus, .active):not(.placeholder) .card-title {
color: #${scheme.base0D} !important;
}
.top-site-outer .search-topsite {
background-color: #${scheme.base0D} !important;
}
.compact-cards .card-outer .card-context .card-context-icon.icon-download {
fill: #${scheme.base0B} !important;
}
}
/* Variables and styles specific to about:preferences */
@-moz-document url-prefix("about:preferences") {
:root {
--zen-colors-tertiary: #${scheme.base01} !important;
--in-content-text-color: #${scheme.base05} !important;
--link-color: #${scheme.base0D} !important;
--link-color-hover: rgb(163, 197, 251) !important; // TODO
--zen-colors-primary: #${scheme.base02} !important;
--in-content-box-background: #${scheme.base02} !important;
--zen-primary-color: #${scheme.base0D} !important;
}
groupbox , moz-card{
background: #${scheme.base00} !important;
}
button,
groupbox menulist {
background: #${scheme.base02} !important;
color: #${scheme.base05} !important;
}
.main-content {
background-color: #${scheme.base01} !important;
}
.identity-color-blue {
--identity-tab-color: #8aadf4 !important; // TODO
--identity-icon-color: #8aadf4 !important; // TODO
}
.identity-color-turquoise {
--identity-tab-color: #8bd5ca !important; // TODO
--identity-icon-color: #8bd5ca !important; // TODO
}
.identity-color-green {
--identity-tab-color: #${scheme.base0B} !important;
--identity-icon-color: #${scheme.base0B} !important;
}
.identity-color-yellow {
--identity-tab-color: #eed49f !important; // TODO
--identity-icon-color: #eed49f !important; // TODO
}
.identity-color-orange {
--identity-tab-color: #f5a97f !important; // TODO
--identity-icon-color: #f5a97f !important; // TODO
}
.identity-color-red {
--identity-tab-color: #ed8796 !important; // TODO
--identity-icon-color: #ed8796 !important; // TODO
}
.identity-color-pink {
--identity-tab-color: #f5bde6 !important; // TODO
--identity-icon-color: #f5bde6 !important; // TODO
}
.identity-color-purple {
--identity-tab-color: #c6a0f6 !important; // TODO
--identity-icon-color: #c6a0f6 !important; // TODO
}
}
/* Variables and styles specific to about:addons */
@-moz-document url-prefix("about:addons") {
:root {
--zen-dark-color-mix-base: #${scheme.base01} !important;
--background-color-box: #${scheme.base00} !important;
}
}
/* Variables and styles specific to about:protections */
@-moz-document url-prefix("about:protections") {
:root {
--zen-primary-color: #${scheme.base00} !important;
--social-color: #${scheme.base0E} !important;
--coockie-color: #${scheme.base08} !important;
--fingerprinter-color: #${scheme.base0A} !important;
--cryptominer-color: #${scheme.base07} !important;
--tracker-color: #${scheme.base0B} !important;
--in-content-primary-button-background-hover: rgb(81, 83, 05) !important;
--in-content-primary-button-text-color-hover: #${scheme.base05} !important;
--in-content-primary-button-background: #${scheme.base03} !important;
--in-content-primary-button-text-color: #${scheme.base05} !important;
}
.card {
background-color: #${scheme.base02} !important;
}
}
}
'';
userContent =
/*
css
*/
''
/* Catppuccin Mocha Blue userChrome.css*/
@media (prefers-color-scheme: dark) {
:root {
--zen-colors-primary: #${scheme.base02} !important;
--zen-primary-color: #${scheme.base0D} !important;
--zen-colors-secondary: #${scheme.base02} !important;
--zen-colors-tertiary: #${scheme.base01} !important;
--zen-colors-border: #${scheme.base0D} !important;
--toolbarbutton-icon-fill: #${scheme.base0D} !important;
--lwt-text-color: #${scheme.base05} !important;
--toolbar-field-color: #${scheme.base05} !important;
--tab-selected-textcolor: rgb(171, 197, 247) !important; // TODO
--toolbar-field-focus-color: #${scheme.base05} !important;
--toolbar-color: #${scheme.base05} !important;
--newtab-text-primary-color: #${scheme.base05} !important;
--arrowpanel-color: #${scheme.base05} !important;
--arrowpanel-background: #${scheme.base00} !important;
--sidebar-text-color: #${scheme.base05} !important;
--lwt-sidebar-text-color: #${scheme.base05} !important;
--lwt-sidebar-background-color: #${scheme.base01} !important; //TODO 11111b !important;
--toolbar-bgcolor: #${scheme.base02} !important;
--newtab-background-color: #${scheme.base00} !important;
--zen-themed-toolbar-bg: #${scheme.base01} !important;
--zen-main-browser-background: #${scheme.base01} !important;
}
#permissions-granted-icon{
color: #${scheme.base01} !important;
}
.sidebar-placesTree {
background-color: #${scheme.base00} !important;
}
#zen-workspaces-button {
background-color: #${scheme.base00} !important;
}
#TabsToolbar {
background-color: #${scheme.base01} !important;
}
#urlbar-background {
background-color: #${scheme.base00} !important;
}
.content-shortcuts {
background-color: #${scheme.base00} !important;
border-color: #${scheme.base0D} !important;
}
.urlbarView-url {
color: #${scheme.base0D} !important;
}
#zenEditBookmarkPanelFaviconContainer {
background: #${scheme.base01} !important;
}
toolbar .toolbarbutton-1 {
&:not([disabled]) {
&:is([open], [checked]) > :is(.toolbarbutton-icon, .toolbarbutton-text, .toolbarbutton-badge-stack){
fill: #${scheme.base01};
}
}
}
.identity-color-blue {
--identity-tab-color: #${scheme.base0D} !important;
--identity-icon-color: #${scheme.base0D} !important;
}
.identity-color-turquoise {
--identity-tab-color: #${scheme.base0C} !important;
--identity-icon-color: #${scheme.base0C} !important;
}
.identity-color-green {
--identity-tab-color: #${scheme.base0B} !important;
--identity-icon-color: #${scheme.base0B} !important;
}
.identity-color-yellow {
--identity-tab-color: #${scheme.base0A} !important;
--identity-icon-color: #${scheme.base0A} !important;
}
.identity-color-orange {
--identity-tab-color: #${scheme.base09} !important;
--identity-icon-color: #${scheme.base09} !important;
}
.identity-color-red {
--identity-tab-color: #${scheme.base08} !important;
--identity-icon-color: #${scheme.base08} !important;
}
.identity-color-pink {
--identity-tab-color: #${scheme.base0F} !important;
--identity-icon-color: #${scheme.base0F} !important; // TODO f5c2e7
}
.identity-color-purple {
--identity-tab-color: #${scheme.base0E} !important;
--identity-icon-color: #${scheme.base0E} !important;
}
}
'';
browsername = config.mods.homePackages.browser;
profiles =
if config.mods.homePackages.browser == "firefox"
then config.mods.browser.firefox.profiles
else if config.mods.homePackages.browser == "zen"
then config.mods.browser.zen.profiles
else if config.mods.homePackages.browser == "librewolf"
then [
{
name = "default";
value = {};
}
]
else [];
profileNamesFn =
builtins.catAttrs "name";
chromesFn = builtins.map (
name:
if (builtins.isString browsername)
then {
".${browsername}/${name}/chrome/userContent.css" = {
text = userChrome;
};
".${browsername}/${name}/chrome/userChrome.css" = {
text = userContent;
};
}
else {}
);
moduleFn = lib.lists.foldr (attr1: attr2: attr1 // attr2) {};
mkFirefoxTheme = profiles:
profiles
|> profileNamesFn
|> chromesFn
|> moduleFn;
in {home.file = mkFirefoxTheme profiles;}

View file

@ -8,73 +8,20 @@
# hence ensure it is by using base16 mkSchemeAttrs # hence ensure it is by using base16 mkSchemeAttrs
base16 = pkgs.callPackage inputs.base16.lib {}; base16 = pkgs.callPackage inputs.base16.lib {};
scheme = base16.mkSchemeAttrs config.stylix.base16Scheme; scheme = base16.mkSchemeAttrs config.stylix.base16Scheme;
valueOrDefault = value: fallback:
if (scheme ? oxiced && scheme.oxiced ? ${value})
then scheme.oxiced.value
else fallback;
in { in {
xdg.configFile."oxiced/theme.toml" = { xdg.configFile."oxiced/theme.toml" = {
source = (pkgs.formats.toml {}).generate "oxiced" { source = (pkgs.formats.toml {}).generate "oxiced" {
base = valueOrDefault "base" scheme.base00;
mantle = valueOrDefault "mantle" scheme.base01;
primary_bg = valueOrDefault "primary_bg" scheme.base02;
secondary_bg = valueOrDefault "secondary_bg" scheme.base03;
tertiary_bg = valueOrDefault "tertiary_bg" scheme.base04;
text = valueOrDefault "text" scheme.base05;
primary = valueOrDefault "primary" scheme.base0D;
primary_contrast = valueOrDefault "primary_contrast" "FFFFFF";
secondary = valueOrDefault "primary" scheme.base07;
secondary_contrast = valueOrDefault "secondary_contrast" "FFFFFF";
good = valueOrDefault "good" scheme.base0B;
good_contrast = valueOrDefault "good_contrast" "000000";
bad = valueOrDefault "bad" scheme.base08;
bad_contrast = valueOrDefault "bad_contrast" "FFFFFF";
warning = valueOrDefault "warning" scheme.base0A;
warning_contrast = valueOrDefault "warning_contrast" "000000";
info = valueOrDefault "info" scheme.base0C;
info_contrast = valueOrDefault "info_contrast" "FFFFFF";
rose = valueOrDefault "rose" scheme.base06;
lavender = valueOrDefault "lavender" scheme.base07;
blue = valueOrDefault "blue" scheme.base0D;
mauve = valueOrDefault "mauve" scheme.base0E;
flamingo = valueOrDefault "flamingo" scheme.base0F;
border_color_weak = valueOrDefault "border_color_weak" scheme.base05;
border_color_strong = valueOrDefault "border_color_strong" scheme.base0D;
tint_amount = valueOrDefault "tint_amound" 0.10;
shade_amount = valueOrDefault "shade_amount" 0.05;
border_radius = valueOrDefault "border_radius" 10;
padding_xs = valueOrDefault "padding_xs" 4.0;
padding_sm = valueOrDefault "padding_sm" 8.0;
padding_md = valueOrDefault "padding_md" 12.0;
padding_lg = valueOrDefault "padding_lg" 16.0;
padding_xl = valueOrDefault "padding_xl" 24.0;
padding_xxl = valueOrDefault "padding_xxl" 32.0;
font_sm = valueOrDefault "font_sm" 10.0;
font_md = valueOrDefault "font_md" 14.0;
font_lg = valueOrDefault "font_lg" 18.0;
font_xl = valueOrDefault "font_xl" 24.0;
font_xxl = valueOrDefault "font_xxl" 32.0;
# legacy compatibility
name = scheme.scheme; name = scheme.scheme;
inherit (scheme) base00; base00 = scheme.base00;
inherit (scheme) base01; base01 = scheme.base01;
inherit (scheme) base02; base02 = scheme.base02;
inherit (scheme) base03; base03 = scheme.base03;
inherit (scheme) base04; base04 = scheme.base04;
inherit (scheme) base05; base05 = scheme.base05;
inherit (scheme) base06; base06 = scheme.base06;
inherit (scheme) base07; base07 = scheme.base07;
inherit (scheme) base08; base08 = scheme.base08;
inherit (scheme) base09; base09 = scheme.base09;
base0a = scheme.base0A; base0a = scheme.base0A;
base0b = scheme.base0B; base0b = scheme.base0B;
base0c = scheme.base0C; base0c = scheme.base0C;

View file

@ -31,94 +31,92 @@
} }
''; '';
in { in {
xdg.configFile."qt5ct/colors/tokyonight.conf" = {
text = "${color}";
};
xdg.configFile."qt6ct/colors/tokyonight.conf" = {
text = "${color}";
};
xdg.configFile."qt5ct/qss/tab.qss" = {
text = "${qss}";
};
stylix.targets.qt = { stylix.targets.qt = {
enable = false; enable = false;
}; };
qt = { qt = {
enable = true; enable = true;
style.package = pkgs.kdePackages.breeze; style.package = pkgs.libsForQt5.breeze-qt5;
style.name = lib.mkForce "breeze-dark"; style.name = lib.mkForce "breeze-dark";
}; };
xdg.configFile = { xdg.configFile."qt5ct/qt5ct.conf" = {
"qt5ct/colors/tokyonight.conf" = { text = ''
text = "${color}";
};
"qt6ct/colors/tokyonight.conf" = {
text = "${color}";
};
"qt5ct/qss/tab.qss" = {
text = "${qss}";
};
"qt5ct/qt5ct.conf" = {
text = ''
[Appearance] [Appearance]
color_scheme_path=/home/${username}/.config/qt5ct/colors/tokyonight.conf color_scheme_path=/home/${username}/.config/qt5ct/colors/tokyonight.conf
custom_palette=true custom_palette=true
icon_theme=MoreWaita icon_theme=MoreWaita
standard_dialogs=xdgdesktopportal standard_dialogs=xdgdesktopportal
style=Breeze style=Breeze
[Fonts] [Fonts]
fixed="Noto Sans,12,-1,5,50,0,0,0,0,0" fixed="Noto Sans,12,-1,5,50,0,0,0,0,0"
general="Noto Sans,12,-1,5,50,0,0,0,0,0" general="Noto Sans,12,-1,5,50,0,0,0,0,0"
[Interface] [Interface]
activate_item_on_single_click=2 activate_item_on_single_click=2
buttonbox_layout=3 buttonbox_layout=3
cursor_flash_time=1000 cursor_flash_time=1000
dialog_buttons_have_icons=0 dialog_buttons_have_icons=0
double_click_interval=400 double_click_interval=400
gui_effects=General, AnimateMenu, AnimateCombo, AnimateTooltip, AnimateToolBox gui_effects=General, AnimateMenu, AnimateCombo, AnimateTooltip, AnimateToolBox
keyboard_scheme=4 keyboard_scheme=4
menus_have_icons=true menus_have_icons=true
show_shortcuts_in_context_menus=true show_shortcuts_in_context_menus=true
stylesheets=/home/${username}/.config/qt5ct/qss/tab.qss, /nix/store/5713p1pv913a6fsn8j7z6ndikcwikbcd-qt5ct-1.8/share/qt5ct/qss/fusion-fixes.qss, /nix/store/5713p1pv913a6fsn8j7z6ndikcwikbcd-qt5ct-1.8/share/qt5ct/qss/scrollbar-simple.qss, /nix/store/5713p1pv913a6fsn8j7z6ndikcwikbcd-qt5ct-1.8/share/qt5ct/qss/sliders-simple.qss, /nix/store/5713p1pv913a6fsn8j7z6ndikcwikbcd-qt5ct-1.8/share/qt5ct/qss/tooltip-simple.qss, /nix/store/5713p1pv913a6fsn8j7z6ndikcwikbcd-qt5ct-1.8/share/qt5ct/qss/traynotification-simple.qss stylesheets=/home/${username}/.config/qt5ct/qss/tab.qss, /nix/store/5713p1pv913a6fsn8j7z6ndikcwikbcd-qt5ct-1.8/share/qt5ct/qss/fusion-fixes.qss, /nix/store/5713p1pv913a6fsn8j7z6ndikcwikbcd-qt5ct-1.8/share/qt5ct/qss/scrollbar-simple.qss, /nix/store/5713p1pv913a6fsn8j7z6ndikcwikbcd-qt5ct-1.8/share/qt5ct/qss/sliders-simple.qss, /nix/store/5713p1pv913a6fsn8j7z6ndikcwikbcd-qt5ct-1.8/share/qt5ct/qss/tooltip-simple.qss, /nix/store/5713p1pv913a6fsn8j7z6ndikcwikbcd-qt5ct-1.8/share/qt5ct/qss/traynotification-simple.qss
toolbutton_style=4 toolbutton_style=4
underline_shortcut=0 underline_shortcut=0
wheel_scroll_lines=3 wheel_scroll_lines=3
[SettingsWindow] [SettingsWindow]
geometry=@ByteArray(\x1\xd9\xd0\xcb\0\x3\0\0\0\0\n\0\0\0\0\0\0\0\rK\0\0\x5q\0\0\n\0\0\0\0\0\0\0\r[\0\0\x5\x7f\0\0\0\0\x2\0\0\0\rp\0\0\n\0\0\0\0\0\0\0\rK\0\0\x5q) geometry=@ByteArray(\x1\xd9\xd0\xcb\0\x3\0\0\0\0\n\0\0\0\0\0\0\0\rK\0\0\x5q\0\0\n\0\0\0\0\0\0\0\r[\0\0\x5\x7f\0\0\0\0\x2\0\0\0\rp\0\0\n\0\0\0\0\0\0\0\rK\0\0\x5q)
[Troubleshooting] [Troubleshooting]
force_raster_widgets=1 force_raster_widgets=1
ignored_applications=@Invalid() ignored_applications=@Invalid()
''; '';
}; };
"qt6ct/qt6ct.conf" = { xdg.configFile."qt6ct/qt6ct.conf" = {
text = '' text = ''
[Appearance] [Appearance]
color_scheme_path=/home/${username}/.config/qt6ct/colors/tokyonight.conf color_scheme_path=/home/${username}/.config/qt6ct/colors/tokyonight.conf
custom_palette=true custom_palette=true
standard_dialogs=xdgdesktopportal standard_dialogs=xdgdesktopportal
style=Breeze style=Breeze
[Fonts] [Fonts]
fixed="DejaVu LGC Sans,12,-1,5,400,0,0,0,0,0,0,0,0,0,0,1" fixed="DejaVu LGC Sans,12,-1,5,400,0,0,0,0,0,0,0,0,0,0,1"
general="DejaVu LGC Sans,12,-1,5,400,0,0,0,0,0,0,0,0,0,0,1" general="DejaVu LGC Sans,12,-1,5,400,0,0,0,0,0,0,0,0,0,0,1"
[Interface] [Interface]
activate_item_on_single_click=2 activate_item_on_single_click=2
buttonbox_layout=3 buttonbox_layout=3
cursor_flash_time=1000 cursor_flash_time=1000
dialog_buttons_have_icons=0 dialog_buttons_have_icons=0
double_click_interval=400 double_click_interval=400
gui_effects=General, AnimateMenu, AnimateCombo, AnimateTooltip, AnimateToolBox gui_effects=General, AnimateMenu, AnimateCombo, AnimateTooltip, AnimateToolBox
keyboard_scheme=4 keyboard_scheme=4
menus_have_icons=true menus_have_icons=true
show_shortcuts_in_context_menus=true show_shortcuts_in_context_menus=true
stylesheets=@Invalid() stylesheets=@Invalid()
toolbutton_style=4 toolbutton_style=4
underline_shortcut=1 underline_shortcut=1
wheel_scroll_lines=3 wheel_scroll_lines=3
[Troubleshooting] [Troubleshooting]
force_raster_widgets=1 force_raster_widgets=1
ignored_applications=@Invalid() ignored_applications=@Invalid()
''; '';
};
}; };
} }

View file

@ -1,77 +1,53 @@
{ {
pkgs, pkgs,
modulesPath,
lib, lib,
modulesPath,
self, self,
inputs,
... ...
}: let }: {
system = "x86_64-linux"; imports = ["${modulesPath}/installer/cd-dvd/installation-cd-minimal.nix"];
in {
imports = ["${modulesPath}/installer/cd-dvd/iso-image.nix"];
nixpkgs.hostPlatform = { nixpkgs.hostPlatform = {
inherit system; system = "x86_64-linux";
}; };
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
inputs.dashvim.packages.${system}.minimal neovim
disko disko
git git
vesktop
vscodium
firefox firefox
kitty kitty
gnome-disk-utility gnome-disk-utility
inputs.disko.packages.${system}.disko-install
]; ];
networking = { networking = {
wireless.enable = false; wireless.enable = false;
networkmanager.enable = true; networkmanager.enable = true;
}; };
nix.settings.experimental-features = [ nix.settings.experimental-features = [
"nix-command" "nix-command"
"flakes" "flakes"
"pipe-operators"
]; ];
users.users.nixos = { # gnome is a good default that works with every gpu and doesn't require knowledge about custom keybinds.
isNormalUser = true;
password = "nixos";
extraGroups = ["wheel"];
};
image.baseName = lib.mkForce "DashNix";
programs = {
hyprland = {
enable = true;
withUWSM = true;
xwayland.enable = false;
};
uwsm.enable = true;
};
fonts.packages = [pkgs.adwaita-fonts];
i18n.defaultLocale = "en_US.UTF-8";
services = { services = {
xserver = {
enable = true;
displayManager = {
gdm.enable = true;
};
desktopManager = {
gnome.enable = true;
};
};
displayManager.autoLogin = { displayManager.autoLogin = {
enable = true; enable = true;
user = "nixos"; user = "nixos";
}; };
greetd = {
enable = true;
settings = {
terminal.vt = 1;
default_session = {
command = "${lib.getExe pkgs.hyprland}";
user = "nixos";
};
};
};
}; };
isoImage = { isoImage = {
isoName = lib.mkForce "DashNix.iso";
makeEfiBootable = true; makeEfiBootable = true;
makeUsbBootable = true; makeUsbBootable = true;
contents = [ contents = [
@ -81,6 +57,4 @@ in {
} }
]; ];
}; };
system.stateVersion = "25.11";
} }

View file

@ -1,191 +1,14 @@
{ {
inputs, inputs,
unstable, lib,
pkgs,
self, self,
system, stable,
permittedPackages,
dashNixAdditionalProps ? {},
... ...
}: let }: {
defaultConfig = {
config = {
allowUnfree = true;
permittedInsecurePackages = permittedPackages;
};
overlays = [
inputs.cachy.overlays.default
inputs.nur.overlays.default
];
inherit system;
};
mkPkgs = {
pkgs,
config,
}: let
overlays =
if (config ? overlays)
then config.overlays
else [];
comnbinedConfig = config // {overlays = overlays ++ defaultConfig.overlays;};
in
import pkgs comnbinedConfig;
in rec {
mkNixos = {
root,
inputLib,
lib,
stablePkgs,
unstablePkgs,
stableMods,
unstableMods,
overridePkgs,
...
}:
builtins.listToAttrs (
map
(name: {
inherit name;
value = let
mod = root + /hosts/${name}/configuration.nix;
additionalNixosConfig = root + /hosts/${name}/hardware.nix;
additionalHomeConfig = root + /hosts/${name}/home.nix;
args = {
inherit
self
inputs
mod
additionalHomeConfig
system
root
dashNixAdditionalProps
lib
;
stable = stablePkgs;
unstable = unstablePkgs;
pkgs = lib.mkForce (
if overridePkgs
then stablePkgs
else unstablePkgs
);
alternativePkgs =
if overridePkgs
then unstablePkgs
else stablePkgs;
hostName = name;
homeMods =
if overridePkgs
then unstableMods.home
else stableMods.home;
mkDashDefault = import ./override.nix {inherit lib;};
};
nixosMods =
if overridePkgs
then unstableMods.nixos
else stableMods.nixos;
in
inputLib.nixosSystem {
modules =
[
{_module.args = args;}
mod
]
++ nixosMods
++ lib.optional (builtins.pathExists additionalNixosConfig) additionalNixosConfig
++ lib.optional (builtins.pathExists mod) mod;
};
})
(
lib.lists.remove "" (
lib.attrsets.mapAttrsToList (name: fType:
if fType == "directory"
then name
else "") (
builtins.readDir (root + /hosts)
)
)
)
);
mkHome = {
root,
lib,
stablePkgs,
unstablePkgs,
stableMods,
unstableMods,
overridePkgs,
...
}:
builtins.listToAttrs (
map
(name: {
inherit name;
value = let
mod = root + /homes/${name}/configuration.nix;
additionalHomeConfig = root + /homes/${name}/home.nix;
args = {
inherit
self
inputs
mod
additionalHomeConfig
system
root
dashNixAdditionalProps
lib
;
stable = stablePkgs;
unstable = unstablePkgs;
pkgs = lib.mkForce (
if overridePkgs
then stablePkgs
else unstablePkgs
);
alternativePkgs =
if overridePkgs
then unstablePkgs
else stablePkgs;
userName = name;
mkDashDefault = import ./override.nix {inherit lib;};
};
homeMods =
if overridePkgs
then unstableMods.home
else stableMods.home;
in
inputs.home-manager.lib.homeManagerConfiguration
{
inherit (args) pkgs;
modules =
[
{_module.args = args;}
mod
]
++ homeMods
++ [
../home/common.nix
../home/themes
../home/sync.nix
./foxwrappers.nix
]
++ lib.optional (builtins.pathExists mod) mod;
};
})
(
lib.lists.remove "" (
lib.attrsets.mapAttrsToList (name: fType:
if fType == "directory"
then name
else "") (
builtins.readDir (root + /homes)
)
)
)
);
/* /*
* *
# buildSystems # build_systems
Builds system given a list of system names which are placed within your hosts/ directory. Note that each system has its own directory in hosts/ as well. Builds system given a list of system names which are placed within your hosts/ directory. Note that each system has its own directory in hosts/ as well.
@ -200,7 +23,7 @@ in rec {
# Example usage # Example usage
:::{.example} :::{.example}
```nix ```nix
nixosConfigurations = buildSystems { root = ./.; }; nixosConfigurations = build_systems { root = ./.; };
``` ```
::: :::
*/ */
@ -211,79 +34,100 @@ in rec {
# ); # );
# in # in
buildFunc = func: { build_systems = {
root, root,
unstableBundle ? {}, additionalMods ? {
stableBundle ? {}, nixos = [];
home = [];
},
mods ? {
nixos = [
inputs.home-manager.nixosModules.home-manager
inputs.stylix.nixosModules.stylix
inputs.disko.nixosModules.disko
../base
../home
../modules
];
home = [
inputs.anyrun.homeManagerModules.default
inputs.ironbar.homeManagerModules.default
inputs.oxicalc.homeManagerModules.default
inputs.oxishut.homeManagerModules.default
inputs.oxinoti.homeManagerModules.default
inputs.oxidash.homeManagerModules.default
inputs.oxipaste.homeManagerModules.default
inputs.hyprdock.homeManagerModules.default
inputs.hyprland.homeManagerModules.default
inputs.reset.homeManagerModules.default
inputs.nix-flatpak.homeManagerModules.nix-flatpak
inputs.sops-nix.homeManagerModules.sops
inputs.dashvim.homeManagerModules.dashvim
../modules
];
},
additionalInputs ? {},
overridePkgs ? false, overridePkgs ? false,
... ...
}: let }:
defaultNixosMods = inputs: [ builtins.listToAttrs (
inputs.lanzaboote.nixosModules.lanzaboote map
inputs.nixos-wsl.nixosModules.default (name: {
inputs.home-manager.nixosModules.home-manager name = name;
inputs.stylix.nixosModules.stylix value = let
inputs.disko.nixosModules.disko mod = root + /hosts/${name}/configuration.nix;
inputs.superfreq.nixosModules.default additionalNixosConfig = root + /hosts/${name}/hardware.nix;
inputs.sops-nix.nixosModules.sops additionalHomeConfig = root + /hosts/${name}/home.nix;
../base args = {
../home inherit
../modules self
]; inputs
mod
additionalHomeConfig
root
;
pkgs = lib.mkForce (
if overridePkgs
then stable
else pkgs
);
alternativePkgs =
if overridePkgs
then pkgs
else stable;
hostName = name;
homeMods = mods.home;
additionalHomeMods = additionalMods.home;
additionalInputs = additionalInputs;
};
in
inputs.nixpkgs.lib.nixosSystem {
modules =
[
{_module.args = args;}
mod
]
++ mods.nixos
++ additionalMods.nixos
++ inputs.nixpkgs.lib.optional (builtins.pathExists additionalNixosConfig) additionalNixosConfig
++ inputs.nixpkgs.lib.optional (builtins.pathExists mod) mod;
};
})
(
lib.lists.remove "" (
lib.attrsets.mapAttrsToList (name: fType:
if fType == "directory"
then name
else "") (
builtins.readDir (root + /hosts)
)
)
)
);
defaultHomeMods = inputs: [ buildIso = inputs.nixpkgs.lib.nixosSystem {
inputs.anyrun.homeManagerModules.default
inputs.ironbar.homeManagerModules.default
inputs.oxicalc.homeManagerModules.default
inputs.oxishut.homeManagerModules.default
inputs.oxinoti.homeManagerModules.default
inputs.oxidash.homeManagerModules.default
inputs.oxipaste.homeManagerModules.default
inputs.oxirun.homeManagerModules.default
inputs.hyprdock.homeManagerModules.default
inputs.hyprland.homeManagerModules.default
inputs.reset.homeManagerModules.default
inputs.sops-nix.homeManagerModules.sops
inputs.dashvim.homeManagerModules.dashvim
../modules
];
unstableInput = unstableBundle.pkgs or inputs.unstable;
stableInput = stableBundle.pkgs or inputs.stable;
unstableConfig = unstableBundle.config or defaultConfig;
stableConfig = stableBundle.config or defaultConfig;
unstableInputs = (unstableBundle.inputs or {}) // inputs;
stableInputs = (stableBundle.inputs or {}) // inputs;
unstableMods = {
home = (defaultHomeMods unstableInputs) ++ (unstableBundle.mods.home or []);
nixos = (defaultNixosMods unstableInputs) ++ (unstableBundle.mods.nixos or []);
};
stableMods = {
home = (defaultHomeMods stableInputs) ++ (stableBundle.mods.home or []);
nixos = (defaultNixosMods stableInputs) ++ (stableBundle.mods.nixos or []);
};
unstablePkgs = mkPkgs {
pkgs = unstableInput;
config = unstableConfig;
};
stablePkgs = mkPkgs {
pkgs = stableInput;
config = stableConfig;
};
inputLib = unstableInput.lib;
inherit (unstablePkgs) lib;
in
func {
inherit lib inputLib stablePkgs unstablePkgs stableMods unstableMods stableInputs unstableInputs root overridePkgs;
};
buildSystems = buildFunc mkNixos;
buildHome = buildFunc mkHome;
buildIso = inputs.unstable.lib.nixosSystem {
specialArgs = { specialArgs = {
inherit self inputs unstable; inherit self inputs pkgs;
}; };
modules = [ modules = [
../iso/configuration.nix ../iso/configuration.nix

View file

@ -1,59 +0,0 @@
{
lib,
name,
...
}: let
mkExtension = id: install_url: {
${id} = {
inherit install_url;
installation_mode = "normal_installed";
};
};
in {
options.mods.browser.${name} = {
darkreader = lib.mkOption {
default = true;
example = false;
type = lib.types.bool;
description = "Whether to enable darkreader";
};
extensions = lib.mkOption {
default = [
(mkExtension "uBlock0@raymondhill.net" "https://addons.mozilla.org/firefox/downloads/latest/ublock-origin/latest.xpi")
(mkExtension "{a6c4a591-f1b2-4f03-b3ff-767e5bedf4e7}" "https://addons.mozilla.org/firefox/downloads/latest/user-agent-string-switcher/latest.xpi")
(mkExtension "{d7742d87-e61d-4b78-b8a1-b469842139fa}" "https://addons.mozilla.org/firefox/downloads/latest/vimium-ff/latest.xpi")
(mkExtension "firefox@ghostery.com" "https://addons.mozilla.org/firefox/downloads/latest/ghostery/latest.xpi")
(mkExtension "CanvasBlocker@kkapsner.de" "https://addons.mozilla.org/firefox/downloads/latest/canvasblocker/latest.xpi")
(mkExtension "jid1-KKzOGWgsW3Ao4Q@jetpack" "https://addons.mozilla.org/firefox/downloads/latest/i-dont-care-about-cookies/latest.xpi")
(mkExtension "keepassxc-browser@keepassxc.org" "https://addons.mozilla.org/firefox/downloads/latest/keepassxc-browser/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 "{20a9bb38-ed7c-4faf-9aaf-7c5d241fd747}" "https://addons.mozilla.org/firefox/downloads/file/4524699/angular_devtools-1.0.37.xpi")
(mkExtension "private-relay@firefox.com" "https://addons.mozilla.org/firefox/downloads/latest/private-relay/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";
};
}
];
type = with lib.types; listOf anything;
description = ''
List of extensions via attrsets:
```nix
# id
# figure out the id via:
# nix run github:tupakkatapa/mozid -- 'https://addons.mozilla.org/en/firefox/addon/ublock-origin'
"uBlock0@raymondhill.net" = {
# install url
install_url = "https://addons.mozilla.org/firefox/downloads/latest/ublock-origin/latest.xpi";
# method https://mozilla.github.io/policy-templates/#extensionsettings
installation_mode = "force_installed";
};
```
'';
};
};
}

View file

@ -1,43 +0,0 @@
# https://github.com/0xc000022070/zen-browser-flake/issues/9#issuecomment-2711057434
{inputs, ...}: let
mkFirefoxModule = import "${inputs.home-manager.outPath}/modules/programs/firefox/mkFirefoxModule.nix";
in {
imports = [
(mkFirefoxModule {
modulePath = [
"programs"
"zen-browser"
];
name = "Zen Browser";
wrappedPackageName = "zen";
unwrappedPackageName = "zen-unwrapped";
visible = true;
platforms = {
linux = {
vendorPath = ".zen";
configPath = ".zen";
};
darwin = {
configPath = "Library/Application Support/Zen";
};
};
})
(mkFirefoxModule {
modulePath = [
"programs"
"librewolf-dashnix"
];
name = "LibreWolf";
description = "LibreWolf is a privacy enhanced Firefox fork.";
wrappedPackageName = "librewolf";
unwrappedPackageName = "librewolf-unwrapped";
platforms.linux = {configPath = ".librewolf";};
platforms.darwin = {
configPath = "Library/Application Support/LibreWolf";
};
enableBookmarks = false;
})
];
}

View file

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

View file

@ -1 +0,0 @@
{lib, ...}: value: lib.mkOverride 999 value

View file

@ -1,446 +0,0 @@
let
browserName = config:
if (builtins.isString config.mods.homePackages.browser)
then config.mods.homePackages.browser
else if config.mods.homePackages.browser ? meta && config.mods.homePackages.browser.meta ? mainProgram
then config.mods.homePackages.browser.meta.mainProgram
else config.mods.homePackages.browser.pname;
mkSimpleBind = modKeys: key: command: args: {
inherit modKeys key command args;
};
mkRepeatSimpleBind = modKeys: key: command: args: {
inherit modKeys key command args;
meta.hyprland.repeat = true;
};
mkSimpleCustomBind = modKeys: key: niri: hyprland: args: {
inherit modKeys key args;
command = {
inherit niri hyprland;
};
};
mkRepeatCustomBind = modKeys: key: niri: hyprland: args: {
inherit modKeys key args;
command = {
inherit niri hyprland;
};
meta.hyprland.repeat = true;
};
mkBindWithDesc = modKeys: key: command: args: desc:
{
meta.niri.desc = desc;
}
// mkSimpleBind modKeys key command args;
in {
defaultWindowRules = {
niri = [
''
match app-id=r#"^org\.keepassxc\.KeePassXC$"#
match app-id=r#"^org\.gnome\.World\.Secrets$"#
block-out-from "screen-capture"
''
''
match app-id=r#"^steam$"#
open-on-workspace "0"
''
''
geometry-corner-radius 12
clip-to-geometry true
''
];
hyprland = [
# window rules
"match:class OxiCalc, float on"
"match:class winecfg.exe, float on"
"match:class copyq, float on"
"match:class swappy, center on"
"match:class steam, workspace 10 silent"
];
};
defaultStartup = config: {
all = [
"systemctl --user import-environment"
"dbus-update-activation-environment --systemd --all"
"hyprctl setcursor ${config.mods.stylix.cursor.name} ${toString config.mods.stylix.cursor.size}"
# ensures the systemd service knows what "hyprctl" is :)
(
if config.mods.gaming.gamemode
then "systemctl try-restart gamemoded.service --user"
else ""
)
# other programs
"${browserName config}"
(
if config.mods.oxi.hyprdock.enable
then "hyprdock --server"
else ""
)
(
if config.mods.hypr.hyprpaper.enable
then "hyprpaper"
else ""
)
(
if config.mods.hypr.hyprland.useIronbar
then "ironbar"
else ""
)
(
if config.mods.oxi.oxipaste.enable
then "oxipaste_daemon"
else ""
)
(
if config.mods.oxi.oxinoti.enable
then "oxinoti"
else ""
)
];
niri = [
"XDG_CURRENT_DESKTOP=Niri"
"XDG_SESSION_DESKTOP=Niri"
"XDG_SESSION_TYPE=wayland"
];
hyprland = [
"XDG_CURRENT_DESKTOP=Hyprland"
"XDG_SESSION_DESKTOP=Hyprland"
"XDG_SESSION_TYPE=wayland"
];
};
defaultEnv = config: {
all = {
GTK_CSD = "0";
TERM = "kitty /bin/fish";
HYPRCURSOR_THEME = config.mods.stylix.cursor.name;
HYPRCURSOR_SIZE = toString config.mods.stylix.cursor.size;
XCURSOR_THEME = config.mods.stylix.cursor.name;
XCURSOR_SIZE = toString config.mods.stylix.cursor.size;
QT_QPA_PLATFORM = "wayland";
QT_QPA_PLATFORMTHEME = "qt5ct";
QT_WAYLAND_FORCE_DPI = "96";
QT_AUTO_SCREEN_SCALE_FACTOR = "0";
QT_WAYLAND_DISABLE_WINDOWDECORATION = "1";
QT_SCALE_FACTOR = "1";
EDITOR = "neovide --novsync --nofork";
LIBVA_DRIVER_NAME =
if config.mods.gpu.nvidia.enable
then "nvidia"
else "";
GBM_BACKEND =
if config.mods.gpu.nvidia.enable
then "nvidia-drm"
else "";
__GLX_VENDOR_LIBRARY_NAME =
if config.mods.gpu.nvidia.enable
then "nvidia"
else "";
};
niri = {};
hyprland = {};
};
defaultBinds = config: [
(mkSimpleBind ["Mod"] "1" "focusWorkspace" ["1"])
(mkSimpleBind ["Mod"] "2" "focusWorkspace" ["2"])
(mkSimpleBind ["Mod"] "3" "focusWorkspace" ["3"])
(mkSimpleBind ["Mod"] "4" "focusWorkspace" ["4"])
(mkSimpleBind ["Mod"] "5" "focusWorkspace" ["5"])
(mkSimpleBind ["Mod"] "6" "focusWorkspace" ["6"])
(mkSimpleBind ["Mod"] "7" "focusWorkspace" ["7"])
(mkSimpleBind ["Mod"] "8" "focusWorkspace" ["8"])
(mkSimpleBind ["Mod"] "9" "focusWorkspace" ["9"])
(mkSimpleBind ["Mod"] "0" "focusWorkspace" ["10"])
(mkSimpleBind ["Mod" "Shift"] "1" "moveToWorkspace" ["1"])
(mkSimpleBind ["Mod" "Shift"] "2" "moveToWorkspace" ["2"])
(mkSimpleBind ["Mod" "Shift"] "3" "moveToWorkspace" ["3"])
(mkSimpleBind ["Mod" "Shift"] "4" "moveToWorkspace" ["4"])
(mkSimpleBind ["Mod" "Shift"] "5" "moveToWorkspace" ["5"])
(mkSimpleBind ["Mod" "Shift"] "6" "moveToWorkspace" ["6"])
(mkSimpleBind ["Mod" "Shift"] "7" "moveToWorkspace" ["7"])
(mkSimpleBind ["Mod" "Shift"] "8" "moveToWorkspace" ["8"])
(mkSimpleBind ["Mod" "Shift"] "9" "moveToWorkspace" ["9"])
(mkSimpleBind ["Mod" "Shift"] "0" "moveToWorkspace" ["10"])
(mkSimpleBind ["Mod"] "B" "toggleFullscreen" [])
(mkSimpleBind ["Mod"] "V" "toggleFloating" [])
(mkSimpleBind ["Mod" "Shift"] "M" "quit" [])
(mkSimpleBind ["Mod"] "Left" "moveWindowLeft" [])
(mkSimpleBind ["Mod"] "Down" "moveWindowDown" [])
(mkSimpleBind ["Mod"] "Up" "moveWindowUp" [])
(mkSimpleBind ["Mod"] "Right" "moveWindowRight" [])
(mkRepeatSimpleBind ["Mod"] "J" "moveFocusLeft" [])
(mkRepeatSimpleBind ["Mod"] "K" "moveFocusDown" [])
(mkRepeatSimpleBind ["Mod"] "L" "moveFocusUp" [])
(mkRepeatSimpleBind ["Mod"] "semicolon" "moveFocusRight" [])
(mkBindWithDesc ["Mod"] "Q" "killActive" [] "Kill active window")
(mkBindWithDesc ["Mod"] "N" "spawn" ["neovide"] "Open Neovide")
(mkBindWithDesc ["Mod"] "T" "spawn-sh" ["kitty" "-1"] "Open Kitty")
(mkBindWithDesc ["Mod" "Shift"] "L" "spawn" ["hyprlock"] "Lock screen")
(
if config.mods.yazi.enable
then mkBindWithDesc ["Mod"] "E" "spawn-sh" ["EDITOR='neovide --no-fork' kitty yazi"] "Open Yazi"
else {}
)
(
if config.mods.anyrun.enable
then mkBindWithDesc ["Mod"] "R" "spawn" ["anyrun"] "Open Anyrun"
else {}
)
(
if config.mods.oxi.oxirun.enable
then mkBindWithDesc ["Mod"] "R" "spawn" ["oxirun"] "Open OxiRun"
else {}
)
(
if config.mods.oxi.oxidash.enable
then mkBindWithDesc ["Mod"] "M" "spawn" ["oxidash"] "Open OxiDash"
else {}
)
(
if config.mods.oxi.oxicalc.enable
then mkBindWithDesc ["Mod"] "G" "spawn" ["oxicalc"] "Open Oxicalc"
else {}
)
(
if config.mods.oxi.oxishut.enable
then mkBindWithDesc ["Mod"] "D" "spawn" ["oxishut"] "Open OxiShut"
else {}
)
(
if config.mods.oxi.oxipaste.enable
then mkBindWithDesc ["Mod"] "A" "spawn" ["oxipaste"] "Open Oxipaste"
else {}
)
(
if config.mods.oxi.hyprdock.enable
then mkBindWithDesc ["Mod" "Shift"] "P" "spawn" ["hyprdock --gui"] "Open Hyprdock"
else {}
)
(
if config.mods.hypr.hyprlock.enable
then mkBindWithDesc ["Mod" "Shift" "Alt"] "L" "spawn-sh" ["playerctl -a pause & hyprlock & systemctl suspend"] "Lock and suspend"
else {}
)
(
if config.mods.hypr.hyprlock.enable
then mkBindWithDesc ["Mod" "Shift" "Alt"] "K" "spawn-sh" ["playerctl -a pause & hyprlock & systemctl hibernate"] "Lock and hibernate"
else {}
)
(mkBindWithDesc ["Mod"] "F" "spawn" ["${browserName config}"] "Open Browser")
(
if
(
browserName config == "firefox" || browserName config == "zen"
)
then mkBindWithDesc ["Mod" "Shift"] "F" "spawn" ["${browserName config} -p special"] "Open Browser Special Profile"
else {}
)
(mkBindWithDesc ["Mod"] "S" "spawn-sh" [''grim -g "$(slurp)" - | wl-copy''] "Take Screenshot")
(mkBindWithDesc ["Mod" "Shift"] "S" "spawn-sh" [''grim -g "$(slurp)" - | satty -f -''] "Take Screenshot and edit")
(
if config.mods.scripts.audioControl
then {
key = "XF86AudioMute";
command = "spawn-sh";
args = ["audioControl mute"];
meta.niri = {
allowWhileLocked = true;
desc = "Mute Audio";
};
}
else {}
)
(
if config.mods.scripts.audioControl
then {
key = "XF86AudioRaiseVolume";
command = "spawn-sh";
args = ["audioControl +5%"];
meta.niri = {
allowWhileLocked = true;
desc = "Raise Audio Volume";
};
}
else {}
)
(
if config.mods.scripts.audioControl
then {
key = "XF86AudioLowerVolume";
command = "spawn-sh";
args = ["audioControl -5%"];
meta.niri = {
allowWhileLocked = true;
desc = "Lower Audio Volume";
};
}
else {}
)
{
key = "XF86AudioPlay";
command = "spawn-sh";
args = ["playerctl play-pause"];
meta.niri = {
allowWhileLocked = true;
desc = "Play/Pause";
};
}
{
key = "XF86AudioNext";
command = "spawn-sh";
args = ["playerctl next"];
meta.niri = {
allowWhileLocked = true;
desc = "Next Song";
};
}
{
key = "XF86AudioPrev";
command = "spawn-sh";
args = ["playerctl previous"];
meta.niri = {
allowWhileLocked = true;
desc = "Previous Song";
};
}
(
if config.mods.scripts.changeBrightness
then {
key = "XF86MonBrightnessDown";
command = "spawn-sh";
args = ["changeBrightness -10%"];
meta.niri = {
allowWhileLocked = true;
desc = "Lower Brigthness";
};
}
else {}
)
(
if config.mods.scripts.changeBrightness
then {
key = "XF86MonBrightnessUp";
command = "spawn-sh";
args = ["changeBrightness +10%"];
meta.niri = {
allowWhileLocked = true;
desc = "Raise Brigthness";
};
}
else {}
)
# Niri only keybinds
(mkSimpleCustomBind ["Mod"] "BracketLeft" "consume-or-expel-window-left" null [])
(mkSimpleCustomBind ["Mod"] "BracketRight" "consume-or-expel-window-right" null [])
(mkSimpleCustomBind ["Mod"] "Comma" "consume-window-into-column" null [])
(mkSimpleCustomBind ["Mod"] "Period" "expel-window-from-column" null [])
(mkSimpleCustomBind ["Mod"] "Y" "switch-preset-column-width" null [])
(mkSimpleCustomBind ["Mod"] "Tab" "focus-workspace-previous" null [])
(mkSimpleCustomBind ["Mod" "Shift"] "V" "switch-focus-between-floating-and-tiling" null [])
(mkSimpleCustomBind ["Mod" "Shift"] "B" "expand-column-to-available-width" null [])
(mkSimpleCustomBind ["Mod"] "U" "set-column-width" null ["-10%"])
(mkSimpleCustomBind ["Mod"] "P" "set-column-width" null ["+10%"])
(mkSimpleCustomBind ["Mod"] "O" "set-column-width" null ["50%"])
(mkSimpleCustomBind ["Mod" "Shift"] "Minus" "set-window-height" null ["-10%"])
(mkSimpleCustomBind ["Mod" "Shift"] "Equal" "set-window-height" null ["+10%"])
(mkSimpleCustomBind ["Mod" "Ctrl"] "1" "move-column-to-workspace" null ["1"])
(mkSimpleCustomBind ["Mod" "Ctrl"] "2" "move-column-to-workspace" null ["2"])
(mkSimpleCustomBind ["Mod" "Ctrl"] "3" "move-column-to-workspace" null ["3"])
(mkSimpleCustomBind ["Mod" "Ctrl"] "4" "move-column-to-workspace" null ["4"])
(mkSimpleCustomBind ["Mod" "Ctrl"] "5" "move-column-to-workspace" null ["5"])
(mkSimpleCustomBind ["Mod" "Ctrl"] "6" "move-column-to-workspace" null ["6"])
(mkSimpleCustomBind ["Mod" "Ctrl"] "7" "move-column-to-workspace" null ["7"])
(mkSimpleCustomBind ["Mod" "Ctrl"] "8" "move-column-to-workspace" null ["8"])
(mkSimpleCustomBind ["Mod" "Ctrl"] "9" "move-column-to-workspace" null ["9"])
(mkSimpleCustomBind ["Mod" "Ctrl"] "0" "move-column-to-workspace" null ["10"])
(mkSimpleCustomBind ["Mod" "Shift"] "J" "focus-monitor-left" null [])
(mkSimpleCustomBind ["Mod" "Shift"] "semicolon" "focus-monitor-right" null [])
(mkSimpleCustomBind ["Mod" "Ctrl"] "J" "move-column-to-monitor-left" null [])
(mkSimpleCustomBind ["Mod" "Ctrl"] "semicolon" "move-column-to-monitor-right" null [])
(mkSimpleCustomBind ["Mod" "Shift"] "Slash" "show-hotkey-overlay" null [])
{
modKeys = ["Mod"];
key = "W";
command.niri = "toggle-overview";
meta.niri = {
desc = "Overview";
repeat = false;
};
}
{
modKeys = ["Mod"];
key = "Escape";
command.niri = "toggle-keyboard-shortcuts-inhibit";
meta.niri = {
allowInhibit = false;
};
}
{
modKeys = ["Mod"];
key = "WheelScrollUp";
command.niri = "focus-workspace-up";
meta.niri.cooldown = 150;
}
{
modKeys = ["Mod"];
key = "WheelScrollDown";
command.niri = "focus-workspace-down";
meta.niri.cooldown = 150;
}
{
modKeys = ["Mod"];
key = "WheelScrollRight";
command.niri = "focus-column-right";
meta.niri.cooldown = 150;
}
{
modKeys = ["Mod"];
key = "WheelScrollLeft";
command.niri = "focus-column-left";
meta.niri.cooldown = 150;
}
# Hyprland only keybinds
(mkSimpleCustomBind ["Mod"] "C" null "togglesplit" [])
(mkSimpleCustomBind ["Mod" "SHIFT" "ALT"] "1" null "movetoworkspacesilent" ["1"])
(mkSimpleCustomBind ["Mod" "SHIFT" "ALT"] "2" null "movetoworkspacesilent" ["2"])
(mkSimpleCustomBind ["Mod" "SHIFT" "ALT"] "3" null "movetoworkspacesilent" ["3"])
(mkSimpleCustomBind ["Mod" "SHIFT" "ALT"] "4" null "movetoworkspacesilent" ["4"])
(mkSimpleCustomBind ["Mod" "SHIFT" "ALT"] "5" null "movetoworkspacesilent" ["5"])
(mkSimpleCustomBind ["Mod" "SHIFT" "ALT"] "6" null "movetoworkspacesilent" ["6"])
(mkSimpleCustomBind ["Mod" "SHIFT" "ALT"] "7" null "movetoworkspacesilent" ["7"])
(mkSimpleCustomBind ["Mod" "SHIFT" "ALT"] "8" null "movetoworkspacesilent" ["8"])
(mkSimpleCustomBind ["Mod" "SHIFT" "ALT"] "9" null "movetoworkspacesilent" ["9"])
(mkSimpleCustomBind ["Mod" "SHIFT" "ALT"] "0" null "movetoworkspacesilent" ["10"])
(mkRepeatCustomBind ["Mod"] "U" null "resizeactive" ["-20" "0"])
(mkRepeatCustomBind ["Mod"] "P" null "resizeactive" ["20" "0"])
(mkRepeatCustomBind ["Mod"] "O" null "resizeactive" ["0" "-20"])
(mkRepeatCustomBind ["Mod"] "I" null "resizeactive" ["0" "20"])
(mkSimpleCustomBind ["Mod" "ALT"] "J" null "layoutmsg" ["preselect" "l"])
(mkSimpleCustomBind ["Mod" "ALT"] "K" null "layoutmsg" ["preselect" "d"])
(mkSimpleCustomBind ["Mod" "ALT"] "L" null "layoutmsg" ["preselect" "u"])
(mkSimpleCustomBind ["Mod" "ALT"] "semicolon" null "layoutmsg" ["preselect" "r"])
(mkSimpleCustomBind ["Mod" "ALT"] "H" null "layoutmsg" ["preselect" "n"])
(
if config.mods.hypr.hyprland.hyprspaceEnable
then {
modKeys = ["Mod"];
key = "W";
command.hyprland = "overview:toggle";
args = [];
}
else {}
)
];
}

View file

@ -1,6 +1,7 @@
{ {
lib, lib,
config, config,
pkgs,
options, options,
... ...
}: { }: {
@ -19,40 +20,6 @@
''; '';
}; };
systemLocalTime = lib.mkOption {
default = false;
example = true;
description = ''
System time for dualbooting
'';
};
wsl = lib.mkOption {
default = false;
example = true;
description = ''
Runs Nix in wsl
'';
};
secureBoot = lib.mkOption {
default = false;
example = true;
description = ''
enables secure boot.
Note: Secure boot is NOT reproducible
Here are the necessary steps:
+ create your keys with sbctl -> sudo sbctl create-keys
+ build with systemd once -> set this to false and build once
+ build with secureBoot true
+ verify that your keys are signed (note, only systemd and your generations should now be signed): sudo sbtcl verify
+ enroll your keys (microsoft is necessary for windows dualboot support, leave it there): sudo sbctl enroll-keys --microsoft
+ reboot with secureboot enabled
Note: Some motherboards have vendor specific keys for secure boot, this may not necessarily work with our self signed keys
You likely have to disable these vendor specific keys (example HP: sure boot)
'';
};
useSystemdBootloader = lib.mkOption { useSystemdBootloader = lib.mkOption {
default = true; default = true;
example = false; example = false;
@ -61,6 +28,14 @@
''; '';
}; };
defualtDiskId = lib.mkOption {
default = "TODO";
example = "/dev/disk/by-id/nvme-Force_MP510_19498249000129196385";
description = ''
The id of the disk to format
'';
};
cpu = lib.mkOption { cpu = lib.mkOption {
# TODO: how to enable arm? # TODO: how to enable arm?
default = "amd"; default = "amd";
@ -75,7 +50,9 @@
}; };
additionalBootKernalParams = lib.mkOption { additionalBootKernalParams = lib.mkOption {
default = []; default = [
"video=${config.conf.defaultMonitor}:${config.conf.defaultMonitorMode}"
];
example = []; example = [];
type = with lib.types; listOf str; type = with lib.types; listOf str;
description = '' description = ''
@ -83,6 +60,49 @@
''; '';
}; };
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
'';
};
ironbar = {
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.
'';
};
};
bootParams = lib.mkOption { bootParams = lib.mkOption {
default = []; default = [];
example = ["resume=something"]; example = ["resume=something"];
@ -92,6 +112,17 @@
''; '';
}; };
streamdeck = {
enable = lib.mkOption {
default = false;
example = true;
type = lib.types.bool;
description = ''
Install streamdeck configuration program.
'';
};
};
kernelOverride = lib.mkOption { kernelOverride = lib.mkOption {
default = null; default = null;
type = with lib.types; nullOr package; type = with lib.types; nullOr package;
@ -103,7 +134,7 @@
}; };
username = lib.mkOption { username = lib.mkOption {
default = "DashNix"; default = "dashie";
example = "pingpang"; example = "pingpang";
type = lib.types.str; type = lib.types.str;
description = '' description = ''

View file

@ -1,145 +0,0 @@
{
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 {
package = pkgs.anyrun;
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

@ -1,11 +1,8 @@
{ {
mkDashDefault,
config, config,
lib, lib,
options, options,
pkgs, pkgs,
inputs,
system,
... ...
}: { }: {
options.mods = { options.mods = {
@ -52,7 +49,6 @@
then then
with pkgs; with pkgs;
[ [
inputs.statix.packages.${system}.default
adwaita-icon-theme adwaita-icon-theme
dbus dbus
dconf dconf
@ -68,6 +64,7 @@
icon-library icon-library
kdePackages.breeze-icons kdePackages.breeze-icons
kdePackages.breeze kdePackages.breeze
libsForQt5.breeze-qt5
kdePackages.qtstyleplugin-kvantum kdePackages.qtstyleplugin-kvantum
libsForQt5.qtstyleplugin-kvantum libsForQt5.qtstyleplugin-kvantum
libadwaita libadwaita
@ -77,24 +74,23 @@
seahorse seahorse
upower upower
xorg.xkbutils xorg.xkbutils
sbctl
] ]
++ config.mods.basePackages.additionalPackages ++ config.mods.basePackages.additionalPackages
else config.mods.basePackages.additionalPackages; else config.mods.basePackages.additionalPackages;
gtk.iconCache.enable = mkDashDefault false; gtk.iconCache.enable = false;
services = services =
if config.mods.basePackages.enable if config.mods.basePackages.enable
then then
{ {
upower.enable = mkDashDefault true; upower.enable = true;
dbus = { dbus = {
enable = mkDashDefault true; enable = true;
}; };
avahi = { avahi = {
enable = mkDashDefault true; enable = true;
nssmdns4 = mkDashDefault true; nssmdns4 = true;
openFirewall = mkDashDefault true; openFirewall = true;
}; };
} }
// config.mods.basePackages.specialServices // config.mods.basePackages.specialServices
@ -103,30 +99,27 @@
programs = programs =
if config.mods.basePackages.enable if config.mods.basePackages.enable
then then
lib.mkMerge {
[ nix-ld = {
{ enable = true;
nix-ld = { libraries = with pkgs; [
enable = mkDashDefault true; jdk
libraries = with pkgs; [ zlib
jdk ];
zlib };
]; direnv = {
package = pkgs.direnv;
silent = false;
loadInNixShell = true;
direnvrcExtra = "";
nix-direnv = {
enable = true;
package = pkgs.nix-direnv;
}; };
direnv = { };
package = mkDashDefault pkgs.direnv; gnupg.agent.enable = true;
silent = mkDashDefault false; }
loadInNixShell = mkDashDefault true; // config.mods.basePackages.specialPrograms
direnvrcExtra = mkDashDefault "";
nix-direnv = {
enable = mkDashDefault true;
package = mkDashDefault pkgs.nix-direnv;
};
};
gnupg.agent.enable = mkDashDefault true;
}
config.mods.basePackages.specialPrograms
]
else config.mods.basePackages.specialPrograms; else config.mods.basePackages.specialPrograms;
}; };
} }

View file

@ -1,5 +1,4 @@
{ {
mkDashDefault,
lib, lib,
config, config,
options, options,
@ -19,8 +18,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 = mkDashDefault true; enable = true;
powerOnBoot = mkDashDefault true; powerOnBoot = true;
}; };
} }
); );

View file

@ -14,7 +14,7 @@
}; };
# TODO configure brave # TODO configure brave
}; };
config = lib.mkIf (config.mods.browser.brave.enable || config.mods.homePackages.browser == "brave") ( config = lib.mkIf config.mods.browser.brave.enable (
lib.optionalAttrs (options ? home.packages) { lib.optionalAttrs (options ? home.packages) {
home.packages = with pkgs; [brave]; home.packages = with pkgs; [brave];
} }

View file

@ -14,7 +14,7 @@
}; };
# TODO configure chromium # TODO configure chromium
}; };
config = lib.mkIf (config.mods.browser.chromium.enable || config.mods.homePackages.browser == "chromium") ( config = lib.mkIf config.mods.browser.chromium.enable (
lib.optionalAttrs (options ? home.packages) { lib.optionalAttrs (options ? home.packages) {
home.packages = with pkgs; [chromium]; home.packages = with pkgs; [chromium];
} }

View file

@ -1,9 +1,8 @@
{ {
imports = [ imports = [
./brave.nix
./chromium.nix
./firefox.nix ./firefox.nix
./librewolf.nix
./zen.nix ./zen.nix
./chromium.nix
./brave.nix
]; ];
} }

View file

@ -1,18 +1,11 @@
{ {
lib, lib,
dashNixAdditionalProps,
config, config,
options, options,
pkgs, pkgs,
... ...
}: let }: {
name = "firefox"; options.mods.browser.firefox = {
in {
imports = [
(import ../../../lib/foxextensions.nix
{inherit lib dashNixAdditionalProps pkgs name;})
];
options.mods.browser.${name} = {
enable = lib.mkOption { enable = lib.mkOption {
default = false; default = false;
example = true; example = true;
@ -77,7 +70,7 @@ in {
value = { value = {
isDefault = true; isDefault = true;
id = 0; id = 0;
extensions.packages = [pkgs.nur.repos.rycee.firefox-addons.darkreader]; extensions.packages = [ pkgs.nur.repos.rycee.firefox-addons.darkreader ];
}; };
} }
]; ];
@ -85,39 +78,11 @@ in {
description = "Firefox profiles"; description = "Firefox profiles";
}; };
}; };
config = lib.mkIf (config.mods.browser.firefox.enable || config.mods.homePackages.browser == "firefox") ( config = lib.mkIf config.mods.browser.firefox.enable (
lib.optionalAttrs (options ? programs.firefox.profiles) { lib.optionalAttrs (options ? programs.firefox.profiles) {
stylix.targets.firefox.profileNames =
map (
{name, ...}:
name
)
config.mods.browser.firefox.profiles;
programs.firefox = { programs.firefox = {
enable = true; enable = true;
package = policies = config.mods.browser.firefox.configuration;
pkgs.wrapFirefox
pkgs.firefox-unwrapped
{
pname = "firefox";
extraPolicies =
config.mods.browser.firefox.configuration
// {
ExtensionSettings = builtins.foldl' (acc: ext: acc // ext) {} (config.mods.browser.firefox.extensions
++ (
if config.mods.browser.firefox.darkreader
then [
{
"addon@darkreader.org" = {
install_url = "file://${pkgs.callPackage ../../../patches/darkreader.nix {inherit lib dashNixAdditionalProps;}}/latest.xpi";
installation_mode = "normal_installed";
};
}
]
else []
));
};
};
profiles = builtins.listToAttrs config.mods.browser.firefox.profiles; profiles = builtins.listToAttrs config.mods.browser.firefox.profiles;
}; };
} }

View file

@ -1,119 +0,0 @@
{
lib,
dashNixAdditionalProps,
config,
options,
pkgs,
...
}: let
name = "librewolf";
in {
imports = [
(import ../../../lib/foxextensions.nix
{inherit lib dashNixAdditionalProps pkgs name;})
];
options.mods.browser.${name} = {
enable = lib.mkOption {
default = false;
example = true;
type = lib.types.bool;
description = "Enables the librwolf browser";
};
configuration = lib.mkOption {
default = {
EnableTrackingProtection = {
Value = true;
Locked = true;
Cryptomining = true;
Fingerprinting = true;
};
DisablePocket = true;
DisplayBookmarksToolbar = "never";
DisplayMenuBar = "default-off";
CaptivePortal = false;
DisableFirefoxStudies = true;
DisableTelemetry = true;
DisableFirefoxAccounts = false;
NoDefaultBookmarks = true;
OfferToSaveLogins = false;
OfferToSaveLoginsDefault = false;
PasswordManagerEnabled = false;
FirefoxHome = {
Search = true;
Pocket = false;
Snippets = false;
TopSites = true;
Highlights = false;
};
UserMessaging = {
ExtensionRecommendations = false;
SkipOnboarding = true;
};
};
example = {};
type = with lib.types; attrsOf anything;
description = "Librewolf policy configuration. See https://mozilla.github.io/policy-templates/ for more information.";
};
profiles = lib.mkOption {
default = [
{
name = "${config.conf.username}";
value = {
isDefault = true;
id = 0;
};
}
{
name = "special";
value = {
isDefault = false;
id = 1;
};
}
];
example = [
{
name = "custom";
value = {
isDefault = true;
id = 0;
extensions.packages = [pkgs.nur.repos.rycee.firefox-addons.darkreader];
};
}
];
type = with lib.types; listOf (attrsOf anything);
description = "Librewolf profiles";
};
};
config = lib.mkIf (config.mods.browser.librewolf.enable || config.mods.homePackages.browser == "librewolf") (
lib.optionalAttrs (options ? home.packages) {
programs.librewolf-dashnix = {
enable = true;
package =
pkgs.wrapFirefox
pkgs.librewolf-unwrapped
{
pname = "librewolf";
extraPolicies =
config.mods.browser.librewolf.configuration
// {
ExtensionSettings = builtins.foldl' (acc: ext: acc // ext) {} (config.mods.browser.librewolf.extensions
++ (
if config.mods.browser.firefox.darkreader
then [
{
"addon@darkreader.org" = {
install_url = "file://${pkgs.callPackage ../../../patches/darkreader.nix {inherit lib dashNixAdditionalProps;}}/latest.xpi";
installation_mode = "normal_installed";
};
}
]
else []
));
};
};
profiles = builtins.listToAttrs config.mods.browser.librewolf.profiles;
};
}
);
}

View file

@ -1,157 +1,23 @@
# 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,
system, system,
pkgs, inputs,
... ...
}: let }: {
# at time of using this here, stylix might not be evaluated yet options.mods.browser.zen = {
# hence ensure it is by using base16 mkSchemeAttrs
base16 = pkgs.callPackage inputs.base16.lib {};
scheme = base16.mkSchemeAttrs config.stylix.base16Scheme;
name = "zen";
in {
imports = [
(import ../../../lib/foxextensions.nix
{inherit lib dashNixAdditionalProps pkgs name;})
];
options.mods.browser.${name} = {
enable = lib.mkOption { enable = lib.mkOption {
default = false; default = false;
example = true; example = true;
type = lib.types.bool; type = lib.types.bool;
description = "Enables the zen browser"; description = "Enables the zen browser";
}; };
configuration = lib.mkOption { # TODO configure zen
default = {
EnableTrackingProtection = {
Value = true;
Locked = true;
Cryptomining = true;
Fingerprinting = true;
};
DisablePocket = true;
CaptivePortal = false;
DisableFirefoxStudies = true;
DisableTelemetry = true;
NoDefaultBookmarks = true;
PasswordManagerEnabled = false;
FirefoxHome = {
Search = true;
Pocket = false;
Snippets = false;
TopSites = true;
Highlights = false;
};
UserMessaging = {
ExtensionRecommendations = false;
SkipOnboarding = true;
};
"3rdparty".Extensions = {
"addon@darkreader.org" = {
theme = {
darkSchemeBackgroundColor = "#${scheme.base00}";
darkSchemeTextColor = "#${scheme.base05}";
};
previewNewDesign = true;
};
};
};
example = {};
type = with lib.types; attrsOf anything;
description = "Zen policy configuration. See https://mozilla.github.io/policy-templates for more information.";
};
profiles = lib.mkOption {
default = [
{
name = "${config.conf.username}";
value = {
settings = {
"zen.view.compact.hide-tabbar" = false;
"zen.view.compact.hide-toolbar" = true;
"zen.view.sidebar-expanded" = false;
"zen.view.use-single-toolbar" = false;
"zen.view.welcome-screen.seen" = true;
"zen.theme.accent-color" = "#b4bbff";
"extensions.autoDisableScopes" = 0;
"cookiebanners.service.mode" = 2;
"widget.use-xdg-desktop-portal.file-picker" = 1;
};
isDefault = true;
id = 0;
};
}
{
name = "special";
value = {
settings = {
"zen.view.compact.hide-tabbar" = false;
"zen.view.compact.hide-toolbar" = true;
"zen.view.sidebar-expanded" = false;
"zen.view.use-single-toolbar" = false;
"zen.view.welcome-screen.seen" = true;
"zen.theme.accent-color" = "#b4bbff";
"extensions.autoDisableScopes" = 0;
"widget.use-xdg-desktop-portal.file-picker" = 1;
};
isDefault = false;
id = 1;
};
}
];
example = [
{
name = "custom";
value = {
settings = {
extensions.autoDisableScopes = 0;
};
extensions.packages = [pkgs.nur.repos.rycee.firefox-addons.darkreader];
isDefault = true;
id = 0;
};
}
];
type = with lib.types; listOf (attrsOf anything);
description = "Zen profiles";
};
}; };
config = lib.mkIf (config.mods.browser.zen.enable || config.mods.homePackages.browser == "zen") ( config = lib.mkIf config.mods.browser.zen.enable (
(lib.optionalAttrs (options ? home.packages) { lib.optionalAttrs (options ? home.packages) {
programs.zen-browser = { home.packages = [inputs.zen-browser.packages."${system}".default];
enable = true; }
package =
pkgs.wrapFirefox
inputs.zen-browser.packages.${system}.zen-browser-unwrapped
{
pname = "zen-browser";
extraPolicies =
config.mods.browser.zen.configuration
// {
ExtensionSettings = builtins.foldl' (acc: ext: acc // ext) {} (config.mods.browser.zen.extensions
++ (
if config.mods.browser.firefox.darkreader
then [
{
"addon@darkreader.org" = {
install_url = "file://${pkgs.callPackage ../../../patches/darkreader.nix {inherit lib dashNixAdditionalProps;}}/latest.xpi";
installation_mode = "normal_installed";
};
}
]
else []
));
};
};
profiles = builtins.listToAttrs config.mods.browser.zen.profiles;
};
})
// (lib.optionalAttrs (options ? stylix.targets.zen-browser) {
stylix.targets.zen-browser.profileNames = lib.map (profile: profile.name) config.mods.browser.zen.profiles;
})
); );
} }

View file

@ -1,60 +0,0 @@
{
lib,
config,
options,
pkgs,
...
}: {
options.mods.clam = {
enable = lib.mkOption {
default = true;
example = false;
type = lib.types.bool;
description = "Enables the clamav program and its daemon";
};
scanner = {
enable = lib.mkOption {
default = false;
example = true;
type = lib.types.bool;
description = "Enables the clamav scanner";
};
interval = lib.mkOption {
type = lib.types.str;
default = "*-*-* 04:00:00";
description = ''
How often clamdscan is invoked.
By default this runs using 10 cores at most, be sure to run it at a time of low traffic.
'';
};
scanDirectories = lib.mkOption {
type = with lib.types; listOf str;
default = [
"/home"
"/var/lib"
"/tmp"
"/etc"
"/var/tmp"
];
description = ''List of directories to scan'';
};
};
};
config = lib.mkIf config.mods.clam.enable (
lib.optionalAttrs (options ? services.clamav) {
services.clamav = {
daemon.enable = true;
updater.enable = true;
scanner = {
inherit (config.mods.clam.scanner) enable;
inherit (config.mods.clam.scanner) interval;
inherit (config.mods.clam.scanner) scanDirectories;
};
};
environment.systemPackages = [
pkgs.clamav
];
}
// lib.optionalAttrs (options ? home.packages) {home.packages = with pkgs; [clamtk];}
);
}

View file

@ -1,15 +1,10 @@
{ {
mkDashDefault,
lib, lib,
config, config,
pkgs, pkgs,
options, options,
inputs,
system,
... ...
}: let }: {
font_family = "${config.mods.stylix.fonts.monospace.name}";
in {
options.mods = { options.mods = {
coding = { coding = {
enable = lib.mkOption { enable = lib.mkOption {
@ -52,86 +47,6 @@ in {
description = "Extensions to be installed"; description = "Extensions to be installed";
}; };
}; };
penpot = lib.mkOption {
default = false;
example = true;
type = lib.types.bool;
description = "Enables penpot";
};
neovide = {
enable = lib.mkOption {
default = false;
example = true;
type = lib.types.bool;
description = "Enables neovide";
};
config = lib.mkOption {
default = {
font = {
size = 12;
normal = {
family = font_family;
style = "";
};
bold = {
family = font_family;
style = "ExtraBold";
};
italic = {
family = font_family;
style = "Italic";
};
bold_italic = {
family = font_family;
style = "Bold Italic";
};
};
};
example = {};
type = with lib.types; attrsOf anything;
description = "Config for neovide";
};
};
gh = {
enable = lib.mkOption {
default = true;
example = false;
type = lib.types.bool;
description = "Enables and configures gh";
};
config = lib.mkOption {
default = {
version = 1;
git_protocol = "ssh";
editor = "";
prompt = "enabled";
prefer_editor_prompt = "disabled";
pager = "";
aliases = {
co = "pr checkout";
};
http_unix_socket = "";
browser = "";
};
example = {};
type = with lib.types; attrsOf anything;
description = "config for gh. Keep in mind, empty values refer to using environment variables";
};
hosts = lib.mkOption {
default = {
"github.com" = {
git_protocol = "ssh";
users = {
${config.mods.git.username} = "";
};
user = "${config.mods.git.username}";
};
};
example = {};
type = with lib.types; attrsOf anything;
description = "hosts for gh";
};
};
useDefaultPackages = lib.mkOption { useDefaultPackages = lib.mkOption {
default = true; default = true;
example = false; example = false;
@ -180,6 +95,7 @@ in {
default = with pkgs; [ default = with pkgs; [
typst typst
tinymist tinymist
ltex-ls
]; ];
example = []; example = [];
type = with lib.types; listOf package; type = with lib.types; listOf package;
@ -307,15 +223,13 @@ in {
packages = lib.mkOption { packages = lib.mkOption {
default = with pkgs; [ default = with pkgs; [
#.! #.!
(with dotnetCorePackages; dotnet-sdk
combinePackages [ omnisharp-roslyn
sdk_8_0
sdk_9_0
])
csharpier csharpier
netcoredbg netcoredbg
#fsharp
fsharp fsharp
fsautocomplete #fsautocomplete
]; ];
example = []; example = [];
type = with lib.types; listOf package; type = with lib.types; listOf package;
@ -335,8 +249,8 @@ in {
}; };
packages = lib.mkOption { packages = lib.mkOption {
default = with pkgs; [ default = with pkgs; [
bear # broke
gdb #bear
gcc gcc
clang-tools clang-tools
]; ];
@ -513,45 +427,47 @@ in {
d-spy d-spy
tmux tmux
tmate tmate
inputs.compose.packages.${system}.default
]; ];
font_family = "${config.mods.stylix.fonts.monospace.name}";
in in
lib.mkIf config.mods.coding.enable ( lib.mkIf config.mods.coding.enable (
lib.optionalAttrs (options ? home.packages) { lib.optionalAttrs (options ? home.packages) {
programs.dashvim = lib.mkIf config.mods.coding.dashvim { programs.dashvim = lib.mkIf config.mods.coding.dashvim {
enable = true; enable = true;
inherit (config.mods.stylix) colorscheme; colorscheme = config.mods.stylix.colorscheme;
}; };
programs.vscode = lib.mkIf config.mods.coding.vscodium.enable { programs.vscode = lib.mkIf config.mods.coding.vscodium.enable {
enable = true; enable = true;
package = mkDashDefault pkgs.vscodium; package = pkgs.vscodium;
profiles.default.extensions = config.mods.coding.vscodium.extensions; profiles.default.extensions = config.mods.coding.vscodium.extensions;
}; };
xdg.configFile = { xdg.configFile."neovide/config.toml" = lib.mkIf config.mods.coding.dashvim {
"neovide/config.toml" = lib.mkIf (config.mods.coding.dashvim || config.mods.coding.neovide.enable) { source = (pkgs.formats.toml {}).generate "neovide" {
source = font = {
(pkgs.formats.toml {}).generate "neovide" size = 12;
config.mods.coding.neovide.config; normal = {
}; family = font_family;
style = "";
"gh/config.yml" = lib.mkIf config.mods.coding.gh.enable { };
source = bold = {
(pkgs.formats.yaml {}).generate "config" family = font_family;
config.mods.coding.gh.config; style = "ExtraBold";
}; };
"gh/hosts.yml" = lib.mkIf config.mods.coding.gh.enable { italic = {
source = family = font_family;
(pkgs.formats.yaml {}).generate "hosts" style = "Italic";
config.mods.coding.gh.hosts; };
bold_italic = {
family = font_family;
style = "Bold Italic";
};
};
}; };
}; };
home.packages = with pkgs; home.packages = with pkgs;
[ [
(lib.mkIf (config.mods.coding.dashvim || config.mods.coding.neovide.enable) neovide) (lib.mkIf config.mods.coding.dashvim neovide)
(lib.mkIf config.mods.coding.jetbrains jetbrains-toolbox) (lib.mkIf config.mods.coding.jetbrains jetbrains-toolbox)
(lib.mkIf config.mods.coding.penpot pkgs.penpot-desktop)
(lib.mkIf config.mods.coding.gh.enable gh)
] ]
++ config.mods.coding.additionalPackages ++ config.mods.coding.additionalPackages
++ (lib.lists.optionals config.mods.coding.useDefaultPackages basePackages) ++ (lib.lists.optionals config.mods.coding.useDefaultPackages basePackages)

View file

@ -1,5 +1,4 @@
{ {
mkDashDefault,
lib, lib,
config, config,
options, options,
@ -43,37 +42,39 @@
description = "Container packages"; description = "Container packages";
}; };
}; };
config = lib.optionalAttrs (options ? environment.systemPackages) { config = (
environment.systemPackages = lib.optionalAttrs (options ? environment.systemPackages) {
(lib.lists.optionals ( environment.systemPackages =
config.mods.containers.variant == "podman" (lib.lists.optionals (
) config.mods.containers.variant == "podman"
config.mods.containers.podmanPackages) )
++ (lib.lists.optionals ( config.mods.containers.podmanPackages)
config.mods.containers.variant == "docker" ++ (lib.lists.optionals (
) config.mods.containers.variant == "docker"
config.mods.containers.dockerPackages) )
++ (lib.lists.optionals ( config.mods.containers.dockerPackages)
config.mods.containers.variant == "podman" || config.mods.containers.variant == "docker" ++ (lib.lists.optionals (
) config.mods.containers.variant == "podman" || config.mods.containers.variant == "docker"
config.mods.containers.combinedPackages); )
virtualisation = config.mods.containers.combinedPackages);
if (config.mods.containers.variant == "podman") virtualisation =
then { if (config.mods.containers.variant == "podman")
containers.enable = true; then {
podman = { containers.enable = true;
enable = true; podman = {
dockerCompat = mkDashDefault true; enable = true;
defaultNetwork.settings.dns_enabled = mkDashDefault true; dockerCompat = true;
}; defaultNetwork.settings.dns_enabled = true;
} };
else if (config.mods.containers.variant == "docker") }
then { else if (config.mods.containers.variant == "docker")
containers.enable = true; then {
docker = { containers.enable = true;
enable = true; docker = {
}; enable = true;
} };
else {}; }
}; else {};
}
);
} }

View file

@ -1,16 +1,12 @@
{ {
imports = [ imports = [
./acpid.nix ./acpid.nix
./anyrun.nix
./basePackages.nix ./basePackages.nix
./bluetooth.nix ./bluetooth.nix
./browser ./browser
./clam.nix
./coding.nix ./coding.nix
./containers.nix ./containers.nix
./drives.nix ./drives.nix
./fancontrol.nix
./fastfetch.nix
./fish.nix ./fish.nix
./flatpak.nix ./flatpak.nix
./gaming.nix ./gaming.nix
@ -21,8 +17,7 @@
./gpu.nix ./gpu.nix
./greetd.nix ./greetd.nix
./homePackages.nix ./homePackages.nix
./hypr ./hyprland
./ironbar.nix
./kde.nix ./kde.nix
./kdeConnect.nix ./kdeConnect.nix
./keepassxc.nix ./keepassxc.nix
@ -31,8 +26,6 @@
./mime.nix ./mime.nix
./ncspot.nix ./ncspot.nix
./nextcloud.nix ./nextcloud.nix
./niri.nix
./onedrive.nix
./oxi ./oxi
./piper.nix ./piper.nix
./plymouth.nix ./plymouth.nix
@ -41,14 +34,11 @@
./sddm.nix ./sddm.nix
./sops.nix ./sops.nix
./starship.nix ./starship.nix
./streamcontroller.nix
./stylix.nix ./stylix.nix
./superfreq.nix
./supersonic.nix ./supersonic.nix
./sway.nix ./sway.nix
./teams.nix ./teams.nix
./virtmanager.nix ./virtmanager.nix
./wm.nix
./xkb.nix ./xkb.nix
./xone.nix ./xone.nix
./yazi ./yazi

View file

@ -4,309 +4,135 @@
options, options,
... ...
}: { }: {
options.mods.drives = { options.mods = {
variant = lib.mkOption { drives = {
default = "manual"; useSwap = {
example = "disko"; enable = lib.mkOption {
type = with lib.types; (enum [ default = true;
"manual" example = false;
"disko" type = lib.types.bool;
]); description = ''
description = '' Use default drive config
Disk configuration type, either "manual" for regular NixOS disk configuration, '';
or "disko" for using disko to automatically format your drives. };
''; };
}; defaultDrives = {
useSwap = lib.mkOption { enable = lib.mkOption {
default = true; default = true;
example = false; example = false;
type = lib.types.bool; type = lib.types.bool;
description = '' description = ''
Use swap in drive. Use default drive config
''; '';
}; };
useEncryption = lib.mkOption { };
default = false; extraDrives = lib.mkOption {
example = true; default = [
type = lib.types.bool; ];
description = '' example = [
Enables encryption. {
!WARNING! name = "drive2";
You need your root drive to be named root exactly! drive = {
Otherwise there will not be a root crypt! device = "/dev/disk/by-label/DRIVE2";
!WARNING! fsType = "ext4";
''; options = [
}; "noatime"
homeAndRootFsTypes = lib.mkOption { "nodiratime"
default = "ext4"; "discard"
example = "btrfs"; ];
type = with lib.types; (enum [ };
"btrfs" }
"ext2" ];
"ext3" # TODO: how to make this work
"ext4" # type = with lib.types; listOf (attrsOf driveModule);
"exfat" type = with lib.types; listOf (attrsOf anything);
"f2fs"
"fat8"
"fat16"
"fat32"
"ntfs"
"xfs"
"zfs"
]);
description = ''
Filesystem for the home and root partitions.
'';
};
defaultDrives = {
enable = lib.mkOption {
default = true;
example = false;
type = lib.types.bool;
description = '' description = ''
Use default drive config. Extra drives to add.
- Manual variant
This config expects 4 different partitions on a single drive:
- boot partition with BOOT label and vfat format (filesystem configurable)
- swap partition with SWAP label
- root partition with ROOT label and ext4 format (filesystem configurable)
- home partition with HOME label and ext4 format (filesystem configurable)
- gpt disk format
NOTE: Any different configuration must be done manually with this turned off.
- Disko variant
This config creates 4 different partitions on a single drive:
- boot partition with 1GB size and vfat format
- swap partition with 32GB (size configurable)
- root partition with 30% size and ext4 format (size and filesystem configurable)
- home partition with 70%~ size and ext4 format (size and filesystem configurable)
- gpt disk format
NOTE: Any different configuration must be done manually with this turned off.
''; '';
}; };
}; };
extraDrives = lib.mkOption { };
default = [
]; config = (
example = [ lib.optionalAttrs (options ? fileSystems) {
{ disko.devices = {
name = "drive2"; disk =
drive = { {
device = "/dev/disk/by-label/DRIVE2"; main = (lib.optionalAttrs config.mods.drives.defaultDrives.enable) {
fsType = "ext4"; device = "${config.conf.defaultDiskId}";
options = [ type = "disk";
"noatime" content = {
"nodiratime" type = "gpt";
"discard" partitions = {
]; root = {
}; start = "33G";
} end = "30%";
]; content = {
type = with lib.types; listOf (attrsOf anything); type = "filesystem";
description = '' format = "btrfs";
Extra drives to add. mountpoint = "/";
Please ensure to add variant compliant attrsets (manual/disko). mountOptions = [
(The example is for manual variant, here an example for disko): "noatime"
```nix "nodiratime"
drive2 = (lib.optionalAttrs config.mods.drives.defaultDrives.enable) { "discard"
device = "/dev/nvme1n1" ];
type = "disk"; };
content = { };
type = "gpt"; plainSwap = {
partitions = { start = "1G";
drive2 = { end = "33G";
start = "0%"; content = {
end = "100%"; type = "swap";
content = { discardPolicy = "both";
type = "filesystem"; resumeDevice = true;
format = "ext4"; };
mountpoint = "/drive2"; };
mountOptions = [ boot = {
"noatime" start = "0G";
"nodiratime" end = "1G";
"discard" content = {
]; type = "filesystem";
format = "vfat";
mountpoint = "/boot";
mountOptions = [
"rw"
"fmask=0022"
"dmask=0022"
"noatime"
];
};
};
home = {
start = "30%";
end = "100%";
content = {
type = "filesystem";
format = "btrfs";
mountpoint = "/home";
mountOptions = [
"noatime"
"nodiratime"
"discard"
];
};
}; };
}; };
}; };
}; };
};
```
'';
};
disko = {
defaultDiskId = lib.mkOption {
default = "TODO";
example = "/dev/nvme0n1";
type = lib.types.str;
description = "The name, ID, UUID or similar for the default drive.";
};
rootAmount = lib.mkOption {
default = 30;
example = 40;
type = lib.types.number;
description = "The percentage of the disk for root. (Home will take up the rest) (Only for disko)";
};
swapAmount = lib.mkOption {
default = 32;
example = 64;
type = lib.types.number;
description = "The amount of swap to use. (Only for disko)";
};
};
};
config = lib.optionalAttrs (options ? fileSystems) {
boot.initrd.luks.devices = lib.mkIf (config.mods.drives.variant == "manual" && config.mods.drives.useEncryption) (
builtins.listToAttrs (
map (
{
name,
drive,
}: {
cryptstorage.device = lib.mkIf (name != "root") drive?device;
cryptoroot.device = lib.mkIf (name == "root") drive?device;
} }
) // builtins.listToAttrs (
config.mods.drives.extraDrives map (
) {
); name,
drive,
fileSystems = lib.mkIf (config.mods.drives.variant == "manual" && !config.conf.wsl) ( }: {
builtins.listToAttrs ( name = "/" + name;
map ( value = drive;
{ }
name, )
drive, config.mods.drives.extraDrives
}: { );
name = "/" + name; };
value = drive; }
} );
)
config.mods.drives.extraDrives
)
// (lib.optionalAttrs config.mods.drives.defaultDrives.enable) {
"/" = {
device = "/dev/disk/by-label/ROOT";
fsType = config.mods.drives.homeAndRootFsTypes;
options = [
"noatime"
"nodiratime"
"discard"
];
};
"/boot" = {
device = "/dev/disk/by-label/BOOT";
fsType = "vfat";
options = [
"rw"
"fmask=0022"
"dmask=0022"
"noatime"
];
};
"/home" = {
device = "/dev/disk/by-label/HOME";
fsType = config.mods.drives.homeAndRootFsTypes;
options = [
"noatime"
"nodiratime"
"discard"
];
};
}
);
swapDevices = lib.mkIf (config.mods.drives.useSwap && config.mods.drives.variant == "manual" && !config.conf.wsl) [
{device = "/dev/disk/by-label/SWAP";}
];
disko.devices = lib.mkIf (config.mods.drives.variant == "disko") {
disk =
{
main = (lib.optionalAttrs config.mods.drives.defaultDrives.enable) {
device = "${config.mods.drives.disko.defaultDiskId}";
type = "disk";
content = {
type = "gpt";
partitions = {
root = {
start = "${
if config.mods.drives.useSwap
then builtins.toString config.mods.drives.disko.swapAmount
else builtins.toString 1
}G";
end = "${builtins.toString config.mods.drives.disko.rootAmount}%";
content = {
type = "filesystem";
format = config.mods.drives.homeAndRootFsTypes;
mountpoint = "/";
mountOptions = [
"noatime"
"nodiratime"
"discard"
];
};
};
plainSwap = {
start = "1G";
end = "33G";
content = {
type = "swap";
discardPolicy = "both";
resumeDevice = true;
};
};
boot = {
start = "0G";
end = "1G";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
mountOptions = [
"rw"
"fmask=0022"
"dmask=0022"
"noatime"
];
};
};
home = {
start = "${builtins.toString config.mods.drives.disko.rootAmount}%";
end = "100%";
content = {
type = "filesystem";
format = config.mods.drives.homeAndRootFsTypes;
mountpoint = "/home";
mountOptions = [
"noatime"
"nodiratime"
"discard"
];
};
};
};
};
};
}
// builtins.listToAttrs (
map (
{
name,
drive,
}: {
name = "/" + name;
value = drive;
}
)
config.mods.drives.extraDrives
);
};
};
} }

View file

@ -1,37 +0,0 @@
{
lib,
pkgs,
config,
options,
...
}: {
options.mods.fancontrol = {
enable = lib.mkOption {
default = false;
example = true;
type = lib.types.bool;
description = "Enables fancontrol-gui with needed drivers";
};
forceId = lib.mkOption {
default = null;
example = "force_id=0x8628";
type = with lib.types; nullOr str;
description = "Modprobe options for the it87 driver. Information at: https://wiki.archlinux.org/title/Lm_sensors#Gigabyte_B250/Z370/B450M/B560M/B660M/Z690/B550_motherboards";
};
};
config = lib.mkIf config.mods.fancontrol.enable (
lib.optionalAttrs (options ? home.packages) {
home.packages = [pkgs.fancontrol-gui];
}
// (lib.optionalAttrs (options ? boot.kernelModules) {
boot = {
kernelParams = ["acpi_enforce_resources=lax"];
extraModulePackages = with config.boot.kernelPackages; [liquidtux it87];
kernelModules = ["v4l2loopback" "it87"];
extraModprobeConfig = lib.mkIf (config.mods.fancontrol.forceId != null) ''
options it87 ${config.mods.fancontrol.forceId}
'';
};
})
);
}

View file

@ -1,75 +0,0 @@
{
pkgs,
lib,
options,
config,
...
}: {
options.mods.dashfetch = {
enable = lib.mkOption {
default = true;
example = false;
type = lib.types.bool;
description = "A custom configuration for fastfetch";
};
modules = lib.mkOption {
default = [
"title"
"separator"
{
type = "os";
key = "OS";
format = "DashNix ({name} {version})";
}
"host"
"kernel"
"uptime"
"packages"
"shell"
"display"
"de"
"wm"
"wmtheme"
"theme"
"icons"
"font"
"cursor"
"terminal"
"terminalfont"
"cpu"
"gpu"
"memory"
"swap"
"disk"
"localip"
"battery"
"poweradapter"
"locale"
"break"
"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 = "kitty";
source = ../../assets/logo2.png;
width = 35;
padding = {
top = 1;
};
};
modules = config.mods.dashfetch.modules;
};
};
};
}

View file

@ -52,11 +52,9 @@ in {
alias rebuild='nh os switch -- --accept-flake-config' alias rebuild='nh os switch -- --accept-flake-config'
alias update='nix flake update --flake $FLAKE --accept-flake-config' alias update='nix flake update --flake $FLAKE --accept-flake-config'
alias gcli='gh'
abbr --add ls 'lsd' abbr --add ls 'lsd'
abbr --add :q 'exit' abbr --add :q 'exit'
abbr --add gh 'git push origin' abbr --add gh 'git push origin'
abbr --add gu 'git push upstream'
abbr --add gl 'git pull origin' abbr --add gl 'git pull origin'
abbr --add gm 'git commit -m' abbr --add gm 'git commit -m'
abbr --add ga "git add -A" abbr --add ga "git add -A"
@ -70,7 +68,7 @@ in {
abbr --add cat 'bat' abbr --add cat 'bat'
abbr --add find 'fd' abbr --add find 'fd'
abbr --add rm 'rip' abbr --add rm 'rip'
abbr --add cp 'cpz' abbr --add cp 'fcp'
abbr --add cd 'z' abbr --add cd 'z'
abbr --add y 'yazi' abbr --add y 'yazi'

View file

@ -7,15 +7,37 @@
}: { }: {
options.mods.flatpak = { options.mods.flatpak = {
enable = lib.mkOption { enable = lib.mkOption {
default = false; default = true;
example = true; example = false;
type = lib.types.bool; type = lib.types.bool;
description = "Enables the flatpak package manager"; description = "Enables the flatpak package manager";
}; };
additional_packages = lib.mkOption {
default = [];
example = [];
type = with lib.types; listOf str;
description = "Flatpak packages";
};
}; };
config = lib.mkIf config.mods.flatpak.enable ( config = lib.mkIf config.mods.flatpak.enable (
lib.optionalAttrs (options ? environment.systemPackages) { lib.optionalAttrs (options ? services.flatpak.remote) {
environment.systemPackages = [pkgs.flatpak]; environment.systemPackages = [pkgs.flatpak];
services.flatpak.remotes = lib.mkOptionDefault [
{
name = "flathub-stable";
location = "https://dl.flathub.org/repo/flathub.flatpakrepo";
}
];
services.flatpak.uninstallUnmanaged = true;
}
// lib.optionalAttrs (options ? services.flatpak.packages) {
services.flatpak.packages =
[
# fallback if necessary, but generally avoided as nix is superior :)
# default flatseal installation since flatpak permissions are totally not a broken idea
"com.github.tchx84.Flatseal"
]
++ config.mods.flatpak.additional_packages;
} }
); );
} }

View file

@ -1,5 +1,4 @@
{ {
mkDashDefault,
lib, lib,
config, config,
options, options,
@ -15,33 +14,24 @@
}; };
tools = lib.mkOption { tools = lib.mkOption {
default = with pkgs; [ default = with pkgs; [
protonplus
gamescope
gamemode gamemode
steam steam
# TODO broken lutris
# lutris
wineWowPackages.stable wineWowPackages.stable
adwsteamgtk adwsteamgtk
heroic # TODO broken
#heroic
mangohud mangohud
nexusmods-app
steamtinkerlaunch
winetricks
]; ];
example = []; example = [];
type = with lib.types; listOf package; type = with lib.types; listOf package;
description = "Install gaming related packages"; description = "Install gaming related packages";
}; };
kernel = lib.mkOption { kernel = lib.mkOption {
default = false; default = true;
example = true; example = false;
type = lib.types.bool; type = lib.types.bool;
description = '' description = "Whether to use the CachyOS kernel";
Whether to use the CachyOS kernel.
WARNING: This is a manual compiled kernel!
(Please also ensure you use your own input hash for the source as the compilation can often fail due to temporary broken changes.)
'';
}; };
steam = lib.mkOption { steam = lib.mkOption {
default = true; default = true;
@ -55,18 +45,6 @@
type = lib.types.bool; type = lib.types.bool;
description = "Whether to use gamemode"; description = "Whether to use gamemode";
}; };
pinCores = lib.mkOption {
default = "false";
example = "true";
type = lib.types.str;
description = "Pin Cores gamemode config";
};
parkCores = lib.mkOption {
default = "false";
example = "true";
type = lib.types.str;
description = "Park Cores gamemode config";
};
gpuOptimization = lib.mkOption { gpuOptimization = lib.mkOption {
default = true; default = true;
example = false; example = false;
@ -79,67 +57,30 @@
type = lib.types.int; type = lib.types.int;
description = "Your gpu device.(Physical id of lshw)"; description = "Your gpu device.(Physical id of lshw)";
}; };
scheduler = lib.mkOption {
default = "scx_rustland";
example = "scx_rusty";
type = with lib.types;
nullOr (enum [
"scx_bpfland"
"scx_chaos"
"scx_cosmos"
"scx_central"
"scx_flash"
"scx_flatcg"
"scx_lavd"
"scx_layered"
"scx_mitosis"
"scx_nest"
"scx_p2dq"
"scx_pair"
"scx_prev"
"scx_qmap"
"scx_rlfifo"
"scx_rustland"
"scx_rusty"
"scx_sdt"
"scx_simple"
"scx_tickless"
"scx_userland"
"scx_wd40"
]);
description = "Scheduler to use, null disables this";
};
}; };
config = lib.mkIf config.mods.gaming.enable ( config = lib.mkIf config.mods.gaming.enable (
lib.optionalAttrs (options ? environment.systemPackages) { lib.optionalAttrs (options ? environment.systemPackages) {
environment.systemPackages = config.mods.gaming.tools; environment.systemPackages = config.mods.gaming.tools;
boot.kernelPackages = lib.mkForce pkgs.cachyosKernels.linuxPackages-cachyos-latest; boot.kernelPackages = lib.mkForce pkgs.linuxPackages_cachyos;
services.scx = lib.mkIf (config.mods.gaming.scheduler != null) {
enable = true;
inherit (config.mods.gaming) scheduler;
};
programs = { programs = {
steam.enable = mkDashDefault config.mods.gaming.steam; steam.enable = config.mods.gaming.steam;
gamemode.enable = true; gamemode.enable = true;
gamemode = { gamemode = {
enableRenice = true;
settings = { settings = {
general = { general = {
desiredgov = mkDashDefault "performance"; desiredgov = "performance";
};
cpu = {
pin_cores = mkDashDefault config.mods.gaming.pinCores;
park_cores = mkDashDefault config.mods.gaming.parkCores;
}; };
gpu = lib.mkIf config.mods.gaming.gpuOptimization { gpu = lib.mkIf config.mods.gaming.gpuOptimization {
apply_gpu_optimisations = mkDashDefault "accept-responsibility"; apply_gpu_optimisations = "accept-responsibility";
gpu_device = mkDashDefault config.mods.gaming.gpuDevice; gpu_device = config.mods.gaming.gpuDevice;
amd_performance_level = mkDashDefault "high"; amd_performance_level = "high";
nv_powermizer_mode = mkDashDefault 1; nv_powermizer_mode = 1;
}; };
custom = { custom = {
start = mkDashDefault "notify-send -a 'Gamemode' 'Optimizations activated'"; start = "notify-send -a 'Gamemode' 'Optimizations activated'";
end = mkDashDefault "notify-send -a 'Gamemode' 'Optimizations deactivated'"; end = "notify-send -a 'Gamemode' 'Optimizations deactivated'";
}; };
}; };
}; };

View file

@ -6,13 +6,13 @@
}: { }: {
options.mods.git = { options.mods.git = {
username = lib.mkOption { username = lib.mkOption {
default = ""; default = "DashieTM";
example = "globi"; example = "globi";
type = lib.types.str; type = lib.types.str;
description = "Git user name"; description = "Git user name";
}; };
email = lib.mkOption { email = lib.mkOption {
default = ""; default = "fabio.lenherr@gmail.com";
example = "globi@globus.glob"; example = "globi@globus.glob";
type = lib.types.str; type = lib.types.str;
description = "Git email"; description = "Git email";
@ -34,31 +34,40 @@
description = "Additional git config"; description = "Additional git config";
}; };
sshConfig = lib.mkOption { sshConfig = lib.mkOption {
default = ""; default = ''
example = ''
Host github.com Host github.com
${ ${
if (config ? sops.secrets && config.sops.secrets ? hub.path) if (config ? sops.secrets && config.sops.secrets ? hub.path)
then "IdentityFile ${config.sops.secrets.hub.path}" then "IdentityFile ${config.sops.secrets.hub.path}"
else "" else ""
} }
Host gitlab.com
${
if (config ? sops.secrets && config.sops.secrets ? lab.path)
then "IdentityFile ${config.sops.secrets.lab.path}"
else ""
}
Host dashie.org
${
if (config ? sops.secrets && config.sops.secrets ? dashie.path)
then "IdentityFile ${config.sops.secrets.dashie.path}"
else ""
}
''; '';
example = "";
type = lib.types.lines; type = lib.types.lines;
description = "ssh configuration (keys for git)"; description = "ssh configuration (keys for git)";
}; };
}; };
config = lib.optionalAttrs (options ? programs.git && options ? home.file) { config = (
programs.git = { lib.optionalAttrs (options ? programs.git && options ? home.file) {
enable = true; programs.git = {
settings = enable = true;
{ userName = config.mods.git.username;
user = { userEmail = config.mods.git.email;
name = config.mods.git.username; extraConfig = config.mods.git.additionalConfig;
inherit (config.mods.git) email; };
}; home.file.".ssh/config".text = config.mods.git.sshConfig;
} }
// config.mods.git.additionalConfig; );
};
home.file.".ssh/config".text = config.mods.git.sshConfig;
};
} }

View file

@ -71,7 +71,6 @@
nautilus nautilus
sushi sushi
nautilus-python nautilus-python
nautilus-open-any-terminal
]; ];
in in
lib.mkIf config.mods.nautilus.enable packages; lib.mkIf config.mods.nautilus.enable packages;

View file

@ -1,5 +1,4 @@
{ {
mkDashDefault,
lib, lib,
config, config,
options, options,
@ -67,16 +66,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 = mkDashDefault "radeonsi"; RUSTICL_ENABLE = "radeonsi";
} }
else {}; else {};
hardware = { hardware = {
nvidia = lib.mkIf config.mods.gpu.nvidia.enable { nvidia = lib.mkIf config.mods.gpu.nvidia.enable {
modesetting.enable = mkDashDefault true; modesetting.enable = true;
open = mkDashDefault true; open = true;
nvidiaSettings = mkDashDefault true; nvidiaSettings = true;
package = mkDashDefault config.boot.kernelPackages.nvidiaPackages.beta; package = config.boot.kernelPackages.nvidiaPackages.beta;
}; };
graphics = let graphics = let
amdPackages = [ amdPackages = [
@ -87,8 +86,8 @@
pkgs.intel-media-driver) pkgs.intel-media-driver)
(lib.mkIf config.mods.gpu.vapi.enable pkgs.libvdpau-va-gl) (lib.mkIf config.mods.gpu.vapi.enable pkgs.libvdpau-va-gl)
(lib.mkIf config.mods.gpu.vapi.enable pkgs.libva) (lib.mkIf config.mods.gpu.vapi.enable pkgs.libva)
(lib.mkIf config.mods.gpu.vapi.enable pkgs.libva-vdpau-driver) (lib.mkIf config.mods.gpu.vapi.enable pkgs.vaapiVdpau)
(lib.mkIf (config.mods.gpu.intelgpu.enable || config.mods.gpu.amdgpu.enable) pkgs.mesa) (lib.mkIf (config.mods.gpu.intelgpu.enable || config.mods.gpu.amdgpu.enable) pkgs.mesa.drivers)
]; ];
rocmPackages = [ rocmPackages = [
pkgs.rocmPackages.clr.icd pkgs.rocmPackages.clr.icd
@ -101,7 +100,7 @@
]; ];
in { in {
enable = true; enable = true;
enable32Bit = mkDashDefault true; enable32Bit = lib.mkDefault true;
extraPackages = extraPackages =
amdPackages amdPackages
++ (lib.lists.optionals (config.mods.gpu.vapi.rocm.enable && config.mods.gpu.amdgpu.enable) rocmPackages); ++ (lib.lists.optionals (config.mods.gpu.vapi.rocm.enable && config.mods.gpu.amdgpu.enable) rocmPackages);

View file

@ -1,11 +1,9 @@
{ {
mkDashDefault,
config, config,
lib, lib,
inputs, inputs,
pkgs, pkgs,
options, options,
system,
... ...
}: { }: {
options.mods = { options.mods = {
@ -19,10 +17,7 @@
''; '';
}; };
monitor = lib.mkOption { monitor = lib.mkOption {
default = default = "${config.conf.defaultMonitor}";
if config.mods.wm.monitors != []
then (builtins.elemAt config.mods.wm.monitors 0).name
else "";
example = "eDP-1"; example = "eDP-1";
type = lib.types.str; type = lib.types.str;
description = '' description = ''
@ -31,10 +26,7 @@
''; '';
}; };
scale = lib.mkOption { scale = lib.mkOption {
default = default = "${config.conf.defaultMonitorScale}";
if config.mods.wm.monitors != []
then builtins.toString (builtins.elemAt config.mods.wm.monitors 0).scale
else "";
example = "1.5"; example = "1.5";
type = lib.types.str; type = lib.types.str;
description = '' description = ''
@ -44,23 +36,16 @@
}; };
greeterCommand = lib.mkOption { greeterCommand = lib.mkOption {
default = "${ default = "${
lib.getExe inputs.hyprland.packages.${system}.hyprland lib.getExe inputs.hyprland.packages.${config.conf.system}.hyprland
} --config /etc/greetd/hyprgreet.conf"; } --config /etc/greetd/hyprgreet.conf";
example = "${ example = "${
lib.getExe pkgs.cage lib.getExe pkgs.cage
} -s -- ${lib.getExe pkgs.regreet}"; } -s -- ${lib.getExe pkgs.greetd.regreet}";
type = lib.types.str; type = lib.types.str;
description = "The compositor/greeter command to run"; description = "The compositor/greeter command to run";
}; };
resolution = lib.mkOption { resolution = lib.mkOption {
default = default = "${config.conf.defaultMonitorMode}";
if config.mods.wm.monitors != []
then let
resX = builtins.toString (builtins.elemAt config.mods.wm.monitors 0).resolutionX;
resY = builtins.toString (builtins.elemAt config.mods.wm.monitors 0).resolutionY;
refresh = builtins.toString (builtins.elemAt config.mods.wm.monitors 0).refreshrate;
in "${resX}x${resY}@${refresh}"
else "";
example = "3440x1440@180"; example = "3440x1440@180";
type = lib.types.str; type = lib.types.str;
description = '' description = ''
@ -69,13 +54,12 @@
}; };
environments = lib.mkOption { environments = lib.mkOption {
default = [ default = [
(lib.mkIf config.mods.hypr.hyprland.enable inputs.hyprland.packages.${config.conf.system}.hyprland) inputs.hyprland.packages.${config.conf.system}.hyprland
(lib.mkIf config.mods.niri.enable pkgs.niri)
]; ];
# no idea if these are written correctly # no idea if these are written correctly
example = [ example = [
pkgs.niri pkgs.niri
pkgs.river-classic pkgs.river
pkgs.swayfx pkgs.swayfx
]; ];
type = with lib.types; listOf package; type = with lib.types; listOf package;
@ -97,21 +81,21 @@
}; };
config = let config = let
inherit (config.conf) username; username = config.conf.username;
in in
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 = mkDashDefault true; programs.hyprland.enable = 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 = mkDashDefault 1; terminal.vt = 1;
default_session = { default_session = {
command = mkDashDefault config.mods.greetd.greeterCommand; command = config.mods.greetd.greeterCommand;
user = mkDashDefault username; user = username;
}; };
}; };
}; };
@ -131,8 +115,6 @@
misc { misc {
disable_splash_rendering = false disable_splash_rendering = false
disable_hyprland_logo = true disable_hyprland_logo = true
disable_xdg_env_checks = true
disable_scale_notification = true
} }
env=STATE_DIR,var/cache/regreet env=STATE_DIR,var/cache/regreet
@ -147,13 +129,9 @@
''; '';
# unlock GPG keyring on login # unlock GPG keyring on login
security.pam = { security.pam.services.greetd.enableGnomeKeyring = true;
services.greetd = { security.pam.services.greetd.sshAgentAuth = true;
enableGnomeKeyring = mkDashDefault true; security.pam.sshAgentAuth.enable = true;
sshAgentAuth = mkDashDefault true;
};
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

@ -3,9 +3,12 @@
options, options,
config, config,
pkgs, pkgs,
inputs,
... ...
} }: let
: { # TODO remove when chromium works again
fixedVesktop = pkgs.vesktop.override {electron = pkgs.electron_33;};
in {
options.mods.homePackages = { options.mods.homePackages = {
useDefaultPackages = lib.mkOption { useDefaultPackages = lib.mkOption {
default = true; default = true;
@ -56,12 +59,6 @@
type = lib.types.bool; type = lib.types.bool;
description = "Adds the ncspot spotify client"; description = "Adds the ncspot spotify client";
}; };
orcaSlicer = lib.mkOption {
default = false;
example = true;
type = lib.types.bool;
description = "Enables orca slicer";
};
nextcloudClient = lib.mkOption { nextcloudClient = lib.mkOption {
default = false; default = false;
example = true; example = true;
@ -75,23 +72,18 @@
description = "The email client"; description = "The email client";
}; };
browser = lib.mkOption { browser = lib.mkOption {
default = "zen"; default = inputs.zen-browser.packages.${pkgs.system}.default;
example = "firefox"; example = "firefox";
type = with lib.types; type = with lib.types;
nullOr ( nullOr (
either (enum [ either (enum [
"firefox" "firefox"
"zen"
"librewolf"
"chromium"
"brave"
]) ])
package package
); );
description = "The browser (the enum variants have preconfigured modules)"; description = "The browser (the enum variants have preconfigured modules)";
}; };
}; };
config = lib.optionalAttrs (options ? home.packages) { config = lib.optionalAttrs (options ? home.packages) {
home.packages = home.packages =
if config.mods.homePackages.useDefaultPackages if config.mods.homePackages.useDefaultPackages
@ -99,14 +91,13 @@
with pkgs; with pkgs;
[ [
(lib.mkIf config.mods.homePackages.ncspot ncspot) (lib.mkIf config.mods.homePackages.ncspot ncspot)
(lib.mkIf config.mods.homePackages.orcaSlicer orca-slicer) (lib.mkIf config.mods.homePackages.vesktop fixedVesktop)
(lib.mkIf config.mods.homePackages.vesktop vesktop)
(lib.mkIf config.mods.homePackages.nextcloudClient nextcloud-client) (lib.mkIf config.mods.homePackages.nextcloudClient nextcloud-client)
(lib.mkIf (config.mods.homePackages.matrixClient != null) config.mods.homePackages.matrixClient) (lib.mkIf (!isNull config.mods.homePackages.matrixClient) config.mods.homePackages.matrixClient)
(lib.mkIf (config.mods.homePackages.mailClient != null) config.mods.homePackages.mailClient) (lib.mkIf (!isNull config.mods.homePackages.mailClient) config.mods.homePackages.mailClient)
(lib.mkIf ( (lib.mkIf (
# NOTE: This should be package, but nix doesn't have that.... # NOTE: This should be package, but nix doesn't have that....
builtins.isAttrs config.mods.homePackages.browser && config.mods.homePackages.browser != null builtins.isAttrs config.mods.homePackages.browser && !isNull config.mods.homePackages.browser
) )
config.mods.homePackages.browser) config.mods.homePackages.browser)
adw-gtk3 adw-gtk3
@ -119,7 +110,7 @@
flake-checker flake-checker
gnome-keyring gnome-keyring
gnutar gnutar
regreet greetd.regreet
killall killall
kitty kitty
libnotify libnotify
@ -128,11 +119,11 @@
nh nh
nix-index nix-index
playerctl playerctl
poppler-utils poppler_utils
pulseaudio pulseaudio
libsForQt5.qt5ct libsForQt5.qt5ct
qt6Packages.qt6ct qt6ct
fuc fcp
ripgrep ripgrep
rm-improved rm-improved
system-config-printer system-config-printer
@ -148,7 +139,22 @@
warn_timeout = "-1s"; warn_timeout = "-1s";
}; };
}; };
programs = config.mods.homePackages.specialPrograms; programs =
services = config.mods.homePackages.specialServices; config.mods.homePackages.specialPrograms
// (
if config.mods.homePackages.browser == "firefox"
then {
firefox = {
enable = true;
policies = config.mods.browser.firefox.configuration;
profiles = builtins.listToAttrs config.mods.browser.firefox.profiles;
};
}
else {}
);
services =
if config.mods.homePackages.useDefaultPackages
then config.mods.homePackages.specialServices
else config.mods.homePackages.specialServices;
}; };
} }

View file

@ -1,357 +0,0 @@
{
mkDashDefault,
config,
lib,
options,
pkgs,
...
}: let
defaultWmConf = import ../../../lib/wm.nix;
in {
options.mods.hypr.hyprland = {
enable = lib.mkOption {
default = true;
example = false;
type = lib.types.bool;
description = ''
Enable Hyprland
'';
};
noAtomic = lib.mkOption {
default = false;
example = true;
type = lib.types.bool;
description = ''
Use tearing (Warning, can be buggy)
'';
};
useIronbar = lib.mkOption {
default = true;
example = false;
type = lib.types.bool;
description = ''
Whether to use ironbar in hyprland.
'';
};
useDefaultConfig = lib.mkOption {
default = true;
example = false;
type = lib.types.bool;
description = ''
Use preconfigured Hyprland config.
'';
};
customConfig = lib.mkOption {
default = {};
example = {};
type = with lib.types; attrsOf anything;
description = ''
Custom Hyprland configuration.
Will be merged with default configuration if enabled.
'';
};
plugins = lib.mkOption {
default = [];
example = [];
type = with lib.types; listOf package;
description = ''
Plugins to be added to Hyprland.
'';
};
pluginConfig = lib.mkOption {
default = {};
example = {};
type = with lib.types; attrsOf anything;
description = ''
Plugin configuration to be added to Hyprland.
'';
};
hyprspaceEnable = lib.mkOption {
default = false;
type = lib.types.bool;
example = true;
description = ''
Enables Hyprspace plugin for hyprland.
Please note, plugins tend to break VERY often.
'';
};
};
config = lib.mkIf config.mods.hypr.hyprland.enable (
lib.optionalAttrs (options ? wayland.windowManager.hyprland) {
# install Hyprland related packages
home.packages = with pkgs; [
xorg.xprop
grim
slurp
satty
xdg-desktop-portal-gtk
xdg-desktop-portal-gnome
kdePackages.xdg-desktop-portal-kde
xdg-desktop-portal-shana
copyq
wl-clipboard
hyprcursor
hyprpicker
];
wayland.windowManager.hyprland = let
mkWorkspace = workspaces:
builtins.map (workspace: let
default =
if workspace.default
then ",default:true"
else "";
in "${workspace.name},monitor:${workspace.monitor}${default}")
workspaces;
mkTransform = transform:
if transform == "0"
then 0
else if transform == "90"
then 1
else if transform == "180"
then 2
else if transform == "270"
then 3
else 4;
mkVrr = vrr:
if vrr
then "1"
else "0";
mkMonitors = monitors:
builtins.map (
monitor: "${monitor.name},${builtins.toString monitor.resolutionX}x${builtins.toString monitor.resolutionY}@${builtins.toString monitor.refreshrate},${builtins.toString monitor.positionX}x${builtins.toString monitor.positionY},${builtins.toString monitor.scale}, transform,${builtins.toString (mkTransform monitor.transform)}, vrr,${mkVrr monitor.vrr}"
)
monitors;
mkMods = bind: let
mods = bind.modKeys or [];
in
builtins.map (mod:
if mod == "Mod"
then (lib.strings.toUpper config.mods.wm.modKey) + " "
else lib.strings.toUpper mod)
mods
|> lib.strings.concatStringsSep "";
mkArgs = args:
if args != []
then (lib.strings.concatStringsSep " " args)
else "";
shouldRepeat = bind: bind ? meta && bind.meta ? hyprland && bind.meta.hyprland ? repeat && bind.meta.hyprland.repeat == true;
defaultBinds = cfg:
if cfg.mods.wm.useDefaultBinds
then defaultWmConf.defaultBinds cfg
else [];
mkEBinds = cfg: let
binds = cfg.mods.wm.binds ++ defaultBinds cfg;
in
binds
|> builtins.filter (bind: bind ? command && shouldRepeat bind && !(hasInvalidCustomCommand bind))
|> builtins.map (
bind: "${mkMods bind},${bind.key},${mkCommand bind}"
);
mkBinds = cfg: let
binds = cfg.mods.wm.binds ++ defaultBinds cfg;
in
binds
|> builtins.filter (bind: bind ? command && !(shouldRepeat bind) && !(hasInvalidCustomCommand bind))
|> builtins.map (
bind: "${mkMods bind},${bind.key},${mkCommand bind}"
);
mkCommand = bind: let
args = bind.args or [];
in
if bind.command == "quit"
then "exit"
else if bind.command == "killActive"
then "killactive"
else if bind.command == "moveWindowRight"
then "movewindow,r"
else if bind.command == "moveWindowDown"
then "movewindow,d"
else if bind.command == "moveWindowLeft"
then "movewindow,l"
else if bind.command == "moveWindowUp"
then "movewindow,u"
else if bind.command == "moveFocusUp"
then "movefocus,u"
else if bind.command == "moveFocusRight"
then "movefocus,r"
else if bind.command == "moveFocusDown"
then "movefocus,d"
else if bind.command == "moveFocusLeft"
then "movefocus,l"
else if bind.command == "toggleFloating"
then "togglefloating"
else if bind.command == "toggleFullscreen"
then "fullscreen"
else if bind.command == "focusWorkspace"
then "workspace" + "," + mkArgs args
else if bind.command == "moveToWorkspace"
then "movetoworkspace" + "," + mkArgs args
else if bind.command == "spawn"
then "exec" + "," + mkArgs args
else if bind.command == "spawn-sh"
then "exec" + "," + mkArgs args
else bind.command.hyprland + "," + mkArgs args;
hasInvalidCustomCommand = bind: !(builtins.isString bind.command) && bind.command.hyprland or null == null;
mkEnv = config: let
defaultEnv =
if config.mods.wm.useDefaultEnv
then defaultWmConf.defaultEnv config
else {
all = {};
hyprland = {};
};
userEnv =
if config.mods.wm.env ? all
then config.mods.wm.env.all // config.mods.wm.env.hyprland
else config.mods.wm.env;
env = userEnv // defaultEnv.all // defaultEnv.hyprland;
in
lib.attrsets.mapAttrsToList (
name: value: "${name},${value}"
)
env;
mkAutoStart = config: let
defaultStartup =
if config.mods.wm.useDefaultStartup
then defaultWmConf.defaultStartup config
else {
all = [];
hyprland = [];
};
userStartup =
if config.mods.wm.startup ? all
then config.mods.wm.startup.all ++ config.mods.wm.startup.hyprland
else config.mods.wm.startup;
autoStart = userStartup ++ defaultStartup.all ++ defaultStartup.hyprland;
in
autoStart;
mkWindowRule = config: let
defaultWindowRules =
if config.mods.wm.useDefaultWindowRules
then defaultWmConf.defaultWindowRules.hyprland
else [];
in
# defaultWindowRules ++ config.mods.wm.windowRules.hyprland;
defaultWindowRules;
in {
enable = true;
plugins =
[
(lib.mkIf config.mods.hypr.hyprland.hyprspaceEnable pkgs.hyprlandPlugins.hyprspace)
]
++ config.mods.hypr.hyprland.plugins;
settings =
if config.mods.hypr.hyprland.useDefaultConfig
then
lib.mkMerge
[
{
"$mod" = mkDashDefault config.mods.wm.modKey;
bindm = [
"$mod, mouse:272, movewindow"
"$mod, mouse:273, resizeactive"
];
general = {
gaps_out = mkDashDefault "3,5,5,5";
border_size = mkDashDefault 3;
"col.active_border" = lib.mkOverride 51 "0xFFFF0000 0xFF00FF00 0xFF0000FF 45deg";
allow_tearing = lib.mkIf config.mods.hypr.hyprland.noAtomic true;
};
decoration = {
rounding = mkDashDefault 4;
};
render = {
direct_scanout = mkDashDefault config.mods.gaming.enable;
};
animations = {
bezier = mkDashDefault "overshot, 0.05, 0.9, 0.1, 1.2";
animation = [
"windowsMove,1,4,default"
"windows,1,3,overshot,slide bottom"
"windowsOut,1,7,default,popin 70%"
"border,1,4,default"
"fade,1,7,default"
"workspaces,1,4,default"
"layers,1,2,default,slide"
];
};
dwindle = {
preserve_split = mkDashDefault true;
pseudotile = mkDashDefault 0;
permanent_direction_override = mkDashDefault false;
};
input = {
kb_layout = mkDashDefault "${config.mods.xkb.layout}";
kb_variant = mkDashDefault "${config.mods.xkb.variant}";
repeat_delay = mkDashDefault 200;
force_no_accel = mkDashDefault true;
touchpad = {
natural_scroll = mkDashDefault true;
tap-to-click = mkDashDefault true;
tap-and-drag = mkDashDefault true;
};
};
misc = {
animate_manual_resizes = mkDashDefault 1;
enable_swallow = mkDashDefault true;
disable_splash_rendering = mkDashDefault true;
disable_hyprland_logo = mkDashDefault true;
disable_xdg_env_checks = mkDashDefault true;
disable_scale_notification = mkDashDefault true;
swallow_regex = mkDashDefault "^(.*)(kitty)(.*)$";
initial_workspace_tracking = mkDashDefault 1;
# just doesn't work
enable_anr_dialog = false;
};
cursor = {
enable_hyprcursor = mkDashDefault true;
no_hardware_cursors = mkDashDefault (
if config.mods.gpu.nvidia.enable
then 2
else 0
);
# done with nix, this would break the current setup otherwise
sync_gsettings_theme = mkDashDefault false;
};
gesture = [
"3, horizontal, workspace"
];
layerrule = [
# layer rules
# mainly to disable animations within slurp and grim
"match:namespace selection, no_anim on"
];
workspace = mkWorkspace config.mods.wm.workspaces;
monitor = mkMonitors config.mods.wm.monitors;
env = mkEnv config;
bind = mkBinds config;
binde = mkEBinds config;
windowrule = mkWindowRule config;
exec-once = mkAutoStart config;
plugin = config.mods.hypr.hyprland.pluginConfig;
}
config.mods.hypr.hyprland.customConfig
]
else lib.mkForce config.mods.hypr.hyprland.customConfig;
};
}
);
}

View file

@ -1,69 +0,0 @@
{
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 = "${
if config.mods.wm.monitors != []
then (builtins.elemAt config.mods.wm.monitors 0).name
else ""
}";
placeholder_text = "password or something";
}
];
label = [
{
monitor = "${
if config.mods.wm.monitors != []
then (builtins.elemAt config.mods.wm.monitors 0).name
else ""
}";
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

@ -1,36 +0,0 @@
{
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

@ -0,0 +1,145 @@
{
lib,
config,
pkgs,
options,
inputs,
...
}: {
options.mods = {
hyprland = {
anyrun = {
enable = lib.mkOption {
default = true;
example = false;
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 ? programs.anyrun) {
programs.anyrun = {
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
];
#position = "center";
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: none;
}
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: none;
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,6 +1,8 @@
{ {
imports = [ imports = [
./hyprland.nix ./hyprland.nix
./anyrun.nix
./ironbar.nix
./hyprlock.nix ./hyprlock.nix
./hyprpaper.nix ./hyprpaper.nix
]; ];

View file

@ -0,0 +1,401 @@
{
config,
lib,
options,
pkgs,
inputs,
...
}: let
browserName =
if (builtins.isString config.mods.homePackages.browser)
then config.mods.homePackages.browser
else if config.mods.homePackages.browser ? meta && config.mods.homePackages.browser.meta ? mainProgram
then config.mods.homePackages.browser.meta.mainProgram
else config.mods.homePackages.browser.pname;
in {
options.mods = {
hyprland = {
enable = lib.mkOption {
default = true;
example = false;
type = lib.types.bool;
description = ''
Enable Hyprland
'';
};
monitor = lib.mkOption {
default = [
# main monitor
"${config.conf.defaultMonitor},${config.conf.defaultMonitorMode},0x0,${config.conf.defaultMonitorScale}"
# all others
",highrr,auto,1"
];
example = ["DP-1,3440x1440@180,2560x0,1,vrr,0"];
type = with lib.types; listOf str;
description = ''
The monitor configuration for hyprland.
'';
};
workspace = lib.mkOption {
default = [];
example = ["2,monitor:DP-1, default:true"];
type = with lib.types; listOf str;
description = ''
The workspace configuration for hyprland.
'';
};
noAtomic = lib.mkOption {
default = false;
example = true;
type = lib.types.bool;
description = ''
Use tearing
'';
};
extraAutostart = lib.mkOption {
default = [];
example = ["your application"];
type = lib.types.listOf lib.types.str;
description = ''
Extra exec_once.
'';
};
useDefaultConfig = lib.mkOption {
default = true;
example = false;
type = lib.types.bool;
description = ''
Use preconfigured Hyprland config.
'';
};
customConfig = lib.mkOption {
default = {};
example = {};
type = with lib.types; attrsOf anything;
description = ''
Custom Hyprland configuration.
Will be merged with default configuration if enabled.
'';
};
plugins = lib.mkOption {
default = [];
example = [];
type = with lib.types; listOf package;
description = ''
Plugins to be added to Hyprland.
'';
};
pluginConfig = lib.mkOption {
default = {};
example = {};
type = with lib.types; attrsOf anything;
description = ''
Plugin configuration to be added to Hyprland.
'';
};
hyprspaceEnable = lib.mkOption {
default = false;
type = lib.types.bool;
example = true;
description = ''
Enables Hyprspace plugin for hyprland.
Please note, plugins tend to break VERY often.
'';
};
};
};
config = lib.mkIf config.mods.hyprland.enable (
lib.optionalAttrs (options ? wayland.windowManager.hyprland) {
# install Hyprland related packages
home.packages = with pkgs; [
xorg.xprop
grim
slurp
satty
xdg-desktop-portal-gtk
# xdg-desktop-portal-hyprland
copyq
wl-clipboard
hyprcursor
hyprpicker
];
wayland.windowManager.hyprland = {
enable = true;
settings =
if config.mods.hyprland.useDefaultConfig
then
{
"$mod" = "SUPER";
bindm = [
"$mod, mouse:272, movewindow"
"$mod, mouse:273, resizeactive"
];
bind = [
# screenshots
''$mod SUPER,S,exec,grim -g "$(slurp)" - | wl-copy''
''$mod SUPERSHIFT,S,exec,grim -g "$(slurp)" - | satty -f -''
''$mod SUPERSHIFTALT,S,exec,grim -c -g "2560,0 3440x1440" - | wl-copy''
# regular programs
"$mod SUPER,F,exec,${browserName}"
(lib.mkIf (
browserName == "firefox" || browserName == "zen"
) "$mod SUPERSHIFT,F,exec,${browserName} -p special")
"$mod SUPER,T,exec,kitty -1"
"$mod SUPER,E,exec,nautilus -w"
"$mod SUPER,N,exec,neovide"
"$mod SUPER,M,exec,oxidash"
"$mod SUPER,R,exec,anyrun"
"$mod SUPER,G,exec,oxicalc"
"$mod SUPER,D,exec,oxishut"
"$mod SUPER,A,exec,oxipaste-iced"
"$mod SUPERSHIFT,P,exec,hyprdock --gui"
"$mod SUPERSHIFT,L,exec, playerctl -a pause & hyprlock & systemctl suspend"
"$mod SUPERSHIFT,K,exec, playerctl -a pause & hyprlock & systemctl hibernate"
# media keys
(lib.mkIf config.mods.scripts.audioControl ",XF86AudioMute,exec, audioControl mute")
(lib.mkIf config.mods.scripts.audioControl ",XF86AudioLowerVolume,exec, audioControl sink -5%")
(lib.mkIf config.mods.scripts.audioControl ",XF86AudioRaiseVolume,exec, audioControl sink +5%")
",XF86AudioPlay,exec, playerctl play-pause"
",XF86AudioNext,exec, playerctl next"
",XF86AudioPrev,exec, playerctl previous"
(lib.mkIf config.mods.scripts.changeBrightness ",XF86MonBrightnessDown,exec, change-brightness brightness 10%-")
(lib.mkIf config.mods.scripts.changeBrightness ",XF86MonBrightnessUp,exec, change-brightness brightness +10%")
# hyprland keybinds
# misc
"$mod SUPER,V,togglefloating,"
"$mod SUPER,B,fullscreen,"
"$mod SUPER,C,togglesplit"
"$mod SUPER,Q,killactive,"
"$mod SUPERSHIFTALT,M,exit,"
"$mod SUPERSHIFT,W,togglespecialworkspace"
# move
"$mod SUPER,left,movewindow,l"
"$mod SUPER,right,movewindow,r"
"$mod SUPER,up,movewindow,u"
"$mod SUPER,down,movewindow,d"
# workspaces
"$mod SUPER,1,workspace,1"
"$mod SUPER,2,workspace,2"
"$mod SUPER,3,workspace,3"
"$mod SUPER,4,workspace,4"
"$mod SUPER,5,workspace,5"
"$mod SUPER,6,workspace,6"
"$mod SUPER,7,workspace,7"
"$mod SUPER,8,workspace,8"
"$mod SUPER,9,workspace,9"
"$mod SUPER,0,workspace,10"
# move to workspace
"$mod SUPERSHIFT,1,movetoworkspace,1"
"$mod SUPERSHIFT,2,movetoworkspace,2"
"$mod SUPERSHIFT,3,movetoworkspace,3"
"$mod SUPERSHIFT,4,movetoworkspace,4"
"$mod SUPERSHIFT,5,movetoworkspace,5"
"$mod SUPERSHIFT,6,movetoworkspace,6"
"$mod SUPERSHIFT,7,movetoworkspace,7"
"$mod SUPERSHIFT,8,movetoworkspace,8"
"$mod SUPERSHIFT,9,movetoworkspace,9"
"$mod SUPERSHIFT,0,movetoworkspace,10"
# move to workspace silent
"$mod SUPERSHIFTALT,1,movetoworkspacesilent,1"
"$mod SUPERSHIFTALT,2,movetoworkspacesilent,2"
"$mod SUPERSHIFTALT,3,movetoworkspacesilent,3"
"$mod SUPERSHIFTALT,4,movetoworkspacesilent,4"
"$mod SUPERSHIFTALT,5,movetoworkspacesilent,5"
"$mod SUPERSHIFTALT,6,movetoworkspacesilent,6"
"$mod SUPERSHIFTALT,7,movetoworkspacesilent,7"
"$mod SUPERSHIFTALT,8,movetoworkspacesilent,8"
"$mod SUPERSHIFTALT,9,movetoworkspacesilent,9"
"$mod SUPERSHIFTALT,0,movetoworkspacesilent,10"
# preselection
"$mod SUPERALT,j,layoutmsg,preselect l"
"$mod SUPERALT,k,layoutmsg,preselect d"
"$mod SUPERALT,l,layoutmsg,preselect u"
"$mod SUPERALT,semicolon,layoutmsg,preselect r"
"$mod SUPERALT,h,layoutmsg,preselect n"
];
binde = [
# hyprland keybinds
# focus
"$mod SUPER,J,movefocus,l"
"$mod SUPER,semicolon,movefocus,r"
"$mod SUPER,L,movefocus,u"
"$mod SUPER,K,movefocus,d"
# resize
"$mod SUPER,U,resizeactive,-20 0"
"$mod SUPER,P,resizeactive,20 0"
"$mod SUPER,O,resizeactive,0 -20"
"$mod SUPER,I,resizeactive,0 20"
];
general = {
gaps_out = "3,5,5,5";
border_size = 3;
"col.active_border" = lib.mkOverride 51 "0xFFFF0000 0xFF00FF00 0xFF0000FF 45deg";
# "col.inactive_border" = "0x66333333";
allow_tearing = lib.mkIf config.mods.hyprland.noAtomic true;
};
decoration = {
rounding = 4;
};
animations = {
bezier = "penguin,0.05,0.9,0.1,1.0";
animation = [
"windowsMove,1,4,default"
"windows,1,7,default,popin 70%"
"windowsOut,1,7,default,popin 70%"
"border,1,10,default"
"fade,1,7,default"
"workspaces,1,6,default"
"layers,1,3,default,popin"
];
};
dwindle = {
preserve_split = true;
pseudotile = 0;
permanent_direction_override = false;
};
input = {
kb_layout = "${config.mods.xkb.layout}";
kb_variant = "${config.mods.xkb.variant}";
repeat_delay = 200;
force_no_accel = true;
touchpad = {
natural_scroll = true;
tap-to-click = true;
tap-and-drag = true;
};
};
misc = {
animate_manual_resizes = 1;
enable_swallow = true;
disable_splash_rendering = true;
disable_hyprland_logo = true;
swallow_regex = "^(.*)(kitty)(.*)$";
initial_workspace_tracking = 1;
};
cursor = {
enable_hyprcursor = true;
no_hardware_cursors = lib.mkIf config.mods.gpu.nvidia.enable true;
# done with nix, this would break the current setup otherwise
sync_gsettings_theme = false;
};
gestures = {
workspace_swipe = true;
};
monitor = config.mods.hyprland.monitor;
workspace = config.mods.hyprland.workspace;
env = [
"GTK_CSD,0"
''TERM,"kitty /bin/fish"''
"XDG_CURRENT_DESKTOP=Hyprland"
"XDG_SESSION_TYPE=wayland"
"XDG_SESSION_DESKTOP=Hyprland"
"HYPRCURSOR_THEME,${config.mods.stylix.cursor.name}"
"HYPRCURSOR_SIZE,${toString config.mods.stylix.cursor.size}"
"XCURSOR_THEME,${config.mods.stylix.cursor.name}"
"XCURSOR_SIZE,${toString config.mods.stylix.cursor.size}"
"QT_QPA_PLATFORM,wayland"
"QT_QPA_PLATFORMTHEME,qt5ct"
"QT_WAYLAND_FORCE_DPI,96"
"QT_AUTO_SCREEN_SCALE_FACTOR,0"
"QT_WAYLAND_DISABLE_WINDOWDECORATION,1"
"QT_SCALE_FACTOR,1"
''EDITOR,"neovide --novsync --nofork"''
(lib.mkIf config.mods.hyprland.noAtomic "WLR_DRM_NO_ATOMIC,1")
"GTK_USE_PORTAL, 1"
(lib.mkIf config.mods.gpu.nvidia.enable "LIBVA_DRIVER_NAME,nvidia")
(lib.mkIf config.mods.gpu.nvidia.enable "XDG_SESSION_TYPE,wayland")
(lib.mkIf config.mods.gpu.nvidia.enable "GBM_BACKEND,nvidia-drm")
(lib.mkIf config.mods.gpu.nvidia.enable "__GLX_VENDOR_LIBRARY_NAME,nvidia")
];
layerrule = [
# layer rules
# mainly to disable animations within slurp and grim
"noanim, selection"
];
windowrule = [
# window rules
"tile,^(.*)(Spotify)(.*)$"
"float,^(.*)(OxiCalc)(.*)$"
"float,^(.*)(winecfg.exe)(.*)$"
"float,^(.*)(speed.exe)(.*)$"
"float,^(.*)(copyq)(.*)$"
"center,^(.*)(swappy)(.*)$"
"float,title:^(.*)(Spirit)(.*)$"
"float,title:^(.*)(reset)(.*)$"
"workspace 10 silent,^(.*)(steam)(.*)$"
"workspace 9 silent,^(.*)(dota)(.*)$"
"workspace 9 silent,^(.*)(battlebits)(.*)$"
"workspace 9 silent,^(.*)(aoe)(.*)$"
"suppressevent fullscreen maximize,^(.*)(neovide)(.*)$"
];
windowrulev2 = [
"immediate,class:^(.*)(Pal)$"
"immediate,class:^(.*)(dota2)$"
"immediate,class:^(.*)(needforspeedheat.exe)$"
];
exec-once =
[
# environment
"systemctl --user import-environment"
"dbus-update-activation-environment --systemd --all"
"hyprctl setcursor Bibata-Modern-Classic 24"
# other programs
"hyprpaper"
"ironbar"
"${browserName}"
"oxipaste_daemon"
"oxinoti"
]
++ config.mods.hyprland.extraAutostart;
plugin =
{
hyprspace = lib.mkIf config.mods.hyprland.hyprspaceEnable {
bind = [
"SUPER, W, overview:toggle, toggle"
];
};
}
// config.mods.hyprland.pluginConfig;
}
// config.mods.hyprland.customConfig
else lib.mkForce config.mods.hyprland.customConfig;
plugins =
[
(lib.mkIf config.mods.hyprland.hyprspaceEnable inputs.Hyprspace.packages.${pkgs.system}.Hyprspace)
]
++ config.mods.hyprland.plugins;
};
}
);
}

View file

@ -0,0 +1,58 @@
{
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

@ -0,0 +1,38 @@
{
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

@ -0,0 +1,326 @@
{
lib,
config,
options,
...
}: let
username = config.conf.username;
in {
options.mods = {
hyprland.ironbar = {
enable = lib.mkOption {
default = true;
example = false;
type = lib.types.bool;
description = "Enables ironbar";
};
useDefaultConfig = lib.mkOption {
default = true;
example = false;
type = lib.types.bool;
description = ''
Use preconfigured ironbar config.
'';
};
customConfig = lib.mkOption {
default = {};
example = {};
type = with lib.types; attrsOf anything;
description = ''
Custom ironbar configuration.
Will be merged with default configuration if enabled.
'';
};
useDefaultCss = lib.mkOption {
default = true;
example = false;
type = lib.types.bool;
description = ''
Use preconfigured ironbar css.
'';
};
customCss = lib.mkOption {
default = '''';
example = ''
#window {
border-radius: none;
}
'';
type = lib.types.lines;
description = ''
Custom ironbar css.
Will be merged with default css if enabled.
'';
};
};
};
config = lib.mkIf config.mods.hyprland.ironbar.enable (
lib.optionalAttrs (options ? programs.ironbar) {
programs.ironbar = {
enable = true;
style =
if config.mods.hyprland.ironbar.useDefaultCss
then
''
@import url("/home/${username}/.config/gtk-3.0/gtk.css");
* {
color: #71bbe6;
padding: 0px;
margin: 0px;
}
.background {
background-color: rgba(0, 0, 0, 0);
}
.workspaces {
margin: 2px 0px 0px 5px;
border-radius: 10px;
/* background-color: #2b2c3b; */
background-color: #1E1E2E;
padding: 2px 5px 2px 5px;
}
.workspaces .item {
margin: 0px 3px 0px 3px;
font-size: 13px;
border-radius: 100%;
padding: 0px 2px 0px 3px;
background-color: rgba(0, 0, 0, 0);
}
.workspaces .item:hover {
background-color: #3e4152;
}
.workspaces .item.focused {
background-color: #3e4152;
}
.audio-box {
padding: 2em;
background-color: #1E1E2E;
border-radius: 5px;
}
.audio-slider {
padding: 5px;
margin: 5px;
}
.audio-button {
padding: 5px 10px 5px 10px;
margin: 0px 1em 20px 1em;
border-radius: 100%;
font-size: 17px;
}
.audio-button-box {
padding: 0px 2.5em 0px 2.5em;
}
.focused {
/* margin: 2px 0px 0px 0px; */
padding: 0px 5px 0px 5px;
/* background-color: 1a1b26; */
background-color: #1E1E2E;
font-size: 17px;
border-radius: 10px;
}
#bar #end {
margin: 0px 5px 0px 0px;
padding: 0px 5px 0px 5px;
background-color: #1E1E2E;
border-radius: 10px;
}
.popup-button {
padding: 0px 5px 0px 3px;
margin: 0em 3px;
border-radius: 100%;
font-size: 13px;
background-color: #1E1E2E;
}
.popup-button-box {
padding: 2px 0px 2px 0px;
}
.clock {
padding: 0px 5px 0px 5px;
font-size: 17px;
background-color: #1E1E2E;
}
.clock:hover {
background-color: #3e4152;
}
.custom button {
background-color: #1E1E2E;
}
.custom button:hover {
background-color: #3e4152;
}
.memory-usage {
font-size: 15px;
margin: 0px 5px 0px 0px;
}
.memory-usage:hover {
background-color: #3e4152;
}
.popup-clock {
background-color: #1E1E2E;
border-radius: 5px;
padding: 2px 8px 10px 8px;
}
.popup-clock .calendar-clock {
font-size: 2.5em;
padding-bottom: 0.1em;
}
.popup-clock .calendar {
border-radius: 5px;
font-size: 1.05em;
}
.popup-clock .calendar:selected {
background-color: #3e4152;
}
''
+ config.mods.hyprland.ironbar.customCss
else config.mods.hyprland.ironbar.customCss;
features = [
#"another_feature"
];
config = {
monitors."${config.conf.defaultMonitor}" =
if config.mods.hyprland.ironbar.useDefaultConfig
then
{
end =
config.conf.ironbar.modules
++ [
{
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";
}
];
}
// config.mods.hyprland.ironbar.customConfig
else config.mods.hyprland.ironbar.customConfig;
};
};
}
);
}

View file

@ -1,552 +0,0 @@
{
lib,
config,
pkgs,
inputs,
options,
mkDashDefault,
...
}: let
inherit (config.conf) username;
base16 = pkgs.callPackage inputs.base16.lib {};
scheme = base16.mkSchemeAttrs config.stylix.base16Scheme;
ironbarDefaultConfig = useBatteryModule: {
end = [
(lib.mkIf useBatteryModule
{
type = "battery";
class = "battery";
icon_size = 0;
format = "{percentage}%";
thresholds = {
warning = 20;
critical = 5;
};
})
{
class = "music";
type = "music";
format = "";
truncate = {
mode = "end";
max_length = 0;
};
icons = {
play = "";
pause = "";
};
truncate_popup_title = {
mode = "end";
max_length = 15;
};
truncate_popup_album = {
mode = "end";
max_length = 15;
};
truncate_popup_artist = {
mode = "end";
max_length = 15;
};
}
{
bar = [
{
class = "popup-button";
label = "";
on_click = "popup:toggle";
type = "button";
}
];
class = "popup-button-box";
popup = [
{
class = "audio-box";
orientation = "vertical";
type = "box";
widgets = [
{
class = "audio-button-box";
orientation = "horizontal";
type = "box";
widgets = [
{
class = "audio-button";
label = "";
on_click = "!audioControl bluetooth";
type = "button";
}
{
class = "audio-button";
label = "󰋋";
on_click = "!audioControl internal";
type = "button";
}
];
}
{
class = "audio-label";
label = "Output";
type = "label";
}
{
class = "audio-slider";
length = 200;
on_change = "!pactl set-sink-volume @DEFAULT_SINK@ $0%";
step = 1.0;
type = "slider";
value = "pactl get-sink-volume @DEFAULT_SINK@ | awk -F'/' '{ print $2 }' | tr -d ' %'";
label = "{{pactl get-sink-volume @DEFAULT_SINK@ | awk -F'/' '{ print $2 }'}}";
}
{
class = "audio-label";
label = "Input";
type = "label";
}
{
class = "audio-slider";
length = 200;
on_change = "!pactl set-source-volume @DEFAULT_SOURCE@ $0%";
step = 1.0;
type = "slider";
value = "pactl get-source-volume @DEFAULT_SOURCE@ | awk -F'/' '{ print $2 }' | tr -d ' %'";
}
];
}
];
type = "custom";
}
{
bar = [
{
class = "popup-button";
label = "";
on_click = "!oxidash";
type = "button";
}
];
class = "popup-button-box";
type = "custom";
}
{
bar = [
{
class = "popup-button";
label = "";
on_click = "popup:toggle";
type = "button";
}
];
type = "custom";
class = "popup-button-box";
popup = [
{
class = "system-box";
type = "box";
widgets = [
{
class = "memory-usage";
format = [
" {cpu_percent}%"
" {memory_used} / {memory_total} GB ({memory_percent}%)"
" {swap_used} / {swap_total} GB ({swap_free} | {swap_percent}%)"
"󰥔 {uptime}"
];
direction = "vertical";
interval = {
memory = 30;
cpu = 5;
temps = 5;
disks = 5;
network = 5;
};
type = "sys_info";
}
];
}
];
}
{
type = "tray";
}
];
position = "top";
height = 10;
anchor_to_edges = true;
start = [
{
type = "workspaces";
all_monitors = true;
}
];
center = [
{
format = "%I:%M";
format_popup = "%a %d:%m/%I:%M %p";
locale = "en_US";
type = "clock";
}
];
};
monitorConfig = useBatteryModule:
if config.mods.ironbar.ironbarSingleMonitor
then {
monitors.${
if config.mods.wm.monitors != []
then (builtins.elemAt config.mods.wm.monitors 0).name
else ""
} =
ironbarDefaultConfig useBatteryModule;
}
else ironbarDefaultConfig useBatteryModule;
in {
options.mods = {
ironbar = {
enable = lib.mkOption {
default = false;
example = true;
type = lib.types.bool;
description = "Enables ironbar";
};
ironbarSingleMonitor = lib.mkOption {
default = true;
example = false;
type = lib.types.bool;
description = ''
Whether to use ironbar on a single monitor.
'';
};
useDefaultConfig = lib.mkOption {
default = true;
example = false;
type = lib.types.bool;
description = ''
Use preconfigured ironbar config.
'';
};
useBatteryModule = lib.mkOption {
default = false;
example = true;
type = lib.types.bool;
description = "Whether to use the preconfigured battery module.";
};
customConfig = lib.mkOption {
default = {};
example = {};
type = with lib.types; attrsOf anything;
description = ''
Custom ironbar configuration.
Will be merged with default configuration if enabled.
'';
};
useDefaultCss = lib.mkOption {
default = true;
example = false;
type = lib.types.bool;
description = ''
Use preconfigured ironbar css.
'';
};
customCss = lib.mkOption {
default = '''';
example = ''
#window {
border-radius: none;
}
'';
type = lib.types.lines;
description = ''
Custom ironbar css.
Will be merged with default css if enabled.
'';
};
};
};
config = lib.mkIf (config.mods.ironbar.enable || config.mods.hypr.hyprland.useIronbar) (
lib.optionalAttrs (options ? programs.ironbar) {
programs.ironbar = {
package = mkDashDefault pkgs.ironbar;
enable = true;
style =
if config.mods.ironbar.useDefaultCss
then
/*
css
*/
''
@import url("/home/${username}/.config/gtk-3.0/gtk.css");
@define-color primary #${scheme.base0D};
@define-color warning #${scheme.base0F};
@define-color muted-text #${scheme.base05};
@define-color background #${scheme.base00};
@define-color secondary-background #${scheme.base02};
* slider {
background-color: @muted-text;
}
* {
transition:
background-color 0.15s ease-in-out,
color 0.15s ease-in-out,
border-color 0.15s ease-in-out;
}
.background {
background-color: rgba(0, 0, 0, 0);
padding: 0px;
margin: 0px;
}
.focused {
padding: 0px 5px;
background-color: @background;
font-size: 17px;
border-radius: 10px;
}
#bar #end {
margin: 0px 5px;
padding: 0px 5px;
background-color: @background;
border-radius: 10px;
}
.popup-button {
padding: 0px 5px 0px 2px;
border-radius: 100%;
font-size: 13px;
background-color: @background;
}
.popup-button-box {
padding: 2px 0px;
margin-right: 4px;
}
.custom button {
background-color: @background;
color: @primary;
}
.custom button:hover {
background-color: @secondary-background;
}
/* audio */
.audio-box * {
color: @primary;
}
.audio-box {
padding: 2em;
background-color: @background;
border-radius: 5px;
border: 1px solid @primary;
}
.audio-slider {
padding: 5px;
margin: 5px 5px 15px;
}
.audio-label {
font-size: 19px;
}
.audio-button {
padding: 10px 10px 10px 8px;
min-height: 35px;
min-width: 35px;
margin: 0px 1em;
border-radius: 50%;
font-size: 25px;
}
.audio-button-box {
padding: 0px 2.5em 0px 2.5em;
margin: 0em 0em 1.5em;
}
/* clock */
.clock {
padding: 0px 5px;
font-size: 20px;
border-radius: 5px;
background-color: @background;
color: @primary;
}
.clock:hover {
background-color: @secondary-background;
}
.popup-clock {
font-size: 2.5em;
background-color: @background;
border: 1px solid @primary;
padding: 0.5em;
border-radius: 8px;
color: @primary;
}
.popup-clock .calendar-clock {
margin: 0.25em 0em 0.75em;
color: @primary;
}
.popup-clock .calendar {
font-size: 24px;
color: @primary;
}
.popup-clock .calendar:selected {
background-color: @secondary-background;
}
/* workspaces */
.workspaces {
margin: 0px 0px 0px 5px;
border-radius: 10px;
background-color: @background;
padding: 2px 5px;
}
.workspaces .item {
margin: 0px 3px;
font-size: 13px;
border-radius: 100%;
padding: 0px 3px 0px 3px;
background-color: rgba(0, 0, 0, 0);
color: @primary;
}
.workspaces .item:hover {
background-color: @secondary-background;
color: @primary;
}
.workspaces .item:not(.visible) {
color: @warning;
}
.workspaces .item.focused {
background-color: @primary;
color: @background;
}
/* battery */
.battery {
font-size: 13px;
padding: 0px 4px 0px 0px;
margin: 2px 0px 2px 0px;
background-color: @background;
color: @primary;
}
.battery .icon {
opacity: 0.0;
}
.battery .label {
margin: 2px 0px 0px -8px;
color: @primary;
}
.battery:hover {
background-color: @secondary-background;
border-radius: 5px;
}
.popup-battery {
background-color: @background;
color: @primary;
border-radius: 8px;
border: 1px solid @primary;
padding: 16px;
font-size: 20px;
}
/* music */
.music {
font-size: 13px;
padding: 0px 4px 0px 3px;
margin: 2px 0px 2px 0px;
background-color: @background;
color: @primary;
}
.music:hover {
background-color: @secondary-background;
border-radius: 100%;
}
.music .contents .icon {
margin: 0px 0px 0px 5px;
}
.popup-music {
background-color: @background;
color: @primary;
border-radius: 8px;
border: 1px solid @primary;
padding: 16px;
font-size: 20px;
}
.popup-music .controls .btn-prev {
color: @primary;
margin-right: 16px;
}
.popup-music .controls .btn-next {
color: @primary;
margin-right: 16px;
}
.popup-music .controls .btn-play {
color: @primary;
margin-right: 16px;
}
.popup-music .controls .btn-pause {
color: @primary;
margin-right: 16px;
}
/* system */
.system-box {
padding: 16px;
color: @primary;
border: 1px solid @primary;
background-color: @background;
border-radius: 8px;
}
.memory-usage {
font-size: 15px;
color: @primary;
}
.memory-usage:hover {
background-color: @secondary-background;
}
''
+ config.mods.ironbar.customCss
else config.mods.ironbar.customCss;
features = [
#"another_feature"
];
config =
if config.mods.ironbar.useDefaultConfig
then
lib.mkMerge
[
(monitorConfig config.mods.ironbar.useBatteryModule)
config.mods.ironbar.customConfig
]
else config.mods.ironbar.customConfig;
};
}
);
}

View file

@ -12,50 +12,21 @@
type = lib.types.bool; type = lib.types.bool;
description = "Enables the piper program and its daemon"; description = "Enables the piper program and its daemon";
}; };
useConfig = lib.mkOption { use_cache_config = lib.mkOption {
default = true; default = true;
example = false; example = false;
type = lib.types.bool; type = lib.types.bool;
description = "Whether to overwrite the config of keepassxc. Note, this means that changes can't be applied via the program anymore!";
};
config = lib.mkOption {
default = ''
[General]
ConfigVersion=2
[Browser]
Enabled=true
[GUI]
ApplicationTheme=classic
HidePasswords=true
MinimizeOnClose=true
MinimizeToTray=true
ShowTrayIcon=true
TrayIconAppearance=monochrome-light
[PasswordGenerator]
Length=30
[Security]
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!"; 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 { cache_config = lib.mkOption {
default = ''''; default = ''
example = ''
[General] [General]
LastDatabases=/path/to/database 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; type = lib.types.lines;
description = "Cache config to be used."; description = "Cache config to be used.";
}; };
@ -63,12 +34,32 @@
config = lib.mkIf config.mods.keepassxc.enable ( config = lib.mkIf config.mods.keepassxc.enable (
lib.optionalAttrs (options ? home.file) { lib.optionalAttrs (options ? home.file) {
home.packages = [pkgs.keepassxc]; home.packages = [pkgs.keepassxc];
xdg.configFile."keepassxc/keepassxc.ini" = lib.mkIf config.mods.keepassxc.useConfig { xdg.configFile."keepassxc/keepassxc.ini" = {
text = config.mods.keepassxc.config; text = ''
[General]
ConfigVersion=2
[Browser]
Enabled=true
[GUI]
ApplicationTheme=classic
HidePasswords=true
MinimizeOnClose=true
MinimizeToTray=true
ShowTrayIcon=true
TrayIconAppearance=monochrome-light
[PasswordGenerator]
Length=30
[Security]
EnableCopyOnDoubleClick=true
'';
}; };
home.file.".cache/keepassxc/keepassxc.ini" = lib.mkIf config.mods.keepassxc.useCacheConfig { home.file.".cache/keepassxc/keepassxc.ini" = lib.mkIf config.mods.keepassxc.use_cache_config {
text = config.mods.keepassxc.cacheConfig; text = config.mods.keepassxc.cache_config;
}; };
} }
); );

View file

@ -41,12 +41,6 @@ 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 = {
@ -54,7 +48,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. Will be the only configuration if useDefaultConfig is disabled."; description = "Additional kitty configuration";
}; };
}; };
config = lib.mkIf config.mods.kitty.enable ( config = lib.mkIf config.mods.kitty.enable (
@ -65,64 +59,80 @@ in {
programs.kitty = { programs.kitty = {
enable = true; enable = true;
settings = settings =
if config.mods.kitty.useDefaultConfig {
then enable_audio_bell = "no";
{ window_alert_on_bell = "no";
enable_audio_bell = "no"; cursor_blink_interval = "0";
window_alert_on_bell = "no"; window_padding_width = "1";
cursor_blink_interval = "0"; shell_integration = "yes";
window_padding_width = "1"; sync_with_monitor = "no";
shell_integration = "yes"; background_opacity = "0.8";
sync_with_monitor = "no";
background_opacity = "0.8";
font_family = "${config.mods.stylix.fonts.monospace.name}"; font_family = "${config.mods.stylix.fonts.monospace.name}";
bold_font = "${config.mods.stylix.fonts.monospace.name} Extra Bold"; bold_font = "${config.mods.stylix.fonts.monospace.name} Extra Bold";
italic_font = "${config.mods.stylix.fonts.monospace.name} Extra Italic"; italic_font = "${config.mods.stylix.fonts.monospace.name} Extra Italic";
bold_italic_font = "${config.mods.stylix.fonts.monospace.name} Extra Bold Italic"; bold_italic_font = "${config.mods.stylix.fonts.monospace.name} Extra Bold Italic";
background = base; background = base;
foreground = "#" + scheme.base05; foreground = "#" + scheme.base05;
selection_foreground = "#" + scheme.base05; selection_foreground = "#" + scheme.base05;
selection_background = base; selection_background = base;
url_color = "#" + scheme.base04; url_color = "#" + scheme.base04;
cursor = "#" + scheme.base05; cursor = "#" + scheme.base05;
active_border_color = "#" + scheme.base03; active_border_color = "#" + scheme.base03;
inactive_border_color = "#" + scheme.base01; inactive_border_color = "#" + scheme.base01;
active_tab_background = base; active_tab_background = base;
active_tab_foreground = "#" + scheme.base05; active_tab_foreground = "#" + scheme.base05;
inactive_tab_background = "#" + scheme.base01; inactive_tab_background = "#" + scheme.base01;
inactive_tab_foreground = "#" + scheme.base04; inactive_tab_foreground = "#" + scheme.base04;
tab_bar_background = "#" + scheme.base01; tab_bar_background = "#" + scheme.base01;
mark1_foreground = "#" + scheme.base00; mark1_foreground = "#" + scheme.base00;
mark1_background = "#" + scheme.base07; mark1_background = "#" + scheme.base07;
mark2_foreground = "#" + scheme.base00; mark2_foreground = "#" + scheme.base00;
mark2_background = "#" + scheme.base0E; mark2_background = "#" + scheme.base0E;
mark3_foreground = "#" + scheme.base00; mark3_foreground = "#" + scheme.base00;
mark3_background = "#" + scheme.base08; mark3_background = "#" + scheme.base08;
color0 = "#" + scheme.base03; color0 = "#" + scheme.base03;
color1 = "#" + scheme.base08; color1 = "#" + scheme.base08;
color2 = "#" + scheme.base0B; color2 = "#" + scheme.base0B;
color3 = "#" + scheme.base0A; color3 = "#" + scheme.base0A;
color4 = "#" + scheme.base0D; color4 = "#" + scheme.base0D;
color5 = "#" + scheme.base06; color5 = "#" + scheme.base06;
color6 = "#" + scheme.base0C; color6 = "#" + scheme.base0C;
color7 = "#" + scheme.base07; color7 = "#" + scheme.base07;
color8 = "#" + scheme.base04; color8 = "#" + scheme.base04;
color9 = "#" + scheme.base08; color9 = "#" + scheme.base08;
color10 = "#" + scheme.base0B; color10 = "#" + scheme.base0B;
color11 = "#" + scheme.base0A; color11 = "#" + scheme.base0A;
color12 = "#" + scheme.base0D; color12 = "#" + scheme.base0D;
color13 = "#" + scheme.base06; color13 = "#" + scheme.base06;
color14 = "#" + scheme.base0C; color14 = "#" + scheme.base0C;
color15 = "#" + scheme.base0B; color15 = "#" + scheme.base0B;
shell = lib.mkIf config.mods.fish.enable "fish";
} # color0 = base;
// config.mods.kitty.additionalConfig # color1 = "#" + scheme.base08;
else config.mods.kitty.additionalConfig; # 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";
}
// config.mods.kitty.additionalConfig;
}; };
} }
); );

View file

@ -4,7 +4,8 @@
config, config,
pkgs, pkgs,
... ...
}: { }:
{
options.mods.media = { options.mods.media = {
useBasePackages = lib.mkOption { useBasePackages = lib.mkOption {
default = true; default = true;
@ -13,111 +14,77 @@
description = "Default media packages (If disabled, only the additional packages will be installed)"; description = "Default media packages (If disabled, only the additional packages will be installed)";
}; };
additionalPackages = lib.mkOption { additionalPackages = lib.mkOption {
default = []; default = [ ];
example = [pkgs.flatpak]; example = [ pkgs.flatpak ];
type = with lib.types; listOf package; type = with lib.types; listOf package;
description = '' description = ''
Additional media packages. Additional media packages.
''; '';
}; };
specialPrograms = lib.mkOption { specialPrograms = lib.mkOption {
default = {}; default = { };
example = {}; example = { };
type = with lib.types; attrsOf anything; type = with lib.types; attrsOf anything;
description = '' description = ''
special program configuration to be added which require programs.something notation. special program configuration to be added which require programs.something notation.
''; '';
}; };
specialServices = lib.mkOption { specialServices = lib.mkOption {
default = {}; default = { };
example = {}; example = { };
type = with lib.types; attrsOf anything; type = with lib.types; attrsOf anything;
description = '' description = ''
special services configuration to be added which require an services.something notation. special services configuration to be added which require an services.something notation.
''; '';
}; };
filePickerPortal = lib.mkOption {
default = "Term";
example = "Gnome";
type = with lib.types; oneOf [(enum ["Gnome" "Kde" "Lxqt" "Gtk" "Term" "Default"]) str];
description = ''
The file picker portal to use (set with shana).
Default removes the config, allowing you to set it yourself.
'';
};
termFileChooserConfig = lib.mkOption {
default = {
cmd = "${pkgs.xdg-desktop-portal-termfilechooser}/share/xdg-desktop-portal-termfilechooser/yazi-wrapper.sh";
default_dir = "$HOME";
};
example = {};
type = with lib.types; attrsOf anything;
description = ''
Termfilechooser config
'';
};
}; };
config = lib.optionalAttrs (options ? home.packages) { config = lib.optionalAttrs (options ? home.packages) {
xdg.configFile."xdg-desktop-portal-termfilechooser/config" = lib.mkIf (config.mods.media.filePickerPortal != "Term") {
source = (pkgs.formats.ini {}).generate "termchooser" {
filechooser = config.mods.media.termFileChooserConfig;
};
};
xdg.configFile."xdg-desktop-portal-shana/config.toml" = lib.mkIf (config.mods.media.filePickerPortal != "Default") {
source = let
name =
if (config.mods.media.filePickerPortal == "Term")
then "org.freedesktop.impl.portal.desktop.termfilechooser"
else config.mods.media.filePickerPortal;
in
(pkgs.formats.toml {}).generate "shana" {
open_file = name;
save_file = name;
save_files = name;
};
};
home.packages = home.packages =
if config.mods.media.useBasePackages if config.mods.media.useBasePackages then
then
with pkgs; with pkgs;
[ [
# base audio # base audio
pipewire pipewire
wireplumber wireplumber
# audio control # audio control
playerctl playerctl
# images # images
eog imv
# videos # videos
mpv mpv
# pdf # pdf
zathura zathura
evince evince
libreoffice-fresh libreoffice-fresh
onlyoffice-desktopeditors onlyoffice-bin
pdftk pdftk
pdfpc pdfpc
polylux2pdfpc polylux2pdfpc
# spotify # spotify
# video editing # video editing
kdePackages.kdenlive kdePackages.kdenlive
# image creation # image creation
inkscape inkscape
gimp gimp
krita krita
yt-dlp yt-dlp
] ]
++ config.mods.media.additionalPackages ++ config.mods.media.additionalPackages
else config.mods.media.additionalPackages; else
config.mods.media.additionalPackages;
programs = programs =
if config.mods.media.useBasePackages if config.mods.media.useBasePackages then
then
{ {
obs-studio.enable = true; obs-studio.enable = true;
obs-studio.plugins = with pkgs; [obs-studio-plugins.obs-vaapi]; obs-studio.plugins = with pkgs; [ obs-studio-plugins.obs-vaapi ];
} }
// config.mods.media.specialPrograms // config.mods.media.specialPrograms
else config.mods.media.specialPrograms; else
services = config.mods.media.specialServices; config.mods.media.specialPrograms;
services =
if config.mods.media.useBasePackages then
config.mods.media.specialServices
else
config.mods.media.specialServices;
}; };
} }

View file

@ -1,7 +1,6 @@
# 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,
@ -85,7 +84,7 @@ in {
description = "Applications used for handling browser mime types"; description = "Applications used for handling browser mime types";
}; };
imageApplications = lib.mkOption { imageApplications = lib.mkOption {
default = ["eog"]; default = ["imv"];
example = []; example = [];
type = with lib.types; listOf str; type = with lib.types; listOf str;
description = "Applications used for handling image mime types"; description = "Applications used for handling image mime types";
@ -149,11 +148,11 @@ in {
}; };
userDirs = { userDirs = {
enable = mkDashDefault true; enable = true;
createDirectories = mkDashDefault true; createDirectories = true;
extraConfig = { extraConfig = {
XDG_SCREENSHOTS_DIR = mkDashDefault "${config.xdg.userDirs.pictures}/Screenshots"; XDG_SCREENSHOTS_DIR = "${config.xdg.userDirs.pictures}/Screenshots";
pws = mkDashDefault "${config.home.homeDirectory}/pws"; pws = "${config.home.homeDirectory}/pws";
}; };
}; };
}; };

View file

@ -12,8 +12,11 @@
type = lib.types.bool; type = lib.types.bool;
description = "Enables ncspot with a config"; description = "Enables ncspot with a config";
}; };
config = lib.mkOption { };
default = { config = lib.mkIf config.mods.ncspot.enable (
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;
@ -49,16 +52,6 @@
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

@ -8,13 +8,13 @@
description = "Enable nextcloud"; description = "Enable nextcloud";
}; };
username = lib.mkOption { username = lib.mkOption {
default = ""; default = "DashieTM";
example = "globi"; example = "globi";
type = lib.types.str; type = lib.types.str;
description = "Your username"; description = "Your username";
}; };
url = lib.mkOption { url = lib.mkOption {
default = ""; default = "cloud.dashie.org";
example = "cloud.globi.org"; example = "cloud.globi.org";
type = lib.types.str; type = lib.types.str;
description = "Your url"; description = "Your url";

View file

@ -1,392 +0,0 @@
{
mkDashDefault,
config,
lib,
options,
pkgs,
...
}: let
defaultWmConf = import ../../lib/wm.nix;
in {
options.mods.niri = {
enable = lib.mkOption {
default = true;
example = false;
type = lib.types.bool;
description = ''
Enable Niri
'';
};
useDefaultConfig = lib.mkOption {
default = true;
example = false;
type = lib.types.bool;
description = ''
Use preconfigured Niri config.
'';
};
customConfig = lib.mkOption {
default = '''';
example = '''';
type = lib.types.lines;
description = ''
Custom Niri configuration.
Will be merged with default configuration if enabled.
'';
};
};
config = lib.mkIf config.mods.niri.enable (
lib.optionalAttrs (options ? wayland.windowManager.hyprland) {
# TODO deduplicate and abstract away base window management config
# install Niri related packages
home.packages = with pkgs; [
xorg.xprop
grim
slurp
satty
xdg-desktop-portal-gtk
xdg-desktop-portal-gnome
kdePackages.xdg-desktop-portal-kde
xdg-desktop-portal-shana
copyq
wl-clipboard
niri
xwayland-satellite
];
xdg.configFile."niri/config.kdl" = let
mkNiriMod = mods:
builtins.map (mod:
if mod == "Mod"
then config.mods.wm.modKey + "+"
else "${mod}" + "+")
mods
|> lib.strings.concatStringsSep "";
mkNiriArg = args:
if args != []
then let
concatCommand = lib.strings.concatStringsSep " " args;
validCommand = builtins.replaceStrings [''"''] [''\"''] concatCommand;
in "\"${validCommand}\""
else "";
mkNiriCommand = bind: let
args = bind.args or [];
in
if bind.command == "quit"
then "quit;"
else if bind.command == "killActive"
then "close-window;"
else if bind.command == "moveFocusTop"
then "focus-window-up;"
else if bind.command == "focusWorkspace"
then "focus-workspace" + " " + mkNiriArg args + ";"
else if bind.command == "moveWindowRight"
then "move-column-right-or-to-monitor-right;"
else if bind.command == "moveWindowDown"
then "move-window-down;"
else if bind.command == "moveWindowLeft"
then "move-column-left-or-to-monitor-left;"
else if bind.command == "moveWindowUp"
then "move-window-up;"
else if bind.command == "moveFocusUp"
then "focus-window-up;"
else if bind.command == "moveFocusRight"
then "focus-column-or-monitor-right;"
else if bind.command == "moveFocusDown"
then "focus-window-down;"
else if bind.command == "moveFocusLeft"
then "focus-column-or-monitor-left;"
else if bind.command == "toggleFloating"
then "toggle-window-floating;"
else if bind.command == "toggleFullscreen"
then "fullscreen-window;"
else if bind.command == "moveToWorkspace"
then "move-window-to-workspace" + " " + mkNiriArg args + ";"
else if bind.command == "spawn"
then "spawn" + " " + mkNiriArg args + ";"
else if bind.command == "spawn-sh"
then "spawn-sh" + " " + mkNiriArg args + ";"
else if bind.command.niri != null
then bind.command.niri + " " + mkNiriArg args + ";"
else "";
mkNiriBinds = cfg:
'' binds {
''
+ (
(
builtins.map (
bind:
/*
kdl
*/
if bind ? key && bind ? command
then ''
${mkNiriMod (bind.modKeys or [])}${bind.key} ${
if
bind ? meta
&& bind.meta ? niri
then
(
if
bind.meta.niri ? desc
&& bind.meta.niri.desc != ""
then "hotkey-overlay-title=\"" + bind.meta.niri.desc + "\""
else ""
)
+ " "
+ (
if
bind.meta.niri ? repeat
&& bind.meta.niri.repeat
then "repeat=true"
else "repeat=false"
)
+ " "
+ (
if
bind.meta.niri ? allowWhileLocked
&& bind.meta.niri.allowWhileLocked
then "allow-when-locked=true"
else ""
)
+ " "
+ (
if
bind.meta.niri ? allowInhibit
&& bind.meta.niri.allowInhibit
then "allow-inhibiting=true"
else "allow-inhibiting=false"
)
else ""
} { ${
mkNiriCommand bind
} }
''
else ''''
)
((
cfg.mods.wm.binds
++ (
if cfg.mods.wm.useDefaultBinds
then defaultWmConf.defaultBinds cfg
else []
)
)
|> builtins.filter (bind: !(hasInvalidCustomCommand bind)))
)
|> lib.strings.concatLines
)
+ ''
}
'';
mkVrr = vrr:
if vrr
then "true"
else "false";
mkNiriMonitors = cfg:
(builtins.map (
monitor:
# TODO vrr
/*
kdl
*/
''
output "${monitor.name}" {
variable-refresh-rate on-demand=${mkVrr monitor.vrr}
mode "${builtins.toString monitor.resolutionX}x${builtins.toString monitor.resolutionY}@${builtins.toString monitor.refreshrate}"
scale ${builtins.toString monitor.scale}
transform "${
if (monitor.transform == "0")
then "normal"
else monitor.transform
}"
position x=${builtins.toString monitor.positionX} y=${builtins.toString monitor.positionY}
}
''
)
cfg.mods.wm.monitors)
|> lib.strings.concatLines;
mkNiriWorkspaces = cfg:
(builtins.map (
workspace:
/*
kdl
*/
''
workspace "${workspace.name}" {
open-on-output "${workspace.monitor}"
}
''
)
cfg.mods.wm.workspaces)
|> lib.strings.concatLines;
mkNiriWindowRules = cfg: (
(
builtins.map (
rule:
/*
kdl
*/
''
window-rule {
${rule}
}
''
)
(
cfg.mods.wm.windowRules.niri
++ (
if cfg.mods.wm.useDefaultWindowRules
then defaultWmConf.defaultWindowRules.niri
else []
)
)
)
|> lib.strings.concatLines
);
hasInvalidCustomCommand = bind: !(bind ? command) || (!(builtins.isString bind.command) && bind.command.niri or null == null);
mkNiriEnv = config: let
defaultEnv =
if config.mods.wm.useDefaultEnv
then defaultWmConf.defaultEnv config
else {
all = {};
niri = {};
};
userEnv =
if config.mods.wm.env ? all
then config.mods.wm.env.all // config.mods.wm.env.niri
else config.mods.wm.env;
env =
userEnv
// defaultEnv.all
// defaultEnv.niri;
in
''
environment {
''
+ (
lib.attrsets.mapAttrsToList (
name: value: "${name} \"${value}\""
)
env
|> lib.strings.concatLines
)
+ ''
}
'';
mkNiriAutoStart = config: let
defaultStartup =
if config.mods.wm.useDefaultStartup
then defaultWmConf.defaultStartup config
else {
all = {};
niri = {};
};
userStartup =
if config.mods.wm.startup ? all
then config.mods.wm.startup.all ++ config.mods.wm.startup.niri
else config.mods.wm.startup;
autoStart = userStartup ++ defaultStartup.all ++ defaultStartup.niri;
in
(builtins.map (value: "spawn-at-startup \"${value}\"")
autoStart)
|> lib.strings.concatLines;
defaultConfig =
/*
kdl
*/
''
input {
keyboard {
xkb {
layout "enIntUmlaut"
}
repeat-delay 200
repeat-rate 25
numlock
}
touchpad {
tap
natural-scroll
}
mouse {
accel-speed 0.2
accel-profile "flat"
}
focus-follows-mouse max-scroll-amount="25%"
}
layout {
// Set gaps around windows in logical pixels.
gaps 10
center-focused-column "never"
always-center-single-column
preset-column-widths {
proportion 0.33333
proportion 0.5
proportion 1.0
}
default-column-width { proportion 0.5; }
focus-ring {
width 3
inactive-color "#505050"
active-gradient from="#ff0000" to="#00ff00" angle=45
}
border {
off
}
// You can enable drop shadows for windows.
shadow {
on
softness 30
spread 5
offset x=0 y=5
color "#0007"
}
}
${
if config.mods.gpu.nvidia.enable
then ''
debug {
wait-for-frame-completion-before-queueing
}
''
else ''''
}
// Autostart
hotkey-overlay {
skip-at-startup
}
prefer-no-csd
''
+ mkNiriMonitors config
+ mkNiriBinds config
+ mkNiriWorkspaces config
+ mkNiriWindowRules config
+ mkNiriEnv config
+ mkNiriAutoStart config;
in
mkDashDefault {
text =
if config.mods.niri.useDefaultConfig
then defaultConfig + config.mods.niri.customConfig
else config.mods.niri.customConfig;
};
}
);
}

View file

@ -1,24 +0,0 @@
{
config,
lib,
options,
pkgs,
...
}: {
options.mods = {
onedrive = {
enable = lib.mkOption {
default = false;
example = true;
type = lib.types.bool;
description = "Enable onedrive program and service";
};
};
};
config = lib.mkIf config.mods.onedrive.enable (
lib.optionalAttrs (options ? environment) {
services.onedrive.enable = true;
environment.systemPackages = [pkgs.onedrive];
}
);
}

View file

@ -8,9 +8,8 @@
imports = [ imports = [
./oxidash.nix ./oxidash.nix
./oxinoti.nix ./oxinoti.nix
./oxipaste.nix
./oxirun.nix
./oxishut.nix ./oxishut.nix
./oxipaste.nix
]; ];
options.mods.oxi = { options.mods.oxi = {
enable = lib.mkOption { enable = lib.mkOption {
@ -34,12 +33,6 @@
type = lib.types.bool; type = lib.types.bool;
description = "Enables hyprdock"; description = "Enables hyprdock";
}; };
settings = lib.mkOption {
default = {};
example = {};
type = with lib.types; attrsOf anything;
description = "settings for hyprdock";
};
}; };
oxicalc = { oxicalc = {
enable = lib.mkOption { enable = lib.mkOption {
@ -53,10 +46,7 @@
config = lib.mkIf config.mods.oxi.enable ( config = lib.mkIf config.mods.oxi.enable (
lib.optionalAttrs (options ? home.packages) { lib.optionalAttrs (options ? home.packages) {
programs = { programs = {
hyprdock = { hyprdock.enable = lib.mkIf config.mods.oxi.hyprdock.enable true;
inherit (config.mods.oxi.hyprdock) enable;
inherit (config.mods.oxi.hyprdock) settings;
};
oxicalc.enable = lib.mkIf config.mods.oxi.oxicalc.enable true; oxicalc.enable = lib.mkIf config.mods.oxi.oxicalc.enable true;
ReSet = lib.mkIf config.mods.oxi.ReSet.enable { ReSet = lib.mkIf config.mods.oxi.ReSet.enable {
enable = true; enable = true;
@ -74,8 +64,5 @@
}; };
}; };
} }
// lib.optionalAttrs (options ? services.logind && options ? services.logind.settings) {
services.logind.settings.Login.HandleLidSwitchExternalPower = "ignore";
}
); );
} }

View file

@ -2,15 +2,8 @@
lib, lib,
config, config,
options, options,
pkgs,
inputs,
... ...
}: let }: {
# at time of using this here, stylix might not be evaluated yet
# hence ensure it is by using base16 mkSchemeAttrs
base16 = pkgs.callPackage inputs.base16.lib {};
scheme = base16.mkSchemeAttrs config.stylix.base16Scheme;
in {
options.mods.oxi.oxidash = { options.mods.oxi.oxidash = {
enable = lib.mkOption { enable = lib.mkOption {
default = true; default = true;
@ -24,54 +17,52 @@ in {
programs.oxidash.enable = true; programs.oxidash.enable = true;
xdg.configFile."oxidash/style.css" = { xdg.configFile."oxidash/style.css" = {
text = '' text = ''
@define-color bg #${scheme.base00};
@define-color primary #${scheme.base0D};
#MainWindow { #MainWindow {
border-radius: 10px; border-radius: 10px;
background-color: transparent;
} }
#MainBox { #MainBox {
border-radius: 10px; border-radius: 10px;
border: 1px solid @primary;
background-color: @bg;
} }
#MainButtonBox { #MainButtonBox {
padding: 10px; padding: 10px;
margin: 5px 0px 5px 0px; margin: 5px 0px 5px 0px;
border-radius: 5px; border-radius: 5px;
border: solid 1px @primary; border: solid 2px #327cd5;
} }
#DoNotDisturbButton {} #DoNotDisturbButton {
}
#ExitButton {} #ExitButton {
}
#ClearNotificationsButton {} #ClearNotificationsButton {
}
#NotificationsWindow {} #NotificationsWindow {
}
.debugimage { .debugimage {
border: solid 3px @primary; border: solid 3px blue;
} }
.Notification { .Notification {
padding: 10px; padding: 10px;
margin: 5px 0px 5px 0px; margin: 5px 0px 5px 0px;
border: solid 1px @primary; border: solid 2px #327cd5;
border-radius: 5px; border-radius: 5px;
} }
.CloseNotificationButton { .CloseNotificationButton {
margin: 0px 5px 0px 10px; margin: 0px 5px 0px 10px;
} }
.PictureButtonBox {
.PictureButtonBox {}
.BaseBox {}
} }
.BaseBox {
}
}
''; '';
}; };
} }

View file

@ -2,15 +2,8 @@
lib, lib,
config, config,
options, options,
pkgs,
inputs,
... ...
}: let }: {
# at time of using this here, stylix might not be evaluated yet
# hence ensure it is by using base16 mkSchemeAttrs
base16 = pkgs.callPackage inputs.base16.lib {};
scheme = base16.mkSchemeAttrs config.stylix.base16Scheme;
in {
options.mods.oxi.oxinoti = { options.mods.oxi.oxinoti = {
enable = lib.mkOption { enable = lib.mkOption {
default = true; default = true;
@ -26,13 +19,7 @@ in {
text = text =
# css # css
'' ''
@import url("/home/dashie/.config/gtk-3.0/gtk.css"); @import url("/home/${config.conf.username}/.config/gtk-3.0/gtk.css");
@define-color bg #${scheme.base00};
@define-color bghover #${scheme.base02};
@define-color primary #${scheme.base0D};
@define-color red #${scheme.base08};
@define-color green #${scheme.base0B};
#MainWindow { #MainWindow {
background-color: transparent; background-color: transparent;
@ -47,37 +34,31 @@ in {
} }
.NotificationBox { .NotificationBox {
background-color: @bg; background-color: #353747;
border-radius: 5px; border-radius: 5px;
border: solid 1px; border: solid 1px;
margin: 0px; margin: 0px;
} padding: 5px;
.NotificationBox button {
background-color: @bg;
}
.NotificationBox button:hover {
background-color: @bghover;
} }
.NotificationLow { .NotificationLow {
border-color: @green; border-color: green;
} }
.NotificationNormal { .NotificationNormal {
border-color: @primary; border-color: purple;
} }
.NotificationUrgent { .NotificationUrgent {
border-color: @red; border-color: red;
} }
.miscbox { .miscbox {
margin: 0px 10px 0px 0px; margin: 0px 10px 0px 0px;
} }
.bodybox {} .bodybox {
}
.imagebox { .imagebox {
margin: 0px 0px 0px 10px; margin: 0px 0px 0px 10px;
@ -103,7 +84,8 @@ in {
font-size: 2rem; font-size: 2rem;
} }
.image {} .image {
}
.bold { .bold {
font-weight: bold; font-weight: bold;

View file

@ -1,20 +0,0 @@
{
lib,
config,
options,
...
}: {
options.mods.oxi.oxirun = {
enable = lib.mkOption {
default = true;
example = false;
type = lib.types.bool;
description = "Enables OxiRun";
};
};
config = lib.mkIf (config.mods.oxi.oxirun.enable && config.mods.oxi.enable) (
lib.optionalAttrs (options ? xdg.configFile) {
programs.oxirun.enable = true;
}
);
}

View file

@ -16,10 +16,6 @@
config = lib.mkIf config.mods.printing.enable ( config = lib.mkIf config.mods.printing.enable (
lib.optionalAttrs (options ? services.printing) { lib.optionalAttrs (options ? services.printing) {
# Enable CUPS to print documents. # Enable CUPS to print documents.
environment.systemPackages = with pkgs; [
simple-scan
];
hardware.sane.enable = true;
services = { services = {
printing = { printing = {
enable = true; enable = true;

View file

@ -24,100 +24,108 @@
description = "More scripts to be passed. (check existing ones for types and examples)"; description = "More scripts to be passed. (check existing ones for types and examples)";
}; };
}; };
config = lib.optionalAttrs (options ? home.packages) { config = (
home.packages = lib.optionalAttrs (options ? home.packages) {
[ home.packages =
(lib.mkIf config.mods.scripts.changeBrightness ( [
pkgs.writeShellScriptBin "changeBrightness" '' (lib.mkIf config.mods.scripts.changeBrightness (
brightnessctl set "$1" pkgs.writeShellScriptBin "changeBrightness" ''
CURRENT=$(brightnessctl -m -d intel_backlight | awk -F, '{print substr($4, 0, length($4)-1)}') set_brightness() {
notify-send -a "changeBrightness" -r 3 -u low -i brightness-high -h int:value:"$CURRENT" "Brightness: ''${CURRENT}%" brightnessctl set "$1"
'' CURRENT=$(brightnessctl -m -d intel_backlight | awk -F, '{print substr($4, 0, length($4)-1)}')
)) dunstify -a "changeBrightness" -r 3 -u low -i brightness-high -h int:value:"$CURRENT" "Brightness: ''${CURRENT}%"
(lib.mkIf config.mods.scripts.audioControl ( }
pkgs.writeShellScriptBin "audioControl" ''
ncspot() {
NUM=$(pactl list clients short | rg "ncspot" | awk -F 'PipeWire' ' { print $1 } ' | tr -d ' \t\n')
CHANGE=$(pactl list sink-inputs short | rg "$NUM" | awk -F ' ' ' { print $1 }' | tr -d ' \t\n')
pactl set-sink-input-volume "$CHANGE" "$1"
VOLUME=$(pactl list sink-inputs | rg "$NUM" -A7 | rg "Volume:" | awk -F ' ' ' { print $5 }' | tr -d '%')
notify-send -a "ncspot" -r 990 -u low -i audio-volume-high -h int:progress:"$VOLUME" "Spotify Volume: ''${VOLUME}%"
}
firefox() { if [ "$1" == "brightness" ]; then
STRING=$(pactl list clients short | rg "firefox" | awk -F 'PipeWire' ' { print $1 "," } ' | tr -d ' \t\n') set_brightness "$2"
# NUMS=',' read -r -a array <<< "$STRING" fi
readarray -td, NUMS <<<"$STRING" ''
declare -p NUMS ))
for index in "''${!NUMS[@]}"; do #"''${!array[@]}" (lib.mkIf config.mods.scripts.audioControl (
NUM=$(echo "''${NUMS[index]}" | tr -d ' \t\n') pkgs.writeShellScriptBin "audioControl" ''
CHANGE=$(pactl list sink-inputs short | rg "$NUM" | awk -F ' ' ' { print $1 }' | tr -d ' \t\n') ncspot() {
pactl set-sink-input-volume "$CHANGE" "$1" NUM=$(pactl list clients short | rg "ncspot" | awk -F 'PipeWire' ' { print $1 } ' | tr -d ' \t\n')
done CHANGE=$(pactl list sink-inputs short | rg "$NUM" | awk -F ' ' ' { print $1 }' | tr -d ' \t\n')
VOLUME=$(pactl list sink-inputs | rg "''${NUMS[0]}" -A7 | rg "Volume:" | awk -F ' ' ' { print $5 }' | tr -d '%') pactl set-sink-input-volume "$CHANGE" "$1"
notify-send -a "Firefox" -r 991 -u low -i audio-volume-high -h int:progress:"$VOLUME" "Firefox Volume: ''${VOLUME}%" VOLUME=$(pactl list sink-inputs | rg "$NUM" -A7 | rg "Volume:" | awk -F ' ' ' { print $5 }' | tr -d '%')
} notify-send -a "ncspot" -r 990 -u low -i audio-volume-high -h int:progress:"$VOLUME" "Spotify Volume: ''${VOLUME}%"
}
internal() { firefox() {
SPEAKER=$(pactl list sinks | grep "Name" | grep "alsa" | awk -F ': ' '{ print $2 }') STRING=$(pactl list clients short | rg "firefox" | awk -F 'PipeWire' ' { print $1 "," } ' | tr -d ' \t\n')
if [ "$SPEAKER" != "" ]; then # NUMS=',' read -r -a array <<< "$STRING"
pactl set-default-sink "$SPEAKER" readarray -td, NUMS <<<"$STRING"
pactl set-sink-mute "$SPEAKER" false declare -p NUMS
DEVICE=$(echo "$SPEAKER" | awk -F '.' ' { print $4 } ') for index in "''${!NUMS[@]}"; do #"''${!array[@]}"
notify-send "changed audio to "$DEVICE" " NUM=$(echo "''${NUMS[index]}" | tr -d ' \t\n')
else CHANGE=$(pactl list sink-inputs short | rg "$NUM" | awk -F ' ' ' { print $1 }' | tr -d ' \t\n')
notify-send "failed, not available!" pactl set-sink-input-volume "$CHANGE" "$1"
fi done
} VOLUME=$(pactl list sink-inputs | rg "''${NUMS[0]}" -A7 | rg "Volume:" | awk -F ' ' ' { print $5 }' | tr -d '%')
notify-send -a "Firefox" -r 991 -u low -i audio-volume-high -h int:progress:"$VOLUME" "Firefox Volume: ''${VOLUME}%"
}
set_volume_sink() { internal() {
pactl set-sink-volume @DEFAULT_SINK@ "$1" SPEAKER=$(pactl list sinks | grep "Name" | grep "alsa" | awk -F ': ' '{ print $2 }')
CURRENT=$(pactl get-sink-volume @DEFAULT_SINK@ | awk -F'/' '{ print $2 }' | tr -d ' %') if [ "$SPEAKER" != "" ]; then
notify-send -a "System Volume" -r 1001 -u low -i audio-volume-high -h int:progress:"$CURRENT" "Output Volume: ''${CURRENT}%" pactl set-default-sink "$SPEAKER"
} pactl set-sink-mute "$SPEAKER" false
DEVICE=$(echo "$SPEAKER" | awk -F '.' ' { print $4 } ')
notify-send "changed audio to "$DEVICE" "
else
notify-send "failed, not available!"
fi
}
set_volume_source() { set_volume_sink() {
pactl set-source-volume @DEFAULT_SOURCE@ "$1" pactl set-sink-volume @DEFAULT_SINK@ "$1"
CURRENT=$(pactl get-source-volume @DEFAULT_SOURCE@ | awk -F'/' '{ print $2 }' | tr -d ' %') CURRENT=$(pactl get-sink-volume @DEFAULT_SINK@ | awk -F'/' '{ print $2 }' | tr -d ' %')
notify-send -a "System Volume" -r 1001 -u low -i audio-volume-high -h int:progress:"$CURRENT" "Input Volume: ''${CURRENT}%" notify-send -a "System Volume" -r 1001 -u low -i audio-volume-high -h int:progress:"$CURRENT" "Output Volume: ''${CURRENT}%"
} }
bluetooth() { set_volume_source() {
SPEAKER=$(pactl list sinks | grep "Name" | grep "blue" | awk -F ': ' '{ print $2 }') pactl set-source-volume @DEFAULT_SOURCE@ "$1"
if [ "$SPEAKER" != "" ]; then CURRENT=$(pactl get-source-volume @DEFAULT_SOURCE@ | awk -F'/' '{ print $2 }' | tr -d ' %')
pactl set-default-sink "$SPEAKER" notify-send -a "System Volume" -r 1001 -u low -i audio-volume-high -h int:progress:"$CURRENT" "Input Volume: ''${CURRENT}%"
pactl set-sink-mute "$SPEAKER" false }
DEVICE=$(echo "$SPEAKER" | awk -F '.' ' { print $4 } ')
notify-send "changed audio to "$DEVICE" "
else
notify-send "failed, not available!"
fi
}
mute() { bluetooth() {
pactl set-sink-mute @DEFAULT_SINK@ toggle SPEAKER=$(pactl list sinks | grep "Name" | grep "blue" | awk -F ': ' '{ print $2 }')
MUTE=$(pactl get-sink-mute @DEFAULT_SINK@) if [ "$SPEAKER" != "" ]; then
notify-send -a "Audio" -r 994 -u low -i audio-volume-high "Audio: $MUTE" pactl set-default-sink "$SPEAKER"
} pactl set-sink-mute "$SPEAKER" false
DEVICE=$(echo "$SPEAKER" | awk -F '.' ' { print $4 } ')
notify-send "changed audio to "$DEVICE" "
else
notify-send "failed, not available!"
fi
}
if [ "$1" == "internal" ]; then mute() {
internal pactl set-sink-mute @DEFAULT_SINK@ toggle
elif [ "$1" == "bluetooth" ]; then MUTE=$(pactl get-sink-mute @DEFAULT_SINK@)
bluetooth notify-send -a "Audio" -r 994 -u low -i audio-volume-high "Audio: $MUTE"
elif [ "$1" == "firefox" ]; then }
firefox "$2"
elif [ "$1" == "ncspot" ]; then if [ "$1" == "internal" ]; then
ncspot "$2" internal
elif [ "$1" == "mute" ]; then elif [ "$1" == "bluetooth" ]; then
mute bluetooth
elif [ "$1" == "sink" ]; then elif [ "$1" == "firefox" ]; then
set_volume_sink "$2" firefox "$2"
elif [ "$1" == "source" ]; then elif [ "$1" == "ncspot" ]; then
set_volume_source "$2" ncspot "$2"
fi elif [ "$1" == "mute" ]; then
'' mute
)) elif [ "$1" == "sink" ]; then
] set_volume_sink "$2"
++ config.mods.scripts.scripts; elif [ "$1" == "source" ]; then
}; set_volume_source "$2"
fi
''
))
]
++ config.mods.scripts.scripts;
}
);
} }

View file

@ -1,5 +1,4 @@
{ {
mkDashDefault,
lib, lib,
config, config,
options, options,
@ -46,7 +45,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 = mkDashDefault true; interactiveOnly = 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,39 +0,0 @@
{
lib,
config,
options,
...
}: {
options.mods = {
streamcontroller = {
enable = lib.mkOption {
default = false;
example = true;
type = lib.types.bool;
description = ''
Enables streamcontroller
'';
};
configFilePath = lib.mkOption {
default = null;
type = with lib.types; nullOr path;
description = ''
Path to the config json for the streamcontroller.
-> ./something.json
'';
};
};
};
config = lib.mkIf config.mods.streamcontroller.enable (
lib.optionalAttrs (options ? environment.systemPackages) {
programs.streamcontroller.enable = true;
}
// (lib.optionalAttrs (options ? home.file) {
home.file.".var/app/com.core447.StreamController/data/pages/defaultpage.json" =
lib.mkIf
(!isNull config.mods.streamcontroller.configFilePath)
{source = config.mods.streamcontroller.configFilePath;};
})
);
}

View file

@ -1,37 +1,18 @@
{ {
mkDashDefault,
lib, lib,
config, config,
options, options,
unstable,
inputs,
pkgs, pkgs,
... ...
}: let }: {
svg = ../../assets/rainbow.svg;
sd = lib.getExe pkgs.sd;
base16 = pkgs.callPackage inputs.base16.lib {};
mkWallpaper = schemeStr: let
scheme = base16.mkSchemeAttrs schemeStr;
in
pkgs.runCommand "rainbow.png" {} ''
cat ${svg} \
| ${sd} '#f9e2af' '#${scheme.base0A}' \
| ${sd} '#fab387' '#${scheme.base09}' \
| ${sd} '#f38ba8' '#${scheme.base08}' \
| ${sd} '#89b4fa' '#${scheme.base0D}' \
| ${sd} '#cba6f7' '#${scheme.base0E}' \
| ${sd} '#a6e3a1' '#${scheme.base0B}' \
| ${sd} '#1e1e2e' '#${scheme.base00}' \
| ${lib.getExe pkgs.imagemagick} svg:- png:$out
'';
in {
options.mods.stylix = { options.mods.stylix = {
colorscheme = lib.mkOption { colorscheme = lib.mkOption {
default = "catppuccin-mocha"; default = "catppuccin-mocha";
example = { example = {
# custom tokyo night # custom tokyo night
base00 = "1A1B26"; base00 = "1A1B26";
# base01 = "16161E";
# base01 = "15161e";
base01 = "191a25"; base01 = "191a25";
base02 = "2F3549"; base02 = "2F3549";
base03 = "444B6A"; base03 = "444B6A";
@ -44,6 +25,10 @@ in {
base0A = "0DB9D7"; base0A = "0DB9D7";
base0B = "9ECE6A"; base0B = "9ECE6A";
base0C = "B4F9F8"; base0C = "B4F9F8";
# base0D = "2AC3DE";
# base0D = "A9B1D6";
# base0D = "62A0EA";
# base0D = "779EF1";
base0D = "366fea"; base0D = "366fea";
base0E = "BB9AF7"; base0E = "BB9AF7";
base0F = "F7768E"; base0F = "F7768E";
@ -59,8 +44,6 @@ in {
Can be an attribute set with base00 to base0F, Can be an attribute set with base00 to base0F,
a string that leads to a yaml file in base16-schemes path, a string that leads to a yaml file in base16-schemes path,
or a path to a custom yaml file. or a path to a custom yaml file.
Also supports the oxiced theme in an oxiced attrset.
''; '';
}; };
cursor = lib.mkOption { cursor = lib.mkOption {
@ -76,22 +59,22 @@ in {
fonts = lib.mkOption { fonts = lib.mkOption {
default = { default = {
serif = { serif = {
package = unstable.adwaita-fonts; package = pkgs.adwaita-fonts;
name = "Adwaita Sans"; name = "Adwaita Sans";
}; };
sansSerif = { sansSerif = {
package = unstable.adwaita-fonts; package = pkgs.adwaita-fonts;
name = "Adwaita Sans"; name = "Adwaita Sans";
}; };
monospace = { monospace = {
package = unstable.nerd-fonts.jetbrains-mono; package = pkgs.nerd-fonts.jetbrains-mono;
name = "JetBrainsMono Nerd Font Mono"; name = "JetBrainsMono Nerd Font Mono";
}; };
emoji = { emoji = {
package = pkgs.noto-fonts-color-emoji; package = pkgs.noto-fonts-emoji;
name = "Noto Color Emoji"; name = "Noto Color Emoji";
}; };
}; };
@ -100,24 +83,23 @@ in {
description = "font config"; description = "font config";
}; };
}; };
config = let config =
scheme =
if builtins.isAttrs config.mods.stylix.colorscheme
then config.mods.stylix.colorscheme
else "${pkgs.base16-schemes}/share/themes/${config.mods.stylix.colorscheme}.yaml";
in
(lib.optionalAttrs (options ? stylix) { (lib.optionalAttrs (options ? stylix) {
stylix = { stylix = {
enable = true; enable = true;
image = mkDashDefault (mkWallpaper scheme); image = ../../base/black.jpg;
polarity = mkDashDefault "dark"; polarity = "dark";
targets = { targets = {
nixvim.enable = mkDashDefault false; nixvim.enable = false;
fish.enable = mkDashDefault false; fish.enable = false;
}; };
fonts = config.mods.stylix.fonts; fonts = config.mods.stylix.fonts;
cursor = config.mods.stylix.cursor; cursor = config.mods.stylix.cursor;
base16Scheme = scheme; base16Scheme = (
if builtins.isAttrs config.mods.stylix.colorscheme
then config.mods.stylix.colorscheme
else "${pkgs.base16-schemes}/share/themes/${config.mods.stylix.colorscheme}.yaml"
);
}; };
}) })
// lib.optionalAttrs (options ? environment.systemPackages) { // lib.optionalAttrs (options ? environment.systemPackages) {

View file

@ -1,28 +0,0 @@
{
lib,
options,
config,
...
}: {
options.mods.superfreq = {
enable = lib.mkOption {
default = false;
example = true;
type = lib.types.bool;
description = ''Enables superfreq'';
};
settings = lib.mkOption {
default = {};
example = {};
type = with lib.types; attrsOf anything;
description = ''Superfreq config'';
};
};
config = lib.optionalAttrs (options ? services.superfreq) {
services.superfreq = {
enable = config.mods.superfreq.enable;
settings = config.mods.superfreq.settings;
};
};
}

View file

@ -3,6 +3,7 @@
config, config,
options, options,
pkgs, pkgs,
alternativePkgs,
... ...
}: let }: let
callPackage = lib.callPackageWith pkgs; callPackage = lib.callPackageWith pkgs;
@ -23,7 +24,7 @@ in {
}; };
config = lib.mkIf config.mods.teams.enable ( config = lib.mkIf config.mods.teams.enable (
lib.optionalAttrs (options ? home.packages) { lib.optionalAttrs (options ? home.packages) {
home.packages = [(callPackage ../../override/teams.nix {inherit (pkgs) chromium;})]; home.packages = [(callPackage ../../override/teams.nix {chromium = alternativePkgs.chromium;})];
} }
// (lib.optionalAttrs (options ? boot.kernelModules) { // (lib.optionalAttrs (options ? boot.kernelModules) {
boot = { boot = {

View file

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

View file

@ -1,403 +0,0 @@
{lib, ...}: let
wmWorkspace = with lib.types; {
options = {
name = lib.mkOption {
default = "";
example = "1";
type = str;
description = "Name of the workspace";
};
default = lib.mkOption {
default = false;
example = true;
type = bool;
description = "Whether the workspace is the default workspace. (Currently doesn't do anything on niri)";
};
monitor = lib.mkOption {
default = "";
example = "DP-1";
type = str;
description = "Name of the monitor to bind the workspace to";
};
};
};
wmOptions = with lib.types; {
options = {
name = lib.mkOption {
default = "DP-1";
example = "DP-1";
type = str;
description = "Name of the monitor";
};
resolutionX = lib.mkOption {
default = 1920;
example = 2560;
type = number;
description = "ResolutionX of the monitor";
};
resolutionY = lib.mkOption {
default = 1080;
example = 1440;
type = number;
description = "ResolutionY of the monitor";
};
refreshrate = lib.mkOption {
default = 60;
example = 144;
type = number;
description = "Refreshrate of the monitor";
};
positionX = lib.mkOption {
default = 0;
example = 1920;
type = number;
description = "PositionX of the monitor";
};
positionY = lib.mkOption {
default = 0;
example = 1080;
type = number;
description = "PositionY of the monitor";
};
scale = lib.mkOption {
default = 1;
example = 2;
type = number;
description = "Scale of the monitor";
};
transform = lib.mkOption {
default = "0";
example = "90";
type = enum ["0" "90" "180" "270" "360"];
description = "Transform of the monitor";
};
vrr = lib.mkOption {
default = false;
example = true;
type = bool;
description = "VRR status of the monitor";
};
};
};
modKeys = lib.types.enum ["Mod" "Super" "Alt" "Shift" "Ctrl"];
customCommand = with lib.types; {
options = {
niri = lib.mkOption {
default = null;
example = "kitty";
type = either null str;
description = "Command to use in niri";
};
hyprland = lib.mkOption {
default = null;
example = "kitty";
type = either null str;
description = "Command to use in hyprland";
};
};
};
envOptions = with lib.types; {
options = {
all = lib.mkOption {
default = {};
example = {};
type = attrsOf str;
description = "General Env";
};
niri = lib.mkOption {
default = {};
example = {};
type = attrsOf str;
description = "Niri Env";
};
hyprland = lib.mkOption {
default = {};
example = {};
type = attrsOf str;
description = "Hyprland Env";
};
};
};
startupOptions = with lib.types; {
options = {
all = lib.mkOption {
default = [];
example = [];
type = listOf str;
description = "General Startup commands";
};
niri = lib.mkOption {
default = [];
example = [];
type = listOf str;
description = "Niri Startup commands";
};
hyprland = lib.mkOption {
default = [];
example = [];
type = listOf str;
description = "Hyprland Startup commands";
};
};
};
windowRuleOptions = with lib.types; {
options = {
niri = lib.mkOption {
default = [];
example = [];
type = listOf lines;
description = "Niri window rules";
};
hyprland = lib.mkOption {
default = [];
example = [];
type = listOf str;
description = "Hyprland window rules";
};
};
};
bindOptions = with lib.types; {
options = {
modKeys = lib.mkOption {
default = [];
example = ["Mod"];
type = listOf modKeys;
description = "List of modifier keys";
};
key = lib.mkOption {
default = "";
example = "Q";
type = str;
description = "Key to bind";
};
command = lib.mkOption {
default = "";
example = "killActive";
type = either (submodule customCommand) (enum [
"spawn"
"spawn-sh"
"quit"
"killActive"
"moveFocusUp"
"moveFocusRight"
"moveFocusDown"
"moveFocusLeft"
"moveWindowUp"
"moveWindowRight"
"moveWindowDown"
"moveWindowLeft"
"focusWorkspace"
"moveToWorkspace"
"toggleFloating"
"toggleFullscreen"
]);
description = "Command to execute";
};
args = lib.mkOption {
default = [];
example = [];
type = listOf str;
description = "Additional arguments for the command";
};
meta = lib.mkOption {
default = {};
example = {};
type = submodule {
options = {
niri = lib.mkOption {
default = {};
type = submodule {
options = {
desc = lib.mkOption {
default = "";
type = str;
description = "Description for Hotkey overview";
};
repeat = lib.mkOption {
type = bool;
default = true;
description = "Whether to repeat the keybind on hold";
};
allowInhibit = lib.mkOption {
type = bool;
default = true;
description = "Whether to allow inhibiting";
};
allowWhileLocked = lib.mkOption {
type = bool;
default = false;
description = "Whether to allow while locked";
};
cooldown = lib.mkOption {
type = number;
default = 0;
description = "Cooldown on bind";
};
};
};
description = "Niri meta for keybinds";
};
hyprland = lib.mkOption {
default = {};
type = submodule {
options = {
repeat = lib.mkOption {
type = bool;
default = true;
description = "Whether to repeat the keybind on hold";
};
};
};
description = "Niri meta for keybinds";
};
};
};
description = "Custom metadata per bind. Note, only supported environments are taken into account.";
};
};
};
in {
options.mods.wm = {
modKey = lib.mkOption {
default = "Super";
example = "Alt";
type = modKeys;
description = "Mod key";
};
env = lib.mkOption {
default = {};
example = {
all = {
EDITOR = "Neovim";
};
niri = {
EDITOR = "Emacs";
};
};
type = with lib.types; either (submodule envOptions) (attrsOf str);
description = "Environment configuration";
};
useDefaultEnv = lib.mkOption {
default = true;
example = false;
type = lib.types.bool;
description = "Whether to use default env variables";
};
startup = lib.mkOption {
default = [];
example = {
all = ["oxinoti"];
niri = ["someniricommand"];
hyprland = ["somehyprlandcommand"];
};
type = with lib.types; either (submodule startupOptions) (listOf str);
description = "Start commands";
};
useDefaultStartup = lib.mkOption {
default = true;
example = false;
type = lib.types.bool;
description = "Whether to use default autostart commands";
};
useDefaultWindowRules = lib.mkOption {
default = true;
example = false;
type = lib.types.bool;
description = "Whether to use default window rules";
};
windowRules = lib.mkOption {
default = {};
example = {
niri = [
''
match app-id=r#"^org\.keepassxc\.KeePassXC$"#
match app-id=r#"^org\.gnome\.World\.Secrets$"#
block-out-from "screen-capture"
''
''
match app-id=r#"^steam$"#
open-on-workspace "0"
''
];
};
type = lib.types.submodule windowRuleOptions;
description = "Window rules";
};
workspaces = lib.mkOption {
default = [];
example = [
{
name = "chat";
monitor = "DP-1";
}
];
type =
lib.types.listOf (lib.types.submodule wmWorkspace);
description = "Workspace configuration";
};
monitors = lib.mkOption {
default = [];
example = [
{
name = "DP-1";
resolutionX = 1920;
resolutionY = 1080;
refreshrate = 144;
positionX = 0;
positionY = 0;
scale = 1;
transform = "0";
vrr = false;
}
];
type =
lib.types.listOf (lib.types.submodule wmOptions);
description = "Monitor configuration";
};
useDefaultBinds = lib.mkOption {
default = true;
example = false;
type = lib.types.bool;
description = "Whether to use default keybinds";
};
binds = lib.mkOption {
default = [];
example = [
{
modKeys = ["Mod"];
key = "Q";
command = "killActive";
args = [];
meta = {
niri = {
desc = "Kill the active window";
repeat = false;
};
hyprland = {};
};
}
];
type =
lib.types.listOf (lib.types.submodule bindOptions);
description = "Bind configuration";
};
};
}

View file

@ -6,7 +6,7 @@
}: { }: {
options.mods.xkb = { options.mods.xkb = {
layout = lib.mkOption { layout = lib.mkOption {
default = "enIntUmlaut"; default = "dashie";
example = "us"; example = "us";
type = lib.types.str; type = lib.types.str;
description = "Your layout"; description = "Your layout";
@ -18,11 +18,13 @@
description = "Your variant"; description = "Your variant";
}; };
}; };
config = lib.optionalAttrs (options ? services.xserver) { config = (
# Configure keymap in X11 lib.optionalAttrs (options ? services.xserver) {
services.xserver = { # Configure keymap in X11
xkb.layout = "${config.mods.xkb.layout}"; services.xserver = {
xkb.variant = "${config.mods.xkb.variant}"; xkb.layout = "${config.mods.xkb.layout}";
}; xkb.variant = "${config.mods.xkb.variant}";
}; };
}
);
} }

View file

@ -15,5 +15,5 @@
}; };
}; };
config = lib.optionalAttrs (options ? hardware) {hardware.xone.enable = config.mods.xone.enable;}; config = lib.optionalAttrs (options ? hardware) {hardware.xone.enable = true;};
} }

View file

@ -1,5 +1,4 @@
{ {
pkgs,
lib, lib,
config, config,
options, options,
@ -36,26 +35,16 @@
type = with lib.types; attrsOf anything; type = with lib.types; attrsOf anything;
description = "Additional keymap for yazi"; description = "Additional keymap for yazi";
}; };
plugins = lib.mkOption {
default = {
inherit (pkgs.yaziPlugins) piper diff gitui wl-clipboard;
};
example = {};
type = with lib.types; attrsOf anything;
description = "Additional keymap for yazi";
};
}; };
config = let config = let
conf = import ./yazi.nix; conf = import ./yazi.nix;
in in
lib.optionalAttrs (options ? home.packages) ( lib.optionalAttrs (options ? home.packages) (
lib.mkIf config.mods.yazi.enable { lib.mkIf config.mods.yazi.enable {
home.packages = [pkgs.glow];
programs.yazi = { programs.yazi = {
inherit (conf) enable; enable = conf.enable;
settings = conf.settings // config.mods.yazi.additionalKeymap; settings = conf.settings // config.mods.yazi.additionalKeymap;
keymap = conf.keymap // config.mods.yazi.additionalConfig; keymap = conf.keymap // config.mods.yazi.additionalConfig;
inherit (config.mods.yazi) plugins;
}; };
} }
); );

View file

@ -31,7 +31,7 @@
]; ];
image = [ image = [
{ {
run = ''eog "$@"''; run = ''imv "$@"'';
orphan = true; orphan = true;
display_name = "Open"; display_name = "Open";
} }
@ -85,28 +85,19 @@
}; };
plugin = { plugin = {
prepend_previewers = [ prepend_previewers = [
{
name = "*.tar";
run = ''piper --format=url -- tar tf "$1"'';
}
{ {
name = "*.md"; name = "*.md";
run = ''piper -- CLICOLOR_FORCE=1 glow -w=$w -s=dark "$1"''; run = "glow";
} }
{ {
mime = "text/csv"; mime = "text/csv";
run = ''piper -- bat -p --color=always "$1"''; run = "miller";
} }
]; ];
}; };
}; };
keymap = { keymap = {
mgr.keymap = [ manager.keymap = [
{
on = "<Backspace>";
run = "backspace";
desc = "Delete the character before the cursor";
}
{ {
on = ["<Esc>"]; on = ["<Esc>"];
run = "escape"; run = "escape";
@ -377,13 +368,13 @@
desc = "Cancel the ongoing search"; desc = "Cancel the ongoing search";
} }
{ {
on = ["Z"]; on = ["z"];
run = "plugin zoxide"; run = "jump zoxide";
desc = "Jump to a directory using zoxide"; desc = "Jump to a directory using zoxide";
} }
{ {
on = ["z"]; on = ["Z"];
run = "plugin fzf"; run = "jump fzf";
desc = "Jump to a directory or reveal a file using fzf"; desc = "Jump to a directory or reveal a file using fzf";
} }
@ -768,11 +759,6 @@
]; ];
input.keymap = [ input.keymap = [
{
on = "<Backspace>";
run = "backspace";
desc = "Delete the character before the cursor";
}
{ {
on = ["<C-q>"]; on = ["<C-q>"];
run = "close"; run = "close";

View file

@ -1,456 +0,0 @@
diff --git a/src/background/user-storage.ts b/src/background/user-storage.ts
index 54612fb3b1f6..298e5032fc94 100644
--- a/src/background/user-storage.ts
+++ b/src/background/user-storage.ts
@@ -5,7 +5,7 @@ import {PromiseBarrier} from '../utils/promise-barrier';
import {isURLMatched} from '../utils/url';
import {validateSettings} from '../utils/validation';
-import {readSyncStorage, readLocalStorage, writeSyncStorage, writeLocalStorage, removeSyncStorage, removeLocalStorage} from './utils/extension-api';
+import {readManagedStorage, readSyncStorage, readLocalStorage, writeSyncStorage, writeLocalStorage, removeSyncStorage, removeLocalStorage} from './utils/extension-api';
import {logWarn} from './utils/log';
@@ -78,12 +78,7 @@ export default class UserStorage {
return settings;
}
- private static async loadSettingsFromStorage(): Promise<UserSettings> {
- if (UserStorage.loadBarrier) {
- return await UserStorage.loadBarrier.entry();
- }
- UserStorage.loadBarrier = new PromiseBarrier();
-
+ private static async loadSettingsFromStorageWithoutManaged(): Promise<UserSettings> {
let local = await readLocalStorage(DEFAULT_SETTINGS);
if (local.schemeVersion < 2) {
@@ -113,10 +108,8 @@ export default class UserStorage {
if (local.syncSettings == null) {
local.syncSettings = DEFAULT_SETTINGS.syncSettings;
}
+
if (!local.syncSettings) {
- UserStorage.migrateAutomationSettings(local);
- UserStorage.fillDefaults(local);
- UserStorage.loadBarrier.resolve(local);
return local;
}
@@ -126,18 +119,34 @@ export default class UserStorage {
local.syncSettings = false;
UserStorage.set({syncSettings: false});
UserStorage.saveSyncSetting(false);
- UserStorage.loadBarrier.resolve(local);
return local;
}
const {errors: syncCfgErrors} = validateSettings($sync);
syncCfgErrors.forEach((err) => logWarn(err));
+ return $sync;
+ }
+
+ private static async loadSettingsFromStorage(): Promise<UserSettings> {
+ if (UserStorage.loadBarrier) {
+ return await UserStorage.loadBarrier.entry();
+ }
+ UserStorage.loadBarrier = new PromiseBarrier();
- UserStorage.migrateAutomationSettings($sync);
- UserStorage.fillDefaults($sync);
+ let settings = await UserStorage.loadSettingsFromStorageWithoutManaged();
- UserStorage.loadBarrier.resolve($sync);
- return $sync;
+ const managed = await readManagedStorage(settings);
+ const {errors: managedCfgErrors} = validateSettings(managed);
+ if (managedCfgErrors.length === 0) {
+ settings = managed;
+ } else {
+ managedCfgErrors.forEach((err) => logWarn(err));
+ }
+
+ UserStorage.migrateAutomationSettings(settings);
+ UserStorage.fillDefaults(settings);
+ UserStorage.loadBarrier.resolve(settings);
+ return settings;
}
static async saveSettings(): Promise<void> {
diff --git a/src/background/utils/extension-api.ts b/src/background/utils/extension-api.ts
index 6d18fc0919df..6812ac2e4224 100644
--- a/src/background/utils/extension-api.ts
+++ b/src/background/utils/extension-api.ts
@@ -97,6 +97,19 @@ export async function readLocalStorage<T extends {[key: string]: any}>(defaults:
});
}
+export async function readManagedStorage<T extends {[key: string]: any}>(defaults: T): Promise<T> {
+ return new Promise<T>((resolve) => {
+ chrome.storage.managed.get(defaults, (managed: T) => {
+ if (chrome.runtime.lastError) {
+ console.error(chrome.runtime.lastError.message);
+ resolve(defaults);
+ return;
+ }
+ resolve(managed);
+ });
+ });
+}
+
function prepareSyncStorage<T extends {[key: string]: any}>(values: T): {[key: string]: any} {
for (const key in values) {
const value = values[key];
diff --git a/src/managed-storage.json b/src/managed-storage.json
new file mode 100644
index 000000000000..e394d0f1ff60
--- /dev/null
+++ b/src/managed-storage.json
@@ -0,0 +1,304 @@
+{
+
+ "$schema": "http://json-schema.org/draft-07/schema#",
+ "type": "object",
+ "properties": {
+ "schemeVersion": {
+ "type": "integer"
+ },
+ "enabled": {
+ "type": "boolean"
+ },
+ "fetchNews": {
+ "type": "boolean"
+ },
+ "theme": {
+ "$ref": "Theme"
+ },
+ "presets": {
+ "type": "array",
+ "items": {
+ "$ref": "ThemePreset"
+ }
+ },
+ "customThemes": {
+ "type": "array",
+ "items": {
+ "$ref": "CustomSiteConfig"
+ }
+ },
+ "enabledByDefault": {
+ "type": "boolean"
+ },
+ "enabledFor": {
+ "type": "array",
+ "items": {
+ "type": "string",
+ "minLength": 1
+ }
+ },
+ "disabledFor": {
+ "type": "array",
+ "items": {
+ "type": "string",
+ "minLength": 1
+ }
+ },
+ "changeBrowserTheme": {
+ "type": "boolean"
+ },
+ "syncSettings": {
+ "type": "boolean"
+ },
+ "syncSitesFixes": {
+ "type": "boolean"
+ },
+ "automation": {
+ "$ref": "Automation"
+ },
+ "time": {
+ "$ref": "TimeSettings"
+ },
+ "location": {
+ "$ref": "LocationSettings"
+ },
+ "previewNewDesign": {
+ "type": "boolean"
+ },
+ "previewNewestDesign": {
+ "type": "boolean"
+ },
+ "enableForPDF": {
+ "type": "boolean"
+ },
+ "enableForProtectedPages": {
+ "type": "boolean"
+ },
+ "enableContextMenus": {
+ "type": "boolean"
+ },
+ "detectDarkTheme": {
+ "type": "boolean"
+ },
+ // Chrome's JSON schema format is weird and doesn't support `definitions` property and thus `#/definitions` references
+ // https://datatracker.ietf.org/doc/html/draft-zyp-json-schema-03
+ // This "property" mimics it
+ "definitions": {
+ "type": "object",
+ "properties": {
+ "Theme": {
+ "id": "Theme",
+ "type": "object",
+ "properties": {
+ "mode": {
+ "$ref": "FilterMode"
+ },
+ "brightness": {
+ "type": "integer",
+ "minimum": 0,
+ "maximum": 200
+ },
+ "contrast": {
+ "type": "integer",
+ "minimum": 0,
+ "maximum": 200
+ },
+ "grayscale": {
+ "type": "integer",
+ "minimum": 0,
+ "maximum": 100
+ },
+ "sepia": {
+ "type": "integer",
+ "minimum": 0,
+ "maximum": 100
+ },
+ "useFont": {
+ "type": "boolean"
+ },
+ "fontFamily": {
+ "type": "string",
+ "minLength": 1
+ },
+ "textStroke": {
+ "type": "number"
+ },
+ "engine": {
+ "type": "string",
+ "enum": [
+ "cssFilter",
+ "svgFilter",
+ "staticTheme",
+ "dynamicTheme"
+ ]
+ },
+ "stylesheet": {
+ "type": "string"
+ },
+ "darkSchemeBackgroundColor": {
+ "$ref": "HexColor"
+ },
+ "darkSchemeTextColor": {
+ "$ref": "HexColor"
+ },
+ "lightSchemeBackgroundColor": {
+ "$ref": "HexColor"
+ },
+ "lightSchemeTextColor": {
+ "$ref": "HexColor"
+ },
+ "scrollbarColor": {
+ "$ref": "HexColorOrAuto"
+ },
+ "selectionColor": {
+ "$ref": "HexColorOrAuto"
+ },
+ "styleSystemControls": {
+ "type": "boolean"
+ },
+ "lightColorScheme": {
+ "type": "string",
+ "minLength": 1
+ },
+ "darkColorScheme": {
+ "type": "string",
+ "minLength": 1
+ },
+ "immediateModify": {
+ "type": "boolean"
+ }
+ }
+ },
+ "HexColor": {
+ "id": "HexColor",
+ "type": "string",
+ "pattern": "^[0-9a-f]{6}$"
+ },
+ "HexColorOrAuto": {
+ "id": "HexColorOrAuto",
+ "type": "string",
+ "pattern": "^([0-9a-f]{6}|auto)$"
+ },
+ "FilterMode": {
+ "id": "FilterMode",
+ "type": "integer",
+ "enum": [
+ 0,
+ 1
+ ]
+ },
+ "ThemePreset": {
+ "id": "ThemePreset",
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string",
+ "minLength": 1
+ },
+ "name": {
+ "type": "string",
+ "minLength": 1
+ },
+ "urls": {
+ "type": "array",
+ "items": {
+ "type": "string",
+ "minLength": 1
+ }
+ },
+ "theme": {
+ "$ref": "Theme"
+ }
+ },
+ "required": [
+ "id",
+ "name",
+ "urls",
+ "theme"
+ ]
+ },
+ "CustomSiteConfig": {
+ "id": "CustomSiteConfig",
+ "type": "object",
+ "properties": {
+ "url": {
+ "type": "array",
+ "items": {
+ "type": "string",
+ "minLength": 1
+ }
+ },
+ "theme": {
+ "$ref": "Theme"
+ },
+ "builtin": {
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "url",
+ "theme"
+ ]
+ },
+ "Automation": {
+ "id": "Automation",
+ "type": "object",
+ "properties": {
+ "enabled": {
+ "type": "boolean"
+ },
+ "mode": {
+ "$ref": "AutomationMode"
+ },
+ "behavior": {
+ "type": "string",
+ "enum": [
+ "OnOff",
+ "Scheme"
+ ]
+ }
+ }
+ },
+ "AutomationMode": {
+ "id": "AutomationMode",
+ "type": "string",
+ "enum": [
+ "",
+ "time",
+ "system",
+ "location"
+ ]
+ },
+ "TimeSettings": {
+ "id": "TimeSettings",
+ "type": "object",
+ "properties": {
+ "activation": {
+ "$ref": "Time"
+ },
+ "deactivation": {
+ "$ref": "Time"
+ }
+ }
+ },
+ "Time": {
+ "id": "Time",
+ "type": "string",
+ "pattern": "^((0?[0-9])|(1[0-9])|(2[0-3])):([0-5][0-9])$"
+ },
+ "LocationSettings": {
+ "id": "LocationSettings",
+ "type": "object",
+ "properties": {
+ "latitude": {
+ "type": "number"
+ },
+ "longitude": {
+ "type": "number"
+ }
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/tasks/bundle-manifest.js b/tasks/bundle-manifest.js
index ae29531e67b7..f4058a129f52 100644
--- a/tasks/bundle-manifest.js
+++ b/tasks/bundle-manifest.js
@@ -4,6 +4,7 @@ import {PLATFORM} from './platform.js';
import * as reload from './reload.js';
import {createTask} from './task.js';
import {readJSON, writeJSON} from './utils.js';
+import {copyFile} from 'node:fs/promises';
async function patchManifest(platform, debug, watch, test) {
const manifest = await readJSON(absolutePath('src/manifest.json'));
@@ -16,6 +17,11 @@ async function patchManifest(platform, debug, watch, test) {
if (platform === PLATFORM.CHROMIUM_MV3) {
patched.browser_action = undefined;
}
+ if (platform === PLATFORM.CHROMIUM_MV2 || platform === PLATFORM.CHROMIUM_MV3) {
+ patched.storage = {
+ managed_schema: 'managed-storage.json',
+ };
+ }
if (debug) {
patched.version = '1';
patched.description = `Debug build, platform: ${platform}, watch: ${watch ? 'yes' : 'no'}.`;
@@ -42,6 +48,9 @@ async function manifests({platforms, debug, watch, test}) {
const manifest = await patchManifest(platform, debug, watch, test);
const destDir = getDestDir({debug, platform});
await writeJSON(`${destDir}/manifest.json`, manifest);
+ if (platform === PLATFORM.CHROMIUM_MV2 || platform === PLATFORM.CHROMIUM_MV3) {
+ await copyFile(absolutePath('src/managed-storage.json'), `${destDir}/managed-storage.json`);
+ }
}
}
@@ -49,7 +58,7 @@ const bundleManifestTask = createTask(
'bundle-manifest',
manifests,
).addWatcher(
- ['src/manifest*.json'],
+ ['src/manifest*.json', 'src/managed-storage.json'],
async (changedFiles, _, buildPlatforms) => {
const chrome = changedFiles.some((file) => file.endsWith('manifest.json'));
const platforms = {};

View file

@ -1,25 +0,0 @@
# credits to Voronind for darkreader config https://github.com/voronind-com/nix/blob/main/home/program/firefox/default.nix
{
lib,
dashNixAdditionalProps,
...
}: let
stable = dashNixAdditionalProps.pkgsDarkreader;
in
stable.buildNpmPackage rec {
version = "4.9.99";
pname = "dark-reader";
npmDepsHash = "sha256-m41HkwgbeRRmxJALQFJl/grYjjIqFOc47ltaesob1FA=";
env.ESBUILD_BINARY_PATH = lib.getExe stable.esbuild;
patches = [./darkeader.patch];
src = stable.fetchFromGitHub {
hash = "sha256-K375/4qOyE1Tp/T5V5uCGcNd1IVVbT1Pjdnq/8oRHj0=";
owner = "darkreader";
repo = "darkreader";
rev = "v${version}";
};
installPhase = ''
mkdir -p $out
cp build/release/darkreader-firefox.xpi $out/latest.xpi
'';
}