Add mime type module and refactor options
This commit is contained in:
parent
3a2266d44f
commit
69fb898087
25 changed files with 641 additions and 478 deletions
|
|
@ -1,8 +1,12 @@
|
||||||
# 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, build_systems, lib, ... }:
|
{
|
||||||
|
pkgs,
|
||||||
|
build_systems,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}:
|
||||||
let
|
let
|
||||||
makeOptionsDoc = configuration:
|
makeOptionsDoc = configuration: pkgs.nixosOptionsDoc { options = configuration; };
|
||||||
pkgs.nixosOptionsDoc { options = configuration; };
|
|
||||||
generateDocs = obj: ''
|
generateDocs = obj: ''
|
||||||
touch src/${obj.fst}.md
|
touch src/${obj.fst}.md
|
||||||
sed '/*Declared by:*/,/^$/d' <${obj.snd.optionsCommonMark} >> src/${obj.fst}.md
|
sed '/*Declared by:*/,/^$/d' <${obj.snd.optionsCommonMark} >> src/${obj.fst}.md
|
||||||
|
|
@ -11,18 +15,17 @@ let
|
||||||
echo "- [${name}](${name}.md)" >> src/SUMMARY.md
|
echo "- [${name}](${name}.md)" >> src/SUMMARY.md
|
||||||
'';
|
'';
|
||||||
system = (build_systems ../example/.)."example".options;
|
system = (build_systems ../example/.)."example".options;
|
||||||
makeOptionsDocPrograms = name:
|
makeOptionsDocPrograms = name: pkgs.nixosOptionsDoc { options = system.mods.${name}; };
|
||||||
pkgs.nixosOptionsDoc { options = system.mods.${name}; };
|
|
||||||
conf = makeOptionsDoc system.conf;
|
conf = makeOptionsDoc system.conf;
|
||||||
paths = builtins.readDir ../modules/programs;
|
paths = builtins.readDir ../modules/programs;
|
||||||
names = lib.lists.remove "default"
|
names = lib.lists.remove "default" (
|
||||||
(map (name: lib.strings.removeSuffix ".nix" name)
|
map (name: lib.strings.removeSuffix ".nix" name) (lib.attrsets.mapAttrsToList (name: _: name) paths)
|
||||||
(lib.attrsets.mapAttrsToList (name: _: name) paths));
|
);
|
||||||
mods = map makeOptionsDocPrograms names;
|
mods = map makeOptionsDocPrograms names;
|
||||||
docs =
|
docs = lib.strings.concatLines (map generateDocs (lib.lists.zipLists names mods));
|
||||||
lib.strings.concatLines (map generateDocs (lib.lists.zipLists names mods));
|
|
||||||
summary = lib.strings.concatStringsSep " " (map summaryAppend names);
|
summary = lib.strings.concatStringsSep " " (map summaryAppend names);
|
||||||
in pkgs.stdenvNoCC.mkDerivation {
|
in
|
||||||
|
pkgs.stdenvNoCC.mkDerivation {
|
||||||
name = "dashNix-book";
|
name = "dashNix-book";
|
||||||
src = ./.;
|
src = ./.;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -198,4 +198,6 @@ For package lists, please check the individual modules, as the lists can be long
|
||||||
- fish: Enables and configures fish shell
|
- fish: Enables and configures fish shell
|
||||||
- kitty: Enables and configures kitty terminal
|
- kitty: Enables and configures kitty terminal
|
||||||
- oxi: My own programs, can be selectively disabled, or as a whole
|
- oxi: My own programs, can be selectively disabled, or as a whole
|
||||||
|
- mime: Mime type configuration
|
||||||
|
- xkb: Keyboard layout configuration
|
||||||
- scripts: Various preconfigured scripts with the ability to add more
|
- scripts: Various preconfigured scripts with the ability to add more
|
||||||
|
|
|
||||||
|
|
@ -4,8 +4,7 @@
|
||||||
inputs = {
|
inputs = {
|
||||||
dashvim.url = "github:DashieTM/DashVim";
|
dashvim.url = "github:DashieTM/DashVim";
|
||||||
hyprland.url = "git+https://github.com/hyprwm/Hyprland?submodules=1";
|
hyprland.url = "git+https://github.com/hyprwm/Hyprland?submodules=1";
|
||||||
ironbar.url =
|
ironbar.url = "github:JakeStanger/ironbar?ref=3a1c60442382f970cdb7669814b6ef3594d9f048";
|
||||||
"github:JakeStanger/ironbar?ref=3a1c60442382f970cdb7669814b6ef3594d9f048";
|
|
||||||
anyrun.url = "github:Kirottu/anyrun";
|
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";
|
||||||
|
|
@ -22,9 +21,11 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = { ... }@inputs: {
|
outputs =
|
||||||
nixosConfigurations = inputs.dashNix.dashNixLib.build_systems ./.;
|
{ ... }@inputs:
|
||||||
};
|
{
|
||||||
|
nixosConfigurations = inputs.dashNix.dashNixLib.build_systems ./.;
|
||||||
|
};
|
||||||
|
|
||||||
nixConfig = {
|
nixConfig = {
|
||||||
builders-use-substitutes = true;
|
builders-use-substitutes = true;
|
||||||
|
|
|
||||||
|
|
@ -66,7 +66,7 @@
|
||||||
# ];
|
# ];
|
||||||
# or amd, whatever you have
|
# or amd, whatever you have
|
||||||
gpu.nvidia.enable = true;
|
gpu.nvidia.enable = true;
|
||||||
kde_connect.enable = true;
|
kdeConnect.enable = true;
|
||||||
# login manager:
|
# login manager:
|
||||||
# default is greetd
|
# default is greetd
|
||||||
# greetd = { };
|
# greetd = { };
|
||||||
|
|
|
||||||
17
flake.nix
17
flake.nix
|
|
@ -5,7 +5,9 @@
|
||||||
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";
|
||||||
|
|
||||||
nix-flatpak = { url = "github:gmodena/nix-flatpak"; };
|
nix-flatpak = {
|
||||||
|
url = "github:gmodena/nix-flatpak";
|
||||||
|
};
|
||||||
|
|
||||||
home-manager = {
|
home-manager = {
|
||||||
url = "github:nix-community/home-manager";
|
url = "github:nix-community/home-manager";
|
||||||
|
|
@ -23,8 +25,7 @@
|
||||||
hyprland.url = "git+https://github.com/hyprwm/Hyprland?submodules=1";
|
hyprland.url = "git+https://github.com/hyprwm/Hyprland?submodules=1";
|
||||||
|
|
||||||
ironbar = {
|
ironbar = {
|
||||||
url =
|
url = "github:JakeStanger/ironbar?ref=3a1c60442382f970cdb7669814b6ef3594d9f048";
|
||||||
"github:JakeStanger/ironbar?ref=3a1c60442382f970cdb7669814b6ef3594d9f048";
|
|
||||||
};
|
};
|
||||||
|
|
||||||
stylix.url = "github:danth/stylix";
|
stylix.url = "github:danth/stylix";
|
||||||
|
|
@ -47,11 +48,14 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = { self, ... }@inputs:
|
outputs =
|
||||||
|
{ self, ... }@inputs:
|
||||||
let
|
let
|
||||||
stable = import inputs.stable {
|
stable = import inputs.stable {
|
||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
config = { allowUnfree = true; };
|
config = {
|
||||||
|
allowUnfree = true;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
pkgs = import inputs.nixpkgs {
|
pkgs = import inputs.nixpkgs {
|
||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
|
|
@ -61,7 +65,8 @@
|
||||||
allowUnfree = true;
|
allowUnfree = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
in rec {
|
in
|
||||||
|
rec {
|
||||||
dashNixLib = import ./lib {
|
dashNixLib = import ./lib {
|
||||||
inherit self inputs pkgs;
|
inherit self inputs pkgs;
|
||||||
lib = inputs.nixpkgs.lib;
|
lib = inputs.nixpkgs.lib;
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,6 @@
|
||||||
imports =
|
imports =
|
||||||
[
|
[
|
||||||
./common.nix
|
./common.nix
|
||||||
./xdg.nix
|
|
||||||
./themes
|
./themes
|
||||||
./sync.nix
|
./sync.nix
|
||||||
]
|
]
|
||||||
|
|
|
||||||
86
home/xdg.nix
86
home/xdg.nix
|
|
@ -1,86 +0,0 @@
|
||||||
# Copyright (c) 2020-2021 Mihai Fufezan
|
|
||||||
# credits to fufexan https://github.com/fufexan/dotfiles/blob/main/home/terminal/programs/xdg.nix
|
|
||||||
{ config, ... }:
|
|
||||||
let
|
|
||||||
browser = [ "firefox" ];
|
|
||||||
imageViewer = [ "imv" ];
|
|
||||||
videoPlayer = [ "mpv" ];
|
|
||||||
audioPlayer = [ "io.bassi.Amberol" ];
|
|
||||||
|
|
||||||
xdgAssociations =
|
|
||||||
type: program: list:
|
|
||||||
builtins.listToAttrs (
|
|
||||||
map (e: {
|
|
||||||
name = "${type}/${e}";
|
|
||||||
value = program;
|
|
||||||
}) list
|
|
||||||
);
|
|
||||||
|
|
||||||
image = xdgAssociations "image" imageViewer [
|
|
||||||
"png"
|
|
||||||
"svg"
|
|
||||||
"jpeg"
|
|
||||||
"gif"
|
|
||||||
];
|
|
||||||
video = xdgAssociations "video" videoPlayer [
|
|
||||||
"mp4"
|
|
||||||
"avi"
|
|
||||||
"mkv"
|
|
||||||
];
|
|
||||||
audio = xdgAssociations "audio" audioPlayer [
|
|
||||||
"mp3"
|
|
||||||
"flac"
|
|
||||||
"wav"
|
|
||||||
"aac"
|
|
||||||
];
|
|
||||||
browserTypes =
|
|
||||||
(xdgAssociations "application" browser [
|
|
||||||
"json"
|
|
||||||
"x-extension-htm"
|
|
||||||
"x-extension-html"
|
|
||||||
"x-extension-shtml"
|
|
||||||
"x-extension-xht"
|
|
||||||
"x-extension-xhtml"
|
|
||||||
])
|
|
||||||
// (xdgAssociations "x-scheme-handler" browser [
|
|
||||||
"about"
|
|
||||||
"ftp"
|
|
||||||
"http"
|
|
||||||
"https"
|
|
||||||
"unknown"
|
|
||||||
]);
|
|
||||||
|
|
||||||
# XDG MIME types
|
|
||||||
associations = builtins.mapAttrs (_: v: (map (e: "${e}.desktop") v)) (
|
|
||||||
{
|
|
||||||
"application/pdf" = [ "org.pwmt.zathura-pdf-mupdf" ];
|
|
||||||
"text/html" = browser;
|
|
||||||
"text/plain" = [ "neovide" ];
|
|
||||||
"x-scheme-handler/chrome" = [ "com.brave.browser" ];
|
|
||||||
"inode/directory" = [ "yazi" ];
|
|
||||||
}
|
|
||||||
// image
|
|
||||||
// video
|
|
||||||
// audio
|
|
||||||
// browserTypes
|
|
||||||
);
|
|
||||||
in
|
|
||||||
{
|
|
||||||
xdg = {
|
|
||||||
enable = true;
|
|
||||||
cacheHome = config.home.homeDirectory + "/.local/cache";
|
|
||||||
|
|
||||||
mimeApps = {
|
|
||||||
enable = true;
|
|
||||||
defaultApplications = associations;
|
|
||||||
};
|
|
||||||
|
|
||||||
userDirs = {
|
|
||||||
enable = true;
|
|
||||||
createDirectories = true;
|
|
||||||
extraConfig = {
|
|
||||||
XDG_SCREENSHOTS_DIR = "${config.xdg.userDirs.pictures}/Screenshots";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
162
lib/default.nix
162
lib/default.nix
|
|
@ -1,51 +1,61 @@
|
||||||
{ inputs, pkgs, self, lib, additionalMods ? {
|
{
|
||||||
nixos = [ ];
|
inputs,
|
||||||
home = [ ];
|
pkgs,
|
||||||
}, mods ? {
|
self,
|
||||||
nixos = [
|
lib,
|
||||||
inputs.home-manager.nixosModules.home-manager
|
additionalMods ? {
|
||||||
inputs.stylix.nixosModules.stylix
|
nixos = [ ];
|
||||||
../base
|
home = [ ];
|
||||||
../home
|
},
|
||||||
../modules
|
mods ? {
|
||||||
];
|
nixos = [
|
||||||
home = [
|
inputs.home-manager.nixosModules.home-manager
|
||||||
inputs.anyrun.homeManagerModules.default
|
inputs.stylix.nixosModules.stylix
|
||||||
inputs.ironbar.homeManagerModules.default
|
../base
|
||||||
inputs.oxicalc.homeManagerModules.default
|
../home
|
||||||
inputs.oxishut.homeManagerModules.default
|
../modules
|
||||||
inputs.oxinoti.homeManagerModules.default
|
];
|
||||||
inputs.oxidash.homeManagerModules.default
|
home = [
|
||||||
inputs.oxipaste.homeManagerModules.default
|
inputs.anyrun.homeManagerModules.default
|
||||||
inputs.hyprdock.homeManagerModules.default
|
inputs.ironbar.homeManagerModules.default
|
||||||
inputs.hyprland.homeManagerModules.default
|
inputs.oxicalc.homeManagerModules.default
|
||||||
inputs.reset.homeManagerModules.default
|
inputs.oxishut.homeManagerModules.default
|
||||||
inputs.nix-flatpak.homeManagerModules.nix-flatpak
|
inputs.oxinoti.homeManagerModules.default
|
||||||
inputs.sops-nix.homeManagerModules.sops
|
inputs.oxidash.homeManagerModules.default
|
||||||
inputs.dashvim.homeManagerModules.dashvim
|
inputs.oxipaste.homeManagerModules.default
|
||||||
../modules
|
inputs.hyprdock.homeManagerModules.default
|
||||||
];
|
inputs.hyprland.homeManagerModules.default
|
||||||
}, ... }: {
|
inputs.reset.homeManagerModules.default
|
||||||
/* *
|
inputs.nix-flatpak.homeManagerModules.nix-flatpak
|
||||||
# build_systems
|
inputs.sops-nix.homeManagerModules.sops
|
||||||
|
inputs.dashvim.homeManagerModules.dashvim
|
||||||
|
../modules
|
||||||
|
];
|
||||||
|
},
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
*
|
||||||
|
# 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.
|
||||||
|
|
||||||
A minimal configuration requires the file configuration.nix within each system directory, this will be the base config that is used across both NisOS and home-manager, specific optional files can also be added, hardware.nix for NisOS configuration and home.nix for home-manager configuration.
|
A minimal configuration requires the file configuration.nix within each system directory, this will be the base config that is used across both NisOS and home-manager, specific optional files can also be added, hardware.nix for NisOS configuration and home.nix for home-manager configuration.
|
||||||
|
|
||||||
The second parameter is the root of your configuration, which should be ./. in most cases.
|
The second parameter is the root of your configuration, which should be ./. in most cases.
|
||||||
|
|
||||||
`root`
|
`root`
|
||||||
|
|
||||||
: the root path of your configuration
|
: the root path of your configuration
|
||||||
|
|
||||||
# Example usage
|
# Example usage
|
||||||
:::{.example}
|
:::{.example}
|
||||||
```nix
|
```nix
|
||||||
nixosConfigurations =
|
nixosConfigurations =
|
||||||
(build_systems [ "nixos" ] ./.);
|
(build_systems [ "nixos" ] ./.);
|
||||||
```
|
```
|
||||||
:::
|
:::
|
||||||
*/
|
*/
|
||||||
# let
|
# let
|
||||||
# paths = builtins.readDir ;
|
# paths = builtins.readDir ;
|
||||||
|
|
@ -54,31 +64,53 @@
|
||||||
# );
|
# );
|
||||||
|
|
||||||
# in
|
# in
|
||||||
build_systems = root:
|
build_systems =
|
||||||
builtins.listToAttrs (map (name: {
|
root:
|
||||||
name = name;
|
builtins.listToAttrs (
|
||||||
value = let
|
map
|
||||||
mod = root + /hosts/${name}/configuration.nix;
|
(name: {
|
||||||
additionalNixosConfig = root + /hosts/${name}/hardware.nix;
|
name = name;
|
||||||
additionalHomeConfig = root + /hosts/${name}/home.nix;
|
value =
|
||||||
in inputs.nixpkgs.lib.nixosSystem {
|
let
|
||||||
specialArgs = {
|
mod = root + /hosts/${name}/configuration.nix;
|
||||||
inherit self inputs pkgs mod additionalHomeConfig root;
|
additionalNixosConfig = root + /hosts/${name}/hardware.nix;
|
||||||
hostName = name;
|
additionalHomeConfig = root + /hosts/${name}/home.nix;
|
||||||
homeMods = mods.home;
|
in
|
||||||
additionalHomeMods = additionalMods.home;
|
inputs.nixpkgs.lib.nixosSystem {
|
||||||
};
|
specialArgs = {
|
||||||
modules = [ mod ] ++ mods.nixos ++ additionalMods.nixos
|
inherit
|
||||||
++ inputs.nixpkgs.lib.optional
|
self
|
||||||
(builtins.pathExists additionalNixosConfig) additionalNixosConfig
|
inputs
|
||||||
++ inputs.nixpkgs.lib.optional (builtins.pathExists mod) mod;
|
pkgs
|
||||||
};
|
mod
|
||||||
}) (lib.lists.remove "" (lib.attrsets.mapAttrsToList
|
additionalHomeConfig
|
||||||
(name: fType: if fType == "directory" then name else "")
|
root
|
||||||
(builtins.readDir (root + /hosts)))));
|
;
|
||||||
|
hostName = name;
|
||||||
|
homeMods = mods.home;
|
||||||
|
additionalHomeMods = additionalMods.home;
|
||||||
|
};
|
||||||
|
modules =
|
||||||
|
[ 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)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
buildIso = inputs.nixpkgs.lib.nixosSystem {
|
buildIso = inputs.nixpkgs.lib.nixosSystem {
|
||||||
specialArgs = { inherit self inputs pkgs; };
|
specialArgs = {
|
||||||
|
inherit self inputs pkgs;
|
||||||
|
};
|
||||||
modules = [ ../iso/configuration.nix ];
|
modules = [ ../iso/configuration.nix ];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@
|
||||||
}:
|
}:
|
||||||
{
|
{
|
||||||
options.mods = {
|
options.mods = {
|
||||||
base_packages = {
|
basePackages = {
|
||||||
enable = lib.mkOption {
|
enable = lib.mkOption {
|
||||||
default = true;
|
default = true;
|
||||||
example = false;
|
example = false;
|
||||||
|
|
@ -17,7 +17,7 @@
|
||||||
Enables default system packages.
|
Enables default system packages.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
additional_packages = lib.mkOption {
|
additionalPackages = lib.mkOption {
|
||||||
default = [ ];
|
default = [ ];
|
||||||
example = [ pkgs.openssl ];
|
example = [ pkgs.openssl ];
|
||||||
type = with lib.types; listOf package;
|
type = with lib.types; listOf package;
|
||||||
|
|
@ -26,7 +26,7 @@
|
||||||
Note that these are installed even if base packages is disabled, e.g. you can also use this as the only packages to install.
|
Note that these are installed even if base packages is disabled, e.g. you can also use this as the only packages to install.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
special_programs = lib.mkOption {
|
specialPrograms = lib.mkOption {
|
||||||
default = { };
|
default = { };
|
||||||
example = { };
|
example = { };
|
||||||
type = with lib.types; attrsOf anything;
|
type = with lib.types; attrsOf anything;
|
||||||
|
|
@ -34,7 +34,7 @@
|
||||||
special program configuration to be added which require programs.something notation.
|
special program configuration to be added which require programs.something notation.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
special_services = lib.mkOption {
|
specialServices = lib.mkOption {
|
||||||
default = { };
|
default = { };
|
||||||
example = { };
|
example = { };
|
||||||
type = with lib.types; attrsOf anything;
|
type = with lib.types; attrsOf anything;
|
||||||
|
|
@ -47,7 +47,7 @@
|
||||||
|
|
||||||
config = lib.optionalAttrs (options ? environment.systemPackages) {
|
config = lib.optionalAttrs (options ? environment.systemPackages) {
|
||||||
environment.systemPackages =
|
environment.systemPackages =
|
||||||
if config.mods.base_packages.enable then
|
if config.mods.basePackages.enable then
|
||||||
with pkgs;
|
with pkgs;
|
||||||
[
|
[
|
||||||
adwaita-icon-theme
|
adwaita-icon-theme
|
||||||
|
|
@ -73,13 +73,13 @@
|
||||||
upower
|
upower
|
||||||
xorg.xkbutils
|
xorg.xkbutils
|
||||||
]
|
]
|
||||||
++ config.mods.base_packages.additional_packages
|
++ config.mods.basePackages.additionalPackages
|
||||||
else
|
else
|
||||||
config.mods.base_packages.additional_packages;
|
config.mods.basePackages.additionalPackages;
|
||||||
|
|
||||||
gtk.iconCache.enable = false;
|
gtk.iconCache.enable = false;
|
||||||
services =
|
services =
|
||||||
if config.mods.base_packages.enable then
|
if config.mods.basePackages.enable then
|
||||||
{
|
{
|
||||||
upower.enable = true;
|
upower.enable = true;
|
||||||
dbus = {
|
dbus = {
|
||||||
|
|
@ -92,12 +92,12 @@
|
||||||
openFirewall = true;
|
openFirewall = true;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
// config.mods.base_packages.special_services
|
// config.mods.basePackages.specialServices
|
||||||
else
|
else
|
||||||
config.mods.base_packages.special_services;
|
config.mods.basePackages.specialServices;
|
||||||
|
|
||||||
programs =
|
programs =
|
||||||
if config.mods.base_packages.enable then
|
if config.mods.basePackages.enable then
|
||||||
{
|
{
|
||||||
nix-ld = {
|
nix-ld = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
@ -119,9 +119,9 @@
|
||||||
ssh.startAgent = true;
|
ssh.startAgent = true;
|
||||||
gnupg.agent.enable = true;
|
gnupg.agent.enable = true;
|
||||||
}
|
}
|
||||||
// config.mods.base_packages.special_programs
|
// config.mods.basePackages.specialPrograms
|
||||||
else
|
else
|
||||||
config.mods.base_packages.special_programs;
|
config.mods.basePackages.specialPrograms;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
./acpid.nix
|
./acpid.nix
|
||||||
./base_packages.nix
|
./basePackages.nix
|
||||||
./bluetooth.nix
|
./bluetooth.nix
|
||||||
./coding.nix
|
./coding.nix
|
||||||
./drives.nix
|
./drives.nix
|
||||||
|
|
@ -12,13 +12,13 @@
|
||||||
./gdm.nix
|
./gdm.nix
|
||||||
./git.nix
|
./git.nix
|
||||||
./gnome.nix
|
./gnome.nix
|
||||||
./gnome_services.nix
|
./gnomeServices.nix
|
||||||
./gpu.nix
|
./gpu.nix
|
||||||
./greetd.nix
|
./greetd.nix
|
||||||
./home_packages.nix
|
./homePackages.nix
|
||||||
./hyprland
|
./hyprland
|
||||||
./kde.nix
|
./kde.nix
|
||||||
./kde_connect.nix
|
./kdeConnect.nix
|
||||||
./keepassxc.nix
|
./keepassxc.nix
|
||||||
./kitty.nix
|
./kitty.nix
|
||||||
./media.nix
|
./media.nix
|
||||||
|
|
@ -35,6 +35,7 @@
|
||||||
./stylix.nix
|
./stylix.nix
|
||||||
./teams.nix
|
./teams.nix
|
||||||
./virtualbox.nix
|
./virtualbox.nix
|
||||||
|
./mime.nix
|
||||||
./xkb.nix
|
./xkb.nix
|
||||||
./xone.nix
|
./xone.nix
|
||||||
./yazi
|
./yazi
|
||||||
|
|
|
||||||
|
|
@ -130,7 +130,9 @@ in
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
# TODO make this convert to choice of drives -> thanks to funny types this doesn't work...
|
# TODO make this convert to choice of drives -> thanks to funny types this doesn't work...
|
||||||
swapDevices = lib.mkIf config.mods.drives.useSwap.enable [ { device = "/dev/disk/by-label/SWAP"; } ];
|
swapDevices = lib.mkIf config.mods.drives.useSwap.enable [
|
||||||
|
{ device = "/dev/disk/by-label/SWAP"; }
|
||||||
|
];
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -54,6 +54,7 @@
|
||||||
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"
|
||||||
|
abbr --add gc "git commit --amend --no-edit"
|
||||||
abbr --add g+ 'bear -- g++ -Wextra -Werror -std=c++20'
|
abbr --add g+ 'bear -- g++ -Wextra -Werror -std=c++20'
|
||||||
abbr --add s "kitty +kitten ssh"
|
abbr --add s "kitty +kitten ssh"
|
||||||
abbr --add zl 'z "" '
|
abbr --add zl 'z "" '
|
||||||
|
|
|
||||||
|
|
@ -44,13 +44,13 @@
|
||||||
type = lib.types.bool;
|
type = lib.types.bool;
|
||||||
description = "Whether to use gamemode";
|
description = "Whether to use gamemode";
|
||||||
};
|
};
|
||||||
gpu_optimization = lib.mkOption {
|
gpuOptimization = lib.mkOption {
|
||||||
default = true;
|
default = true;
|
||||||
example = false;
|
example = false;
|
||||||
type = lib.types.bool;
|
type = lib.types.bool;
|
||||||
description = "Whether to use GPU performance setting. NOTE: this is at your own risk!";
|
description = "Whether to use GPU performance setting. NOTE: this is at your own risk!";
|
||||||
};
|
};
|
||||||
gpu_device = lib.mkOption {
|
gpuDevice = lib.mkOption {
|
||||||
default = 0;
|
default = 0;
|
||||||
example = 1;
|
example = 1;
|
||||||
type = lib.types.int;
|
type = lib.types.int;
|
||||||
|
|
@ -71,9 +71,9 @@
|
||||||
general = {
|
general = {
|
||||||
governor = "performance";
|
governor = "performance";
|
||||||
};
|
};
|
||||||
gpu = lib.mkIf config.mods.gaming.gpu_optimization {
|
gpu = lib.mkIf config.mods.gaming.gpuOptimization {
|
||||||
apply_gpu_optimisations = "accept-responsibility";
|
apply_gpu_optimisations = "accept-responsibility";
|
||||||
gpu_device = config.mods.gaming.gpu_device;
|
gpu_device = config.mods.gaming.gpuDevice;
|
||||||
amd_performance_level = "high";
|
amd_performance_level = "high";
|
||||||
nv_powermizer_mode = 1;
|
nv_powermizer_mode = 1;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,6 @@
|
||||||
lib,
|
lib,
|
||||||
config,
|
config,
|
||||||
options,
|
options,
|
||||||
pkgs,
|
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
{
|
{
|
||||||
|
|
@ -19,7 +18,7 @@
|
||||||
type = lib.types.str;
|
type = lib.types.str;
|
||||||
description = "Git email";
|
description = "Git email";
|
||||||
};
|
};
|
||||||
ssh_config = lib.mkOption {
|
sshConfig = lib.mkOption {
|
||||||
default = ''
|
default = ''
|
||||||
Host github.com
|
Host github.com
|
||||||
${
|
${
|
||||||
|
|
@ -63,7 +62,7 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
home.file.".ssh/config".text = config.mods.git.ssh_config;
|
home.file.".ssh/config".text = config.mods.git.sshConfig;
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@
|
||||||
}:
|
}:
|
||||||
{
|
{
|
||||||
options.mods = {
|
options.mods = {
|
||||||
gnome_services.enable = lib.mkOption {
|
gnomeServices.enable = lib.mkOption {
|
||||||
default = true;
|
default = true;
|
||||||
example = false;
|
example = false;
|
||||||
type = lib.types.bool;
|
type = lib.types.bool;
|
||||||
|
|
@ -26,7 +26,7 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = lib.mkIf config.mods.gnome_services.enable (
|
config = lib.mkIf config.mods.gnomeServices.enable (
|
||||||
lib.optionalAttrs (options ? services.gnome.gnome-keyring) {
|
lib.optionalAttrs (options ? services.gnome.gnome-keyring) {
|
||||||
programs.dconf.enable = true;
|
programs.dconf.enable = true;
|
||||||
services = {
|
services = {
|
||||||
|
|
@ -6,14 +6,14 @@
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
{
|
{
|
||||||
options.mods.home_packages = {
|
options.mods.homePackages = {
|
||||||
useDefaultPackages = lib.mkOption {
|
useDefaultPackages = lib.mkOption {
|
||||||
default = true;
|
default = true;
|
||||||
example = false;
|
example = false;
|
||||||
type = lib.types.bool;
|
type = lib.types.bool;
|
||||||
description = "Use default packages (will use additional_packages only if disabled)";
|
description = "Use default packages (will use additional_packages only if disabled)";
|
||||||
};
|
};
|
||||||
additional_packages = 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;
|
||||||
|
|
@ -22,7 +22,7 @@
|
||||||
Will be installed regardless of default home manager packages are installed.
|
Will be installed regardless of default home manager packages are installed.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
special_programs = lib.mkOption {
|
specialPrograms = lib.mkOption {
|
||||||
default = { };
|
default = { };
|
||||||
example = { };
|
example = { };
|
||||||
type = with lib.types; attrsOf anything;
|
type = with lib.types; attrsOf anything;
|
||||||
|
|
@ -30,7 +30,7 @@
|
||||||
special program configuration to be added which require programs.something notation.
|
special program configuration to be added which require programs.something notation.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
special_services = lib.mkOption {
|
specialServices = lib.mkOption {
|
||||||
default = { };
|
default = { };
|
||||||
example = { };
|
example = { };
|
||||||
type = with lib.types; attrsOf anything;
|
type = with lib.types; attrsOf anything;
|
||||||
|
|
@ -77,18 +77,18 @@
|
||||||
};
|
};
|
||||||
config = lib.optionalAttrs (options ? home.packages) {
|
config = lib.optionalAttrs (options ? home.packages) {
|
||||||
home.packages =
|
home.packages =
|
||||||
if config.mods.home_packages.useDefaultPackages then
|
if config.mods.homePackages.useDefaultPackages then
|
||||||
with pkgs;
|
with pkgs;
|
||||||
[
|
[
|
||||||
# TODO add fcp once fixed....
|
# TODO add fcp once fixed....
|
||||||
(lib.mkIf config.mods.home_packages.ncspot ncspot)
|
(lib.mkIf config.mods.homePackages.ncspot ncspot)
|
||||||
(lib.mkIf config.mods.home_packages.vesktop vesktop)
|
(lib.mkIf config.mods.homePackages.vesktop vesktop)
|
||||||
(lib.mkIf config.mods.home_packages.nextcloudClient nextcloud-client)
|
(lib.mkIf config.mods.homePackages.nextcloudClient nextcloud-client)
|
||||||
(lib.mkIf (!isNull config.mods.home_packages.matrixClient) config.mods.home_packages.matrixClient)
|
(lib.mkIf (!isNull config.mods.homePackages.matrixClient) config.mods.homePackages.matrixClient)
|
||||||
(lib.mkIf (!isNull config.mods.home_packages.mailClient) config.mods.home_packages.mailClient)
|
(lib.mkIf (!isNull config.mods.homePackages.mailClient) config.mods.homePackages.mailClient)
|
||||||
(lib.mkIf (
|
(lib.mkIf (
|
||||||
!isNull config.mods.home_packages.additionalBrowser
|
!isNull config.mods.homePackages.additionalBrowser
|
||||||
) config.mods.home_packages.additionalBrowser)
|
) config.mods.homePackages.additionalBrowser)
|
||||||
adw-gtk3
|
adw-gtk3
|
||||||
bat
|
bat
|
||||||
brightnessctl
|
brightnessctl
|
||||||
|
|
@ -119,9 +119,9 @@
|
||||||
zenith
|
zenith
|
||||||
zoxide
|
zoxide
|
||||||
]
|
]
|
||||||
++ config.mods.home_packages.additional_packages
|
++ config.mods.homePackages.additionalPackages
|
||||||
else
|
else
|
||||||
config.mods.home_packages.additional_packages;
|
config.mods.homePackages.additionalPackages;
|
||||||
|
|
||||||
xdg.configFile."direnv/direnv.toml".source = (pkgs.formats.toml { }).generate "direnv" {
|
xdg.configFile."direnv/direnv.toml".source = (pkgs.formats.toml { }).generate "direnv" {
|
||||||
global = {
|
global = {
|
||||||
|
|
@ -129,14 +129,14 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
programs =
|
programs =
|
||||||
if config.mods.home_packages.useDefaultPackages then
|
if config.mods.homePackages.useDefaultPackages then
|
||||||
config.mods.home_packages.special_programs
|
config.mods.homePackages.specialPrograms
|
||||||
else
|
else
|
||||||
config.mods.home_packages.special_programs;
|
config.mods.homePackages.specialPrograms;
|
||||||
services =
|
services =
|
||||||
if config.mods.home_packages.useDefaultPackages then
|
if config.mods.homePackages.useDefaultPackages then
|
||||||
config.mods.home_packages.special_services
|
config.mods.homePackages.specialServices
|
||||||
else
|
else
|
||||||
config.mods.home_packages.special_services;
|
config.mods.homePackages.specialServices;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
@ -16,7 +16,7 @@
|
||||||
type = lib.types.bool;
|
type = lib.types.bool;
|
||||||
description = "Enables anyrun";
|
description = "Enables anyrun";
|
||||||
};
|
};
|
||||||
use_default_config = lib.mkOption {
|
useDefaultConfig = lib.mkOption {
|
||||||
default = true;
|
default = true;
|
||||||
example = false;
|
example = false;
|
||||||
type = lib.types.bool;
|
type = lib.types.bool;
|
||||||
|
|
@ -24,7 +24,7 @@
|
||||||
Use preconfigured anyrun config.
|
Use preconfigured anyrun config.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
custom_config = lib.mkOption {
|
customConfig = lib.mkOption {
|
||||||
default = { };
|
default = { };
|
||||||
example = { };
|
example = { };
|
||||||
type = with lib.types; attrsOf anything;
|
type = with lib.types; attrsOf anything;
|
||||||
|
|
@ -33,7 +33,7 @@
|
||||||
Will be merged with default configuration if enabled.
|
Will be merged with default configuration if enabled.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
use_default_css = lib.mkOption {
|
useDefaultCss = lib.mkOption {
|
||||||
default = true;
|
default = true;
|
||||||
example = false;
|
example = false;
|
||||||
type = lib.types.bool;
|
type = lib.types.bool;
|
||||||
|
|
@ -41,7 +41,7 @@
|
||||||
Use preconfigured anyrun css.
|
Use preconfigured anyrun css.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
custom_css = lib.mkOption {
|
customCss = lib.mkOption {
|
||||||
default = '''';
|
default = '''';
|
||||||
example = ''
|
example = ''
|
||||||
#window {
|
#window {
|
||||||
|
|
@ -63,7 +63,7 @@
|
||||||
programs.anyrun = {
|
programs.anyrun = {
|
||||||
enable = true;
|
enable = true;
|
||||||
config =
|
config =
|
||||||
if config.mods.hyprland.anyrun.use_default_config then
|
if config.mods.hyprland.anyrun.useDefaultConfig then
|
||||||
{
|
{
|
||||||
plugins = [
|
plugins = [
|
||||||
inputs.anyrun.packages.${pkgs.system}.applications
|
inputs.anyrun.packages.${pkgs.system}.applications
|
||||||
|
|
@ -83,12 +83,12 @@
|
||||||
hidePluginInfo = true;
|
hidePluginInfo = true;
|
||||||
closeOnClick = true;
|
closeOnClick = true;
|
||||||
}
|
}
|
||||||
// config.mods.hyprland.anyrun.custom_config
|
// config.mods.hyprland.anyrun.customConfig
|
||||||
else
|
else
|
||||||
config.mods.hyprland.anyrun.custom_config;
|
config.mods.hyprland.anyrun.customConfig;
|
||||||
|
|
||||||
extraCss =
|
extraCss =
|
||||||
if config.mods.hyprland.anyrun.use_default_css then
|
if config.mods.hyprland.anyrun.useDefaultCss then
|
||||||
''
|
''
|
||||||
#window {
|
#window {
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
|
|
@ -137,9 +137,9 @@
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
}
|
}
|
||||||
''
|
''
|
||||||
+ config.mods.hyprland.anyrun.custom_css
|
+ config.mods.hyprland.anyrun.customCss
|
||||||
else
|
else
|
||||||
config.mods.hyprland.anyrun.custom_css;
|
config.mods.hyprland.anyrun.customCss;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@
|
||||||
The workspace configuration for hyprland.
|
The workspace configuration for hyprland.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
no_atomic = lib.mkOption {
|
noAtomic = lib.mkOption {
|
||||||
default = false;
|
default = false;
|
||||||
example = true;
|
example = true;
|
||||||
type = lib.types.bool;
|
type = lib.types.bool;
|
||||||
|
|
@ -45,7 +45,7 @@
|
||||||
Use tearing
|
Use tearing
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
extra_autostart = lib.mkOption {
|
extraAutostart = lib.mkOption {
|
||||||
default = [ ];
|
default = [ ];
|
||||||
example = [ "your application" ];
|
example = [ "your application" ];
|
||||||
type = lib.types.listOf lib.types.str;
|
type = lib.types.listOf lib.types.str;
|
||||||
|
|
@ -53,7 +53,7 @@
|
||||||
Extra exec_once.
|
Extra exec_once.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
use_default_config = lib.mkOption {
|
useDefaultConfig = lib.mkOption {
|
||||||
default = true;
|
default = true;
|
||||||
example = false;
|
example = false;
|
||||||
type = lib.types.bool;
|
type = lib.types.bool;
|
||||||
|
|
@ -61,7 +61,7 @@
|
||||||
Use preconfigured Hyprland config.
|
Use preconfigured Hyprland config.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
custom_config = lib.mkOption {
|
customConfig = lib.mkOption {
|
||||||
default = { };
|
default = { };
|
||||||
example = { };
|
example = { };
|
||||||
type = with lib.types; attrsOf anything;
|
type = with lib.types; attrsOf anything;
|
||||||
|
|
@ -100,7 +100,7 @@
|
||||||
wayland.windowManager.hyprland = {
|
wayland.windowManager.hyprland = {
|
||||||
enable = true;
|
enable = true;
|
||||||
settings =
|
settings =
|
||||||
if config.mods.hyprland.use_default_config then
|
if config.mods.hyprland.useDefaultConfig then
|
||||||
{
|
{
|
||||||
"$mod" = "SUPER";
|
"$mod" = "SUPER";
|
||||||
|
|
||||||
|
|
@ -131,14 +131,14 @@
|
||||||
"$mod SUPERSHIFT,K,exec, playerctl -a pause & hyprlock & systemctl hibernate"
|
"$mod SUPERSHIFT,K,exec, playerctl -a pause & hyprlock & systemctl hibernate"
|
||||||
|
|
||||||
# media keys
|
# media keys
|
||||||
(lib.mkIf config.mods.scripts.audio-control ",XF86AudioMute,exec, audio-control mute")
|
(lib.mkIf config.mods.scripts.audioControl ",XF86AudioMute,exec, audio-control mute")
|
||||||
(lib.mkIf config.mods.scripts.audio-control ",XF86AudioLowerVolume,exec, audio-control sink -5%")
|
(lib.mkIf config.mods.scripts.audioControl ",XF86AudioLowerVolume,exec, audio-control sink -5%")
|
||||||
(lib.mkIf config.mods.scripts.audio-control ",XF86AudioRaiseVolume,exec, audio-control sink +5%")
|
(lib.mkIf config.mods.scripts.audioControl ",XF86AudioRaiseVolume,exec, audio-control sink +5%")
|
||||||
",XF86AudioPlay,exec, playerctl play-pause"
|
",XF86AudioPlay,exec, playerctl play-pause"
|
||||||
",XF86AudioNext,exec, playerctl next"
|
",XF86AudioNext,exec, playerctl next"
|
||||||
",XF86AudioPrev,exec, playerctl previous"
|
",XF86AudioPrev,exec, playerctl previous"
|
||||||
(lib.mkIf config.mods.scripts.change-brightness ",XF86MonBrightnessDown,exec, change-brightness brightness 10%-")
|
(lib.mkIf config.mods.scripts.changeBrightness ",XF86MonBrightnessDown,exec, change-brightness brightness 10%-")
|
||||||
(lib.mkIf config.mods.scripts.change-brightness ",XF86MonBrightnessUp,exec, change-brightness brightness +10%")
|
(lib.mkIf config.mods.scripts.changeBrightness ",XF86MonBrightnessUp,exec, change-brightness brightness +10%")
|
||||||
|
|
||||||
# hyprland keybinds
|
# hyprland keybinds
|
||||||
# misc
|
# misc
|
||||||
|
|
@ -219,7 +219,7 @@
|
||||||
border_size = 3;
|
border_size = 3;
|
||||||
"col.active_border" = lib.mkOverride 51 "0xFFFF0000 0xFF00FF00 0xFF0000FF 45deg";
|
"col.active_border" = lib.mkOverride 51 "0xFFFF0000 0xFF00FF00 0xFF0000FF 45deg";
|
||||||
# "col.inactive_border" = "0x66333333";
|
# "col.inactive_border" = "0x66333333";
|
||||||
allow_tearing = lib.mkIf config.mods.hyprland.no_atomic true;
|
allow_tearing = lib.mkIf config.mods.hyprland.noAtomic true;
|
||||||
};
|
};
|
||||||
|
|
||||||
decoration = {
|
decoration = {
|
||||||
|
|
@ -297,7 +297,7 @@
|
||||||
"QT_WAYLAND_DISABLE_WINDOWDECORATION,1"
|
"QT_WAYLAND_DISABLE_WINDOWDECORATION,1"
|
||||||
"QT_SCALE_FACTOR,1"
|
"QT_SCALE_FACTOR,1"
|
||||||
''EDITOR,"neovide --novsync --nofork"''
|
''EDITOR,"neovide --novsync --nofork"''
|
||||||
(lib.mkIf config.mods.hyprland.no_atomic "WLR_DRM_NO_ATOMIC,1")
|
(lib.mkIf config.mods.hyprland.noAtomic "WLR_DRM_NO_ATOMIC,1")
|
||||||
"GTK_USE_PORTAL, 1"
|
"GTK_USE_PORTAL, 1"
|
||||||
|
|
||||||
(lib.mkIf config.mods.gpu.nvidia.enable "LIBVA_DRIVER_NAME,nvidia")
|
(lib.mkIf config.mods.gpu.nvidia.enable "LIBVA_DRIVER_NAME,nvidia")
|
||||||
|
|
@ -349,7 +349,7 @@
|
||||||
# should be taken care of with the new systemd services
|
# should be taken care of with the new systemd services
|
||||||
# "nextcloud --background"
|
# "nextcloud --background"
|
||||||
"oxinoti"
|
"oxinoti"
|
||||||
] ++ config.mods.hyprland.extra_autostart;
|
] ++ config.mods.hyprland.extraAutostart;
|
||||||
|
|
||||||
# plugin = {
|
# plugin = {
|
||||||
# hyprspace = {
|
# hyprspace = {
|
||||||
|
|
@ -359,9 +359,9 @@
|
||||||
# };
|
# };
|
||||||
# };
|
# };
|
||||||
}
|
}
|
||||||
// config.mods.hyprland.custom_config
|
// config.mods.hyprland.customConfig
|
||||||
else
|
else
|
||||||
lib.mkForce config.mods.hyprland.custom_config;
|
lib.mkForce config.mods.hyprland.customConfig;
|
||||||
plugins = config.mods.hyprland.plugins;
|
plugins = config.mods.hyprland.plugins;
|
||||||
#inputs.Hyprspace.packages.${pkgs.system}.Hyprspace
|
#inputs.Hyprspace.packages.${pkgs.system}.Hyprspace
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
{
|
{
|
||||||
lib,
|
lib,
|
||||||
config,
|
config,
|
||||||
pkgs,
|
|
||||||
options,
|
options,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
|
|
@ -17,262 +16,309 @@ in
|
||||||
type = lib.types.bool;
|
type = lib.types.bool;
|
||||||
description = "Enables ironbar";
|
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 (
|
config = lib.mkIf config.mods.hyprland.ironbar.enable (
|
||||||
lib.optionalAttrs (options ? programs.ironbar) {
|
lib.optionalAttrs (options ? programs.ironbar) {
|
||||||
|
|
||||||
programs.ironbar = {
|
programs.ironbar = {
|
||||||
enable = true;
|
enable = true;
|
||||||
style = ''
|
style =
|
||||||
@import url("/home/${username}/.config/gtk-3.0/gtk.css");
|
if config.mods.hyprland.ironbar.useDefaultCss then
|
||||||
|
''
|
||||||
|
@import url("/home/${username}/.config/gtk-3.0/gtk.css");
|
||||||
|
|
||||||
* {
|
* {
|
||||||
color: #71bbe6;
|
color: #71bbe6;
|
||||||
padding: 0px;
|
padding: 0px;
|
||||||
margin: 0px;
|
margin: 0px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.background {
|
.background {
|
||||||
background-color: rgba(0, 0, 0, 0);
|
background-color: rgba(0, 0, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
.workspaces {
|
.workspaces {
|
||||||
margin: 2px 0px 0px 5px;
|
margin: 2px 0px 0px 5px;
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
/* background-color: #2b2c3b; */
|
/* background-color: #2b2c3b; */
|
||||||
background-color: #1E1E2E;
|
background-color: #1E1E2E;
|
||||||
padding: 2px 5px 2px 5px;
|
padding: 2px 5px 2px 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.workspaces .item {
|
.workspaces .item {
|
||||||
margin: 0px 3px 0px 3px;
|
margin: 0px 3px 0px 3px;
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
border-radius: 100%;
|
border-radius: 100%;
|
||||||
padding: 0px 2px 0px 3px;
|
padding: 0px 2px 0px 3px;
|
||||||
background-color: rgba(0, 0, 0, 0);
|
background-color: rgba(0, 0, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
.workspaces .item:hover {
|
.workspaces .item:hover {
|
||||||
background-color: #3e4152;
|
background-color: #3e4152;
|
||||||
}
|
}
|
||||||
|
|
||||||
.workspaces .item.focused {
|
.workspaces .item.focused {
|
||||||
background-color: #3e4152;
|
background-color: #3e4152;
|
||||||
}
|
}
|
||||||
|
|
||||||
.audio-box {
|
.audio-box {
|
||||||
padding: 2em;
|
padding: 2em;
|
||||||
background-color: #1E1E2E;
|
background-color: #1E1E2E;
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.audio-slider {
|
.audio-slider {
|
||||||
padding: 5px;
|
padding: 5px;
|
||||||
margin: 5px;
|
margin: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.audio-button {
|
.audio-button {
|
||||||
padding: 5px 10px 5px 10px;
|
padding: 5px 10px 5px 10px;
|
||||||
margin: 0px 1em 20px 1em;
|
margin: 0px 1em 20px 1em;
|
||||||
border-radius: 100%;
|
border-radius: 100%;
|
||||||
font-size: 17px;
|
font-size: 17px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.audio-button-box {
|
.audio-button-box {
|
||||||
padding: 0px 2.5em 0px 2.5em;
|
padding: 0px 2.5em 0px 2.5em;
|
||||||
}
|
}
|
||||||
|
|
||||||
.focused {
|
.focused {
|
||||||
/* margin: 2px 0px 0px 0px; */
|
/* margin: 2px 0px 0px 0px; */
|
||||||
padding: 0px 5px 0px 5px;
|
padding: 0px 5px 0px 5px;
|
||||||
/* background-color: 1a1b26; */
|
/* background-color: 1a1b26; */
|
||||||
background-color: #1E1E2E;
|
background-color: #1E1E2E;
|
||||||
font-size: 17px;
|
font-size: 17px;
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#bar #end {
|
#bar #end {
|
||||||
margin: 0px 5px 0px 0px;
|
margin: 0px 5px 0px 0px;
|
||||||
padding: 0px 5px 0px 5px;
|
padding: 0px 5px 0px 5px;
|
||||||
background-color: #1E1E2E;
|
background-color: #1E1E2E;
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.popup-button {
|
.popup-button {
|
||||||
padding: 0px 5px 0px 3px;
|
padding: 0px 5px 0px 3px;
|
||||||
margin: 0em 3px;
|
margin: 0em 3px;
|
||||||
border-radius: 100%;
|
border-radius: 100%;
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
background-color: #1E1E2E;
|
background-color: #1E1E2E;
|
||||||
}
|
}
|
||||||
|
|
||||||
.popup-button-box {
|
.popup-button-box {
|
||||||
padding: 2px 0px 2px 0px;
|
padding: 2px 0px 2px 0px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.clock {
|
.clock {
|
||||||
padding: 0px 5px 0px 5px;
|
padding: 0px 5px 0px 5px;
|
||||||
font-size: 17px;
|
font-size: 17px;
|
||||||
background-color: #1E1E2E;
|
background-color: #1E1E2E;
|
||||||
}
|
}
|
||||||
|
|
||||||
.clock:hover {
|
.clock:hover {
|
||||||
background-color: #3e4152;
|
background-color: #3e4152;
|
||||||
}
|
}
|
||||||
|
|
||||||
.custom button {
|
.custom button {
|
||||||
background-color: #1E1E2E;
|
background-color: #1E1E2E;
|
||||||
}
|
}
|
||||||
|
|
||||||
.custom button:hover {
|
.custom button:hover {
|
||||||
background-color: #3e4152;
|
background-color: #3e4152;
|
||||||
}
|
}
|
||||||
|
|
||||||
.memory-usage {
|
.memory-usage {
|
||||||
font-size: 15px;
|
font-size: 15px;
|
||||||
margin: 0px 5px 0px 0px;
|
margin: 0px 5px 0px 0px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.memory-usage:hover {
|
.memory-usage:hover {
|
||||||
background-color: #3e4152;
|
background-color: #3e4152;
|
||||||
}
|
}
|
||||||
|
|
||||||
.popup-clock {
|
.popup-clock {
|
||||||
background-color: #1E1E2E;
|
background-color: #1E1E2E;
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
padding: 2px 8px 10px 8px;
|
padding: 2px 8px 10px 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.popup-clock .calendar-clock {
|
.popup-clock .calendar-clock {
|
||||||
font-size: 2.5em;
|
font-size: 2.5em;
|
||||||
padding-bottom: 0.1em;
|
padding-bottom: 0.1em;
|
||||||
}
|
}
|
||||||
|
|
||||||
.popup-clock .calendar {
|
.popup-clock .calendar {
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
font-size: 1.05em;
|
font-size: 1.05em;
|
||||||
}
|
}
|
||||||
|
|
||||||
.popup-clock .calendar:selected {
|
.popup-clock .calendar:selected {
|
||||||
background-color: #3e4152;
|
background-color: #3e4152;
|
||||||
}
|
}
|
||||||
'';
|
''
|
||||||
|
+ config.mods.hyprland.ironbar.customCss
|
||||||
|
else
|
||||||
|
config.mods.hyprland.ironbar.customCss;
|
||||||
features = [
|
features = [
|
||||||
#"another_feature"
|
#"another_feature"
|
||||||
];
|
];
|
||||||
config = {
|
config = {
|
||||||
monitors."${config.conf.defaultMonitor}" = {
|
monitors."${config.conf.defaultMonitor}" =
|
||||||
end = config.conf.ironbar.modules ++ [
|
if config.mods.hyprland.ironbar.useDefaultConfig then
|
||||||
{
|
{
|
||||||
type = "sys_info";
|
end = config.conf.ironbar.modules ++ [
|
||||||
format = [ " {memory_percent}" ];
|
|
||||||
interval.memory = 30;
|
|
||||||
class = "memory-usage";
|
|
||||||
}
|
|
||||||
{
|
|
||||||
type = "custom";
|
|
||||||
bar = [
|
|
||||||
{
|
{
|
||||||
type = "button";
|
type = "sys_info";
|
||||||
class = "popup-button";
|
format = [ " {memory_percent}" ];
|
||||||
label = "";
|
interval.memory = 30;
|
||||||
on_click = "popup:toggle";
|
class = "memory-usage";
|
||||||
}
|
}
|
||||||
];
|
|
||||||
class = "popup-button-box";
|
|
||||||
popup = [
|
|
||||||
{
|
{
|
||||||
type = "box";
|
type = "custom";
|
||||||
orientation = "vertical";
|
bar = [
|
||||||
class = "audio-box";
|
{
|
||||||
widgets = [
|
type = "button";
|
||||||
|
class = "popup-button";
|
||||||
|
label = "";
|
||||||
|
on_click = "popup:toggle";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
class = "popup-button-box";
|
||||||
|
popup = [
|
||||||
{
|
{
|
||||||
type = "box";
|
type = "box";
|
||||||
orientation = "horizontal";
|
orientation = "vertical";
|
||||||
|
class = "audio-box";
|
||||||
widgets = [
|
widgets = [
|
||||||
{
|
{
|
||||||
type = "button";
|
type = "box";
|
||||||
class = "audio-button";
|
orientation = "horizontal";
|
||||||
label = "";
|
widgets = [
|
||||||
on_click = "!/home/${username}/.config/eww/scripts/audio_control.sh bluetooth";
|
{
|
||||||
|
type = "button";
|
||||||
|
class = "audio-button";
|
||||||
|
label = "";
|
||||||
|
on_click = "!/home/${username}/.config/eww/scripts/audio_control.sh bluetooth";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
type = "button";
|
||||||
|
class = "audio-button";
|
||||||
|
label = "";
|
||||||
|
on_click = "!/home/${username}/.config/eww/scripts/audio_control.sh internal";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
class = "audio-button-box";
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
type = "button";
|
type = "label";
|
||||||
class = "audio-button";
|
label = "Output";
|
||||||
label = "";
|
}
|
||||||
on_click = "!/home/${username}/.config/eww/scripts/audio_control.sh internal";
|
{
|
||||||
|
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%";
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
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";
|
type = "custom";
|
||||||
class = "popup-button";
|
bar = [
|
||||||
label = "";
|
{
|
||||||
on_click = "!oxidash --css /home/${username}/gits/oxidash/style.css";
|
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";
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
class = "popup-button-box";
|
|
||||||
}
|
}
|
||||||
{
|
// config.mods.hyprland.ironbar.customConfig
|
||||||
type = "clock";
|
else
|
||||||
format = "%I:%M";
|
config.mods.hyprland.ironbar.customConfig;
|
||||||
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";
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@
|
||||||
{
|
{
|
||||||
|
|
||||||
options.mods = {
|
options.mods = {
|
||||||
kde_connect.enable = lib.mkOption {
|
kdeConnect.enable = lib.mkOption {
|
||||||
default = false;
|
default = false;
|
||||||
type = lib.types.bool;
|
type = lib.types.bool;
|
||||||
example = true;
|
example = true;
|
||||||
|
|
@ -18,7 +18,7 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = lib.mkIf config.mods.kde_connect.enable (
|
config = lib.mkIf config.mods.kdeConnect.enable (
|
||||||
lib.optionalAttrs (options ? networking.firewall) {
|
lib.optionalAttrs (options ? networking.firewall) {
|
||||||
networking.firewall = {
|
networking.firewall = {
|
||||||
allowedTCPPortRanges = [
|
allowedTCPPortRanges = [
|
||||||
|
|
@ -21,7 +21,7 @@
|
||||||
Additional media packages.
|
Additional media packages.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
special_programs = lib.mkOption {
|
specialPrograms = lib.mkOption {
|
||||||
default = { };
|
default = { };
|
||||||
example = { };
|
example = { };
|
||||||
type = with lib.types; attrsOf anything;
|
type = with lib.types; attrsOf anything;
|
||||||
|
|
@ -29,7 +29,7 @@
|
||||||
special program configuration to be added which require programs.something notation.
|
special program configuration to be added which require programs.something notation.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
special_services = lib.mkOption {
|
specialServices = lib.mkOption {
|
||||||
default = { };
|
default = { };
|
||||||
example = { };
|
example = { };
|
||||||
type = with lib.types; attrsOf anything;
|
type = with lib.types; attrsOf anything;
|
||||||
|
|
@ -78,13 +78,13 @@
|
||||||
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.special_programs
|
// config.mods.media.specialPrograms
|
||||||
else
|
else
|
||||||
config.mods.media.special_programs;
|
config.mods.media.specialPrograms;
|
||||||
services =
|
services =
|
||||||
if config.mods.media.useBasePackages then
|
if config.mods.media.useBasePackages then
|
||||||
config.mods.media.special_services
|
config.mods.media.specialServices
|
||||||
else
|
else
|
||||||
config.mods.media.special_services;
|
config.mods.media.specialServices;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
154
modules/programs/mime.nix
Normal file
154
modules/programs/mime.nix
Normal file
|
|
@ -0,0 +1,154 @@
|
||||||
|
# Copyright (c) 2020-2021 Mihai Fufezan
|
||||||
|
# credits to fufexan https://github.com/fufexan/dotfiles/blob/main/home/terminal/programs/xdg.nix
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
options,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
{
|
||||||
|
options.mods.mime = {
|
||||||
|
enable = lib.mkOption {
|
||||||
|
default = true;
|
||||||
|
example = false;
|
||||||
|
type = lib.types.bool;
|
||||||
|
description = "Enables mime handling with nix";
|
||||||
|
};
|
||||||
|
imageTypes = lib.mkOption {
|
||||||
|
default = [
|
||||||
|
"png"
|
||||||
|
"svg"
|
||||||
|
"jpeg"
|
||||||
|
"gif"
|
||||||
|
];
|
||||||
|
example = [ ];
|
||||||
|
type = with lib.types; listOf str;
|
||||||
|
description = "Image mime handlers";
|
||||||
|
};
|
||||||
|
videoTypes = lib.mkOption {
|
||||||
|
default = [
|
||||||
|
"mp4"
|
||||||
|
"avi"
|
||||||
|
"mkv"
|
||||||
|
];
|
||||||
|
example = [ ];
|
||||||
|
type = with lib.types; listOf str;
|
||||||
|
description = "Video mime handlers";
|
||||||
|
};
|
||||||
|
audioTypes = lib.mkOption {
|
||||||
|
default = [
|
||||||
|
"mp3"
|
||||||
|
"flac"
|
||||||
|
"wav"
|
||||||
|
"aac"
|
||||||
|
];
|
||||||
|
example = [ ];
|
||||||
|
type = with lib.types; listOf str;
|
||||||
|
description = "Audio mime handlers";
|
||||||
|
};
|
||||||
|
browserTypes = lib.mkOption {
|
||||||
|
default = [
|
||||||
|
"json"
|
||||||
|
"x-extension-htm"
|
||||||
|
"x-extension-html"
|
||||||
|
"x-extension-shtml"
|
||||||
|
"x-extension-xht"
|
||||||
|
"x-extension-xhtml"
|
||||||
|
];
|
||||||
|
example = [ ];
|
||||||
|
type = with lib.types; listOf str;
|
||||||
|
description = "Browser mime handlers";
|
||||||
|
};
|
||||||
|
browserXTypes = lib.mkOption {
|
||||||
|
default = [
|
||||||
|
"about"
|
||||||
|
"ftp"
|
||||||
|
"http"
|
||||||
|
"https"
|
||||||
|
"unknown"
|
||||||
|
];
|
||||||
|
example = [ ];
|
||||||
|
type = with lib.types; listOf str;
|
||||||
|
description = "Browser X mime handlers";
|
||||||
|
};
|
||||||
|
browserApplications = lib.mkOption {
|
||||||
|
default = [ "firefox" ];
|
||||||
|
example = [ ];
|
||||||
|
type = with lib.types; listOf str;
|
||||||
|
description = "Applications used for handling browser mime types";
|
||||||
|
};
|
||||||
|
imageApplications = lib.mkOption {
|
||||||
|
default = [ "imv" ];
|
||||||
|
example = [ ];
|
||||||
|
type = with lib.types; listOf str;
|
||||||
|
description = "Applications used for handling image mime types";
|
||||||
|
};
|
||||||
|
videoApplications = lib.mkOption {
|
||||||
|
default = [ "mpv" ];
|
||||||
|
example = [ ];
|
||||||
|
type = with lib.types; listOf str;
|
||||||
|
description = "Applications used for handling video mime types";
|
||||||
|
};
|
||||||
|
audioApplications = lib.mkOption {
|
||||||
|
default = [ "io.bassi.Amberol" ];
|
||||||
|
example = [ ];
|
||||||
|
type = with lib.types; listOf str;
|
||||||
|
description = "Applications used for handling audio mime types";
|
||||||
|
};
|
||||||
|
# TODO additional config
|
||||||
|
};
|
||||||
|
config = lib.optionalAttrs (options ? home) {
|
||||||
|
xdg =
|
||||||
|
let
|
||||||
|
xdgAssociations =
|
||||||
|
type: program: list:
|
||||||
|
builtins.listToAttrs (
|
||||||
|
map (e: {
|
||||||
|
name = "${type}/${e}";
|
||||||
|
value = program;
|
||||||
|
}) list
|
||||||
|
);
|
||||||
|
|
||||||
|
imageAc = xdgAssociations "image" config.mods.mime.imageApplications config.mods.mime.imageTypes;
|
||||||
|
videoAc = xdgAssociations "video" config.mods.mime.videoApplications config.mods.mime.videoTypes;
|
||||||
|
audioAc = xdgAssociations "audio" config.mods.mime.audioApplications config.mods.mime.audioTypes;
|
||||||
|
browserAc =
|
||||||
|
(xdgAssociations "application" config.mods.mime.browserApplications config.mods.mime.browserTypes)
|
||||||
|
// (xdgAssociations "x-scheme-handler" config.mods.mime.browserApplications
|
||||||
|
config.mods.mime.browserXTypes
|
||||||
|
);
|
||||||
|
associations = builtins.mapAttrs (_: v: (map (e: "${e}.desktop") v)) (
|
||||||
|
# TODO make configurable
|
||||||
|
{
|
||||||
|
"application/pdf" = [ "org.pwmt.zathura-pdf-mupdf" ];
|
||||||
|
"text/html" = config.mods.mime.browserApplications;
|
||||||
|
"text/plain" = [ "neovide" ];
|
||||||
|
"x-scheme-handler/chrome" = [ "com.brave.browser" ];
|
||||||
|
"inode/directory" = [ "yazi" ];
|
||||||
|
}
|
||||||
|
// imageAc
|
||||||
|
// audioAc
|
||||||
|
// videoAc
|
||||||
|
// browserAc
|
||||||
|
);
|
||||||
|
in
|
||||||
|
lib.mkIf config.mods.mime.enable {
|
||||||
|
enable = true;
|
||||||
|
cacheHome = config.home.homeDirectory + "/.local/cache";
|
||||||
|
|
||||||
|
mimeApps = {
|
||||||
|
enable = true;
|
||||||
|
defaultApplications = associations;
|
||||||
|
};
|
||||||
|
|
||||||
|
userDirs = {
|
||||||
|
enable = true;
|
||||||
|
createDirectories = true;
|
||||||
|
extraConfig = {
|
||||||
|
XDG_SCREENSHOTS_DIR = "${config.xdg.userDirs.pictures}/Screenshots";
|
||||||
|
pws = "${config.home.homeDirectory}/pws";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -17,14 +17,18 @@
|
||||||
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.
|
||||||
services.printing.enable = true;
|
services = {
|
||||||
services.printing.browsing = true;
|
printing = {
|
||||||
services.printing.drivers = [ pkgs.hplip ];
|
enable = true;
|
||||||
services.printing.startWhenNeeded = true; # optional
|
browsing = true;
|
||||||
services.avahi = {
|
drivers = [ pkgs.hplip ];
|
||||||
enable = true;
|
startWhenNeeded = true; # optional
|
||||||
nssmdns4 = true;
|
};
|
||||||
openFirewall = true;
|
avahi = {
|
||||||
|
enable = true;
|
||||||
|
nssmdns4 = true;
|
||||||
|
openFirewall = true;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -7,13 +7,13 @@
|
||||||
}:
|
}:
|
||||||
{
|
{
|
||||||
options.mods.scripts = {
|
options.mods.scripts = {
|
||||||
change-brightness = lib.mkOption {
|
changeBrightness = lib.mkOption {
|
||||||
default = true;
|
default = true;
|
||||||
example = false;
|
example = false;
|
||||||
type = lib.types.bool;
|
type = lib.types.bool;
|
||||||
description = "Enables the change-brightness script";
|
description = "Enables the change-brightness script";
|
||||||
};
|
};
|
||||||
audio-control = lib.mkOption {
|
audioControl = lib.mkOption {
|
||||||
default = true;
|
default = true;
|
||||||
example = false;
|
example = false;
|
||||||
type = lib.types.bool;
|
type = lib.types.bool;
|
||||||
|
|
@ -28,8 +28,8 @@
|
||||||
config = (
|
config = (
|
||||||
lib.optionalAttrs (options ? home.packages) {
|
lib.optionalAttrs (options ? home.packages) {
|
||||||
home.packages = [
|
home.packages = [
|
||||||
(lib.mkIf config.mods.scripts.change-brightness (
|
(lib.mkIf config.mods.scripts.changeBrightness (
|
||||||
pkgs.writeShellScriptBin "change-brightness" ''
|
pkgs.writeShellScriptBin "changeBrightness" ''
|
||||||
set_brightness() {
|
set_brightness() {
|
||||||
brightnessctl set "$1"
|
brightnessctl set "$1"
|
||||||
CURRENT=$(brightnessctl -m -d intel_backlight | awk -F, '{print substr($4, 0, length($4)-1)}')
|
CURRENT=$(brightnessctl -m -d intel_backlight | awk -F, '{print substr($4, 0, length($4)-1)}')
|
||||||
|
|
@ -41,8 +41,8 @@
|
||||||
fi
|
fi
|
||||||
''
|
''
|
||||||
))
|
))
|
||||||
(lib.mkIf config.mods.scripts.audio-control (
|
(lib.mkIf config.mods.scripts.audioControl (
|
||||||
pkgs.writeShellScriptBin "audio-control" ''
|
pkgs.writeShellScriptBin "audioControl" ''
|
||||||
ncspot() {
|
ncspot() {
|
||||||
NUM=$(pactl list clients short | rg "ncspot" | awk -F 'PipeWire' ' { print $1 } ' | tr -d ' \t\n')
|
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')
|
CHANGE=$(pactl list sink-inputs short | rg "$NUM" | awk -F ' ' ' { print $1 }' | tr -d ' \t\n')
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@
|
||||||
Enables starship prompt
|
Enables starship prompt
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
use_default_prompt = lib.mkOption {
|
useDefaultPrompt = lib.mkOption {
|
||||||
default = true;
|
default = true;
|
||||||
example = false;
|
example = false;
|
||||||
type = lib.types.bool;
|
type = lib.types.bool;
|
||||||
|
|
@ -25,7 +25,7 @@
|
||||||
Enables preconfigured prompt
|
Enables preconfigured prompt
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
custom_prompt = lib.mkOption {
|
customPrompt = lib.mkOption {
|
||||||
default = { };
|
default = { };
|
||||||
example = { };
|
example = { };
|
||||||
type = with lib.types; attrsOf anything;
|
type = with lib.types; attrsOf anything;
|
||||||
|
|
@ -49,9 +49,9 @@
|
||||||
{
|
{
|
||||||
enable = true;
|
enable = true;
|
||||||
interactiveOnly = true;
|
interactiveOnly = true;
|
||||||
presets = lib.mkIf config.mods.starship.use_default_prompt [ "pastel-powerline" ];
|
presets = lib.mkIf config.mods.starship.useDefaultPrompt [ "pastel-powerline" ];
|
||||||
settings =
|
settings =
|
||||||
lib.mkIf config.mods.starship.use_default_prompt {
|
lib.mkIf config.mods.starship.useDefaultPrompt {
|
||||||
# derived from https://starship.rs/presets/pastel-powerline
|
# derived from https://starship.rs/presets/pastel-powerline
|
||||||
format = "$username$directory$git_branch$git_status$git_metrics[ ](bg:none fg:prev_bg)";
|
format = "$username$directory$git_branch$git_status$git_metrics[ ](bg:none fg:prev_bg)";
|
||||||
right_format = "$c$elixir$elm$golang$gradle$haskell$java$julia$nodejs$nim$rust$scala$python$ocaml$opa$perl$zig$dart$dotnet$nix_shell$shell$solidity[](bg:prev_bg fg:#3465A4)$time$os";
|
right_format = "$c$elixir$elm$golang$gradle$haskell$java$julia$nodejs$nim$rust$scala$python$ocaml$opa$perl$zig$dart$dotnet$nix_shell$shell$solidity[](bg:prev_bg fg:#3465A4)$time$os";
|
||||||
|
|
@ -170,7 +170,7 @@
|
||||||
format = "[ $time ]($style)";
|
format = "[ $time ]($style)";
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
// config.mods.starship.custom_prompt;
|
// config.mods.starship.customPrompt;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue