feat(home-manager): service defs and fmt

fmt: reformatted using nixpkgs-fmt prettifier
mpd: created configuration
hypr: add window rules
commons: add usingMusicPlayerDaemon variable
This commit is contained in:
Zhongheng Liu 2025-01-08 14:12:29 +02:00
commit 7d88765f5d
Signed by: steven
GPG key ID: 805A28B071DAD84B
67 changed files with 633 additions and 573 deletions

View file

@ -1,31 +1,33 @@
{
config,
pkgs,
lib,
...
}: let
{ config
, pkgs
, lib
, ...
}:
let
monitorMaxBrightness = "255";
monitorMinBrightness = "32";
in {
in
{
# Type definitions for nix variables used in this configuration
options = with lib;
with types; {
defaultApplications = {
fileManager = mkOption {type = str;};
appLauncher = mkOption {type = str;};
terminal = mkOption {type = str;};
with types; {
usingMusicPlayerDaemon = mkOption { type = bool; };
defaultApplications = {
fileManager = mkOption { type = str; };
appLauncher = mkOption { type = str; };
terminal = mkOption { type = str; };
};
myWallPaperPath = mkOption { type = path; };
myUserName = mkOption { type = str; };
myHostName = mkOption { type = str; };
myWallPaperPathString = mkOption { type = str; };
myDisplayName = mkOption { type = str; };
myEmail = mkOption { type = str; };
displayScale = mkOption { type = int; };
myAutostartCommands = mkOption { type = listOf str; };
myConfigLocation = mkOption { type = str; };
desktopFontFullName = mkOption { type = str; };
};
myWallPaperPath = mkOption {type = path;};
myUserName = mkOption {type = str;};
myHostName = mkOption {type = str;};
myWallPaperPathString = mkOption {type = str;};
myDisplayName = mkOption {type = str;};
myEmail = mkOption {type = str;};
displayScale = mkOption {type = int;};
myAutostartCommands = mkOption {type = listOf str;};
myConfigLocation = mkOption {type = str;};
desktopFontFullName = mkOption {type = str;};
};
# Default values for this configuration
config = rec {
@ -37,7 +39,7 @@ in {
myDisplayName = "Zhongheng Liu";
myEmail = "z.liu@outlook.com.gr";
specialisation."powersave".configuration = {
myAutostartCommands = ["${pkgs.brightnessctl}/bin/brightnessctl s ${monitorMinBrightness}"];
myAutostartCommands = [ "${pkgs.brightnessctl}/bin/brightnessctl s ${monitorMinBrightness}" ];
};
myConfigLocation = "/home/${myUserName}/nix-conf";
desktopFontFullName = "IntoneMono NFM:style=Regular";
@ -54,5 +56,6 @@ in {
fileManager = "${pkgs.nemo}/bin/nemo";
appLauncher = "${pkgs.walker}/bin/walker";
};
usingMusicPlayerDaemon = true;
};
}

View file

@ -1,21 +1,15 @@
{
pkgs,
lib,
config,
inputs,
...
}: {
{ pkgs, lib, config, inputs, ... }: {
# https://devenv.sh/basics/
env.GREET = "devenv";
cachix.enable = false;
# https://devenv.sh/packages/
packages = [pkgs.git];
packages = [ pkgs.git ];
# https://devenv.sh/languages/
# languages.rust.enable = true;
languages.nix.enable = true;
pre-commit.hooks = {
alejandra.enable = true;
nixpkgs-fmt.enable = true;
shellcheck.enable = true;
commitizen.enable = true;
};
@ -38,9 +32,7 @@
# https://devenv.sh/tests/
enterTest =
/*
shell
*/
# shell
''
echo "Running tests"
git --version | grep --color=auto "${pkgs.git.version}"

View file

@ -16,13 +16,13 @@
inputs.nixpkgs.follows = "nixpkgs";
};
/*
lix-module = {
lix-module = {
url =
"https://git.lix.systems/lix-project/nixos-module/archive/2.91.0.tar.gz";
inputs.nixpkgs.follows = "nixpkgs";
};
};
*/
stylix = {url = "github:danth/stylix";};
stylix = { url = "github:danth/stylix"; };
spicetify-nix = {
url = "github:Gerg-L/spicetify-nix";
inputs.nixpkgs.follows = "nixpkgs";
@ -30,44 +30,46 @@
hyprland-qtutils.url = "github:hyprwm/hyprland-qtutils";
};
outputs = {
self,
nixpkgs,
home-manager,
stylix,
spicetify-nix,
...
} @ inputs: let
inherit (self) outputs;
myHostName = "nixos-msi";
stevenUserName = "stvnliu";
in {
# NixOS configuration entrypoint
# Available through 'nixos-rebuild --flake .#your-hostname'
nixosConfigurations = {
"${myHostName}" = nixpkgs.lib.nixosSystem {
specialArgs = {inherit inputs outputs;};
modules = [
./nixos/configuration.nix
#lix-module.nixosModules.default
];
outputs =
{ self
, nixpkgs
, home-manager
, stylix
, spicetify-nix
, ...
} @ inputs:
let
inherit (self) outputs;
myHostName = "nixos-msi";
stevenUserName = "stvnliu";
in
{
# NixOS configuration entrypoint
# Available through 'nixos-rebuild --flake .#your-hostname'
nixosConfigurations = {
"${myHostName}" = nixpkgs.lib.nixosSystem {
specialArgs = { inherit inputs outputs; };
modules = [
./nixos/configuration.nix
#lix-module.nixosModules.default
];
};
};
};
# Standalone home-manager configuration entrypoint
# Available through 'home-manager --flake .#your-username@your-hostname'
homeConfigurations = {
"${stevenUserName}@${myHostName}" = home-manager.lib.homeManagerConfiguration {
pkgs =
nixpkgs.legacyPackages.x86_64-linux; # Home-manager requires 'pkgs' instance
extraSpecialArgs = {inherit inputs outputs;};
modules = [
./home-manager/${stevenUserName}/home.nix
stylix.homeManagerModules.stylix
inputs.nixvim.homeManagerModules.nixvim
spicetify-nix.homeManagerModules.default
];
# Standalone home-manager configuration entrypoint
# Available through 'home-manager --flake .#your-username@your-hostname'
homeConfigurations = {
"${stevenUserName}@${myHostName}" = home-manager.lib.homeManagerConfiguration {
pkgs =
nixpkgs.legacyPackages.x86_64-linux; # Home-manager requires 'pkgs' instance
extraSpecialArgs = { inherit inputs outputs; };
modules = [
./home-manager/${stevenUserName}/home.nix
stylix.homeManagerModules.stylix
inputs.nixvim.homeManagerModules.nixvim
spicetify-nix.homeManagerModules.default
];
};
};
};
};
}

View file

@ -1,7 +1,7 @@
const hyprland = await Service.import("hyprland")
const dispatch = ws => hyprland.messageAsync(`dispatch workspace ${ws}`);
const wsSymbols = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10"]
const wsSymbols = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20"]
const Workspaces = () => Widget.EventBox({
onScrollUp: () => dispatch('+1'),
onScrollDown: () => dispatch('-1'),

View file

@ -0,0 +1,17 @@
const mpris = await Service.import('mpris')
/**
* @param {import('types/service/mpris').MprisPlayer} player
* */
const Player = (player, count) => Widget.Button({
onClicked: () => player.playPause(),
child: Widget.Label().hook(player, label => {
const { track_artists, track_title } = player;
label.label = `${count} PLAYING`;
}),
})
export const players = Widget.Box({
children: mpris.bind('players').as(p => p.map(
(this_player, index, array) => { return Player(this_player, array.length) }))
})

View file

@ -1,7 +1,6 @@
{
pkgs,
config,
...
{ pkgs
, config
, ...
}: {
config = {
home.file = {

View file

@ -1,7 +1,5 @@
{
pkgs,
config,
lib,
...
}: {
}
{ pkgs
, config
, lib
, ...
}: { }

View file

@ -1,8 +1,7 @@
{
lib,
pkgs,
config,
...
{ lib
, pkgs
, config
, ...
}: {
imports = [
#./vscode.nix
@ -10,9 +9,14 @@
];
programs.nixvim = import ./nixvim;
# dependencies for nixvim configuration
home.packages = with pkgs; [ripgrep fd];
programs.vscode = {
home.packages = with pkgs; [ ripgrep fd ];
programs.helix = {
enable = true;
};
/*
programs.vscode = {
enable = true;
package = pkgs.vscode.fhs;
};
};
*/
}

View file

@ -1,7 +1,6 @@
{
pkgs,
config,
...
{ pkgs
, config
, ...
}: {
gtk = {
enable = true;
@ -13,6 +12,6 @@
qt = {
enable = true;
platformTheme.name = "gtk";
style = {name = "Fusion";};
style = { name = "Fusion"; };
};
}

View file

@ -1,9 +1,8 @@
{
inputs,
lib,
config,
pkgs,
...
{ inputs
, lib
, config
, pkgs
, ...
}: {
imports = [
./hypr
@ -28,7 +27,7 @@
overlays = [
(final: prev: {
ags = prev.ags.overrideAttrs (old: {
buildInputs = old.buildInputs ++ [pkgs.libdbusmenu-gtk3];
buildInputs = old.buildInputs ++ [ pkgs.libdbusmenu-gtk3 ];
});
})
];
@ -51,7 +50,7 @@
username = "${config.myUserName}";
homeDirectory = "/home/${config.myUserName}";
# copy wallpaper from assets
file = {"wallpaper.jpg".source = config.myWallPaperPath;};
file = { "wallpaper.jpg".source = config.myWallPaperPath; };
};
home.packages = with pkgs; [
prismlauncher
@ -69,6 +68,7 @@
teams-for-linux
sxiv
heroic
vscodium-fhs
];
myAutostartCommands = [
#"${pkgs.clash-verge-rev}/bin/clash-verge"
@ -77,7 +77,7 @@
programs = {
obs-studio = {
enable = true;
plugins = with pkgs.obs-studio-plugins; [wlrobs input-overlay];
plugins = with pkgs.obs-studio-plugins; [ wlrobs input-overlay ];
};
home-manager.enable = true;
firefox = {
@ -96,7 +96,7 @@
};
thunderbird = {
enable = true;
profiles.default = {isDefault = true;};
profiles.default = { isDefault = true; };
};
};
# Nicely reload system units when changing configs

View file

@ -1,8 +1,7 @@
{
pkgs,
config,
lib,
...
{ pkgs
, config
, lib
, ...
}: {
imports = [
./hyprland

View file

@ -1,6 +1,8 @@
{pkgs, ...}: let
{ pkgs, ... }:
let
timeoutSeconds = 600;
in {
in
{
services.hypridle = {
enable = true;
settings = {

View file

@ -1,60 +1,75 @@
{
config,
pkgs,
...
}: let
{ config
, pkgs
, ...
}:
let
terminalCmd = config.defaultApplications.terminal;
screenshotLocation = "/home/${config.myUserName}/Screenshots/$(date '+%Y-%m-%d-%H-%M-%S').png";
in
[
"$mod SHIFT, L, exec, ${pkgs.wlogout}/bin/wlogout"
[
"$mod SHIFT, L, exec, ${pkgs.wlogout}/bin/wlogout"
"$mod SHIFT, Print, exec, ${pkgs.grimblast}/bin/grimblast copysave output ${screenshotLocation}"
", Print, exec, ${pkgs.grimblast}/bin/grimblast copysave area ${screenshotLocation}"
"$mod, Print, exec, ${pkgs.grimblast}/bin/grimblast copy area"
"$mod SHIFT, Print, exec, ${pkgs.grimblast}/bin/grimblast copysave output ${screenshotLocation}"
", Print, exec, ${pkgs.grimblast}/bin/grimblast copysave area ${screenshotLocation}"
"$mod, Print, exec, ${pkgs.grimblast}/bin/grimblast copy area"
# special workspace keybinds
"$mod, S, togglespecialworkspace"
"$mod SHIFT, S, movetoworkspace, special"
# special workspace keybinds
"$mod, S, togglespecialworkspace"
"$mod SHIFT, S, movetoworkspace, special"
# keysyms for util functions
# Example volume button that allows press and hold, volume limited to 150%
"$mod, Q, killactive"
"$mod, D, exec, ${config.defaultApplications.appLauncher}"
"$mod, F, fullscreen"
"$mod, E, exec, ${config.defaultApplications.fileManager}"
# foot terminal
"$mod, Return, exec, ${terminalCmd} ${config.myShells.defaultShell}"
"$mod SHIFT, Return, exec, [float] ${terminalCmd} ${config.myShells.defaultShell}"
# keysyms for util functions
# Example volume button that allows press and hold, volume limited to 150%
"$mod, Q, killactive"
"$mod, D, exec, ${config.defaultApplications.appLauncher}"
"$mod, F, fullscreen"
"$mod, E, exec, ${config.defaultApplications.fileManager}"
# foot terminal
"$mod, Return, exec, ${terminalCmd} ${config.myShells.defaultShell}"
"$mod SHIFT, Return, exec, [float] ${terminalCmd} ${config.myShells.defaultShell}"
# cmdline utilities
/*
# cmdline utilities
/*
NOTE Replaced by network manager applet
nmtui interface is no longer needed
TODO Fix floating window rule
*/
# "$mod, N, exec, [float] ${terminalCmd} ${pkgs.networkmanager}/bin/nmtui"
"$mod, M, exec, [float] ${terminalCmd} ${pkgs.zenith}/bin/zenith"
# "$mod, N, exec, [float] ${terminalCmd} ${pkgs.networkmanager}/bin/nmtui"
#"$mod, M, exec, [float] ${terminalCmd} ${pkgs.zenith}/bin/zenith"
# vimkeys navigation
"$mod, H, movefocus, l"
"$mod, J, movefocus, d"
"$mod, K, movefocus, u"
"$mod, L, movefocus, r"
]
++ (
if config.services.swaync.enable
then ["$mod, N, exec, ${pkgs.swaynotificationcenter}/bin/swaync-client -t"]
else []
)
++ (
# workspaces
# binds $mod + [shift +] {1..10} to [move to] workspace {1..10}
builtins.concatLists (builtins.genList (x: let
# vimkeys navigation
"$mod, H, movefocus, l"
"$mod, J, movefocus, d"
"$mod, K, movefocus, u"
"$mod, L, movefocus, r"
]
++ (
if config.services.mpd.enable then [ "$mod, M, exec, ${terminalCmd} --title=ncmpc ${pkgs.ncmpc}/bin/ncmpc -h 127.0.0.1" ] else [ ]
)
++ (
if config.services.swaync.enable
then [ "$mod, N, exec, ${pkgs.swaynotificationcenter}/bin/swaync-client -t" ]
else [ ]
)
++ (
# workspaces
# binds $mod + [shift +] {1..10} to [move to] workspace {1..10}
builtins.concatLists (builtins.genList
(x:
let
ws = let c = (x + 1) / 10; in builtins.toString (x + 1 - (c * 10));
in [
in
[
"$mod, ${ws}, workspace, ${toString (x + 1)}"
"$mod SHIFT, ${ws}, movetoworkspace, ${toString (x + 1)}"
])
10)
)
]) 10)
# workspaces
# binds $mod + [shift +] {1..10} to [move to] workspace {1..10}
/*
builtins.concatLists (builtins.genList (x:
let ws = let c = (x + 1) / 10; in builtins.toString (x + 1 - (c * 10));
in [
"$mod M, ${ws}, workspace, ${toString (x + 10 + 1)}"
"$mod SHIFT M, ${ws}, movetoworkspace, ${toString (x + 10 + 1)}"
]) 10)
*/
)

View file

@ -1,28 +1,21 @@
{
inputs,
config,
pkgs,
lib,
...
}: {
home.packages = [
inputs.hyprland-qtutils.packages.x86_64-linux.default
pkgs.foot
];
{ inputs, config, pkgs, lib, ... }: {
home.packages =
[ inputs.hyprland-qtutils.packages.x86_64-linux.default pkgs.foot ];
wayland.windowManager.hyprland = {
# Whether to enable Hyprland wayland compositor
enable = true;
# The hyprland package to use
package = pkgs.hyprland;
plugins = with pkgs.hyprlandPlugins; [
# hyprfocus
# hycov
];
plugins = with pkgs.hyprlandPlugins;
[
# hyprfocus
# hycov
];
# Whether to enable XWayland
xwayland.enable = true;
settings = {
env = ["AQ_DRM_DEVICES, /dev/dri/card1:/dev/dri/card0"];
xwayland = {force_zero_scaling = true;};
env = [ "AQ_DRM_DEVICES, /dev/dri/card1:/dev/dri/card0" ];
xwayland = { force_zero_scaling = true; };
monitor = [
#"eDP-1, 1920x1080@165,0x0,1"
"desc:Xiaomi Corporation Mi 27 NFGL 3215000032603, 1920x1080@75, 2560x0, 1"
@ -37,8 +30,8 @@
gaps_out = 5;
allow_tearing = true;
};
windowrulev2 = ["immediate, class:^(cs2)$"];
decoration = {rounding = 5;};
windowrulev2 = import ./window_rules.nix;
decoration = { rounding = 5; };
input = {
# xset rate 250 50 replacement on wayland...
# FAST MODE LET'S GOOO
@ -46,13 +39,10 @@
repeat_delay = 250;
accel_profile = "flat";
};
exec-once =
config.myAutostartCommands
++ [
# future hyprland-specific exec commands
#"${config.programs.firefox.package}/bin/firefox"
#"${pkgs.thunderbird}/bin/thunderbird"
];
exec-once = config.myAutostartCommands ++ import ./hypr_autostart.nix {
inherit pkgs;
inherit config;
};
misc = {
disable_hyprland_logo = true;
disable_splash_rendering = true;
@ -78,7 +68,7 @@
};
# Optional
# Whether to enable hyprland-session.target on hyprland startup
systemd = {enable = true;};
systemd = { enable = true; };
};
# ...
}

View file

@ -0,0 +1,8 @@
{ pkgs, config }:
let
term = config.defaultApplications.terminal;
shell = config.myShells.defaultShell;
in
[
"${term} --title=autorun ${shell}"
]

View file

@ -0,0 +1,7 @@
[
"workspace special silent, class:^(foot.*)$, title:autorun"
"float, tag:floats"
"float, title:ncmpc"
"size 50% 50%, title:ncmpc"
"immediate, class:^(cs2)$"
]

View file

@ -1,6 +1,6 @@
{
pkgs,
config,
{ pkgs
, config
,
}: [
", XF86AudioPlay, exec, ${pkgs.playerctl}/bin/playerctl play-pause"
", XF86AudioStop, exec, ${pkgs.playerctl}/bin/playerctl stop"

View file

@ -1,8 +1,7 @@
{
pkgs,
config,
lib,
...
{ pkgs
, config
, lib
, ...
}: {
programs.hyprlock = {
enable = true;

View file

@ -1,15 +1,14 @@
{
pkgs,
config,
...
{ pkgs
, config
, ...
}: {
services.hyprpaper = {
enable = true;
settings = {
ipc = "on";
splash = false;
preload = [config.myWallPaperPathString];
wallpaper = [",${config.myWallPaperPathString}"];
preload = [ config.myWallPaperPathString ];
wallpaper = [ ",${config.myWallPaperPathString}" ];
#preload = [/home/stvnliu/Downloads/mao-zedong.jpg];
#wallpaper = [",/home/stvnliu/Downloads/mao-zedong.jpg"];
};

View file

@ -1,10 +1,11 @@
{
pkgs,
lib,
...
}: let
{ pkgs
, lib
, ...
}:
let
defaultTimeoutMillis = 5 * 1000;
in {
in
{
services.mako = {
enable = true;
defaultTimeout = defaultTimeoutMillis;

View file

@ -1 +1 @@
{plugins.nvim-autopairs = {enable = true;};}
{ plugins.nvim-autopairs = { enable = true; }; }

View file

@ -1 +1 @@
{plugins.bufferline = {enable = true;};}
{ plugins.bufferline = { enable = true; }; }

View file

@ -3,28 +3,28 @@
plugins = {
luasnip.enable = true;
/*
copilot-lua = {
copilot-lua = {
enable = true;
suggestion.enabled = false;
panel.enabled = false;
};
};
*/
cmp = {
enable = true;
settings = {
autoEnableSources = true;
experimental = {ghost_text = false;};
experimental = { ghost_text = false; };
performance = {
debounce = 60;
fetchingTimeout = 200;
maxViewEntries = 30;
};
snippet = {expand = "luasnip";};
cmp-buffer = {enable = true;};
cmp-emoji = {enable = true;};
cmp-nvim-lsp = {enable = true;};
cmp-path = {enable = true;};
cmp_luasnip = {enable = true;};
snippet = { expand = "luasnip"; };
cmp-buffer = { enable = true; };
cmp-emoji = { enable = true; };
cmp-nvim-lsp = { enable = true; };
cmp-path = { enable = true; };
cmp_luasnip = { enable = true; };
/*
snippet.expand = ''
@ -34,17 +34,17 @@
'';
*/
sources = [
{name = "nvim_lsp";}
{name = "luasnip";}
{ name = "nvim_lsp"; }
{ name = "luasnip"; }
{
name = "buffer";
option.get_bufnrs.__raw = "vim.api.nvim_list_bufs";
}
{name = "nvim_lua";}
{name = "path";}
{ name = "nvim_lua"; }
{ name = "path"; }
];
formatting = {
fields = ["abbr" "kind" "menu"];
fields = [ "abbr" "kind" "menu" ];
format =
# lua
''
@ -104,11 +104,11 @@
winhighlight = "FloatBorder:CmpBorder,Normal:CmpPmenu,CursorLine:CmpSel,Search:PmenuSel";
scrollbar = false;
sidePadding = 0;
border = ["" "" "" "" "" "" "" ""];
border = [ "" "" "" "" "" "" "" "" ];
};
settings.documentation = {
border = ["" "" "" "" "" "" "" ""];
border = [ "" "" "" "" "" "" "" "" ];
winhighlight = "FloatBorder:CmpBorder,Normal:CmpPmenu,CursorLine:CmpSel,Search:PmenuSel";
};
};

View file

@ -1,4 +1,4 @@
{config, ...}: {
{ config, ... }: {
imports = [
./auto-pairs.nix
./autosave.nix
@ -26,7 +26,7 @@
enableMan = true;
defaultEditor = true;
globals.mapleader = " ";
colorschemes.gruvbox = {enable = true;};
colorschemes.gruvbox = { enable = true; };
keymaps =
[
# Global

View file

@ -1,4 +1,4 @@
{pkgs, ...}: {
{ pkgs, ... }: {
extraPlugins = with pkgs.vimPlugins; [
Ionide-vim
];

View file

@ -1,4 +1,4 @@
{...}: {
{ ... }: {
plugins = {
lsp-signature.enable = true;
lsp-status.enable = true;

View file

@ -10,6 +10,6 @@
};
};
};
extensions.fzf-native = {enable = true;};
extensions.fzf-native = { enable = true; };
};
}

View file

@ -1 +1 @@
{plugins.transparent.enable = true;}
{ plugins.transparent.enable = true; }

View file

@ -1,4 +1,4 @@
{pkgs, ...}: {
{ pkgs, ... }: {
plugins = {
treesitter = {
enable = true;

View file

@ -1,7 +1,7 @@
{
plugins.virt-column = {
enable = true;
settings.char = [""];
settings.char = [ "" ];
settings.virtcolumn = "80";
};
}

View file

@ -1 +1 @@
{plugins.which-key = {enable = true;};}
{ plugins.which-key = { enable = true; }; }

View file

@ -1,6 +1,6 @@
{
plugins.wilder = {
enable = true;
modes = [":" "/" "?"];
modes = [ ":" "/" "?" ];
};
}

View file

@ -1,8 +1,7 @@
{
pkgs,
config,
lib,
...
{ pkgs
, config
, lib
, ...
}: {
imports = [
./util-programs.nix
@ -11,5 +10,6 @@
./wayland-utils.nix
./pentesting.nix
./dev.nix
./gaming.nix
];
}

View file

@ -1,7 +1,6 @@
{
pkgs,
config,
...
{ pkgs
, config
, ...
}: {
home.packages = with pkgs; [
wget

View file

@ -1,14 +1,13 @@
{
pkgs,
config,
lib,
...
{ pkgs
, config
, lib
, ...
}: {
home.packages = with pkgs; [vesktop];
home.packages = with pkgs; [ vesktop ];
xdg.desktopEntries.discord = {
exec = "${pkgs.vesktop}/bin/vesktop";
terminal = false;
mimeType = ["x-scheme-handler/discord"];
mimeType = [ "x-scheme-handler/discord" ];
name = "Discord - Vesktop";
genericName = "Discord but substituted with Vesktop";
type = "Application";

View file

@ -0,0 +1,4 @@
{ pkgs, config, ... }:
{
home.packages = with pkgs; [ bottles ];
}

View file

@ -1,8 +1,7 @@
{
pkgs,
config,
lib,
...
{ pkgs
, config
, lib
, ...
}: {
home.packages = with pkgs; [
libreoffice

View file

@ -1,7 +1,6 @@
{
pkgs,
config,
...
{ pkgs
, config
, ...
}: {
home.packages = with pkgs; [
openvpn

View file

@ -1,8 +1,7 @@
{
pkgs,
config,
lib,
...
{ pkgs
, config
, lib
, ...
}: {
home.packages = with pkgs; [
bottom

View file

@ -0,0 +1,4 @@
{ pkgs, config, ... }: {
home.packages = with pkgs; [ vscodium-fhs ];
xdg.desktopEntries.codium = { };
}

View file

@ -1,8 +1,7 @@
{
pkgs,
config,
lib,
...
{ pkgs
, config
, lib
, ...
}: {
home.packages = with pkgs; [wl-clipboard];
home.packages = with pkgs; [ wl-clipboard ];
}

View file

@ -1,8 +1,7 @@
{
pkgs,
config,
lib,
...
{ pkgs
, config
, lib
, ...
}: {
imports = [
./git.nix

View file

@ -1,8 +1,7 @@
{
pkgs,
config,
lib,
...
{ pkgs
, config
, lib
, ...
}: {
programs.foot = {
enable = true;
@ -11,7 +10,7 @@
term = "xterm-256color";
dpi-aware = lib.mkForce "yes";
};
mouse = {hide-when-typing = "yes";};
mouse = { hide-when-typing = "yes"; };
};
server.enable = true;
};

View file

@ -1,8 +1,7 @@
{
pkgs,
config,
lib,
...
{ pkgs
, config
, lib
, ...
}: {
programs.git = {
enable = true;

View file

@ -1,8 +1,7 @@
{
pkgs,
config,
lib,
...
{ pkgs
, config
, lib
, ...
}: {
programs.rofi = {
enable = true;

View file

@ -1,8 +1,7 @@
{
pkgs,
config,
lib,
...
{ pkgs
, config
, lib
, ...
}: {
programs.tmux = {
enable = true;

View file

@ -1,7 +1,6 @@
{
pkgs,
config,
...
{ pkgs
, config
, ...
}: {
programs.walker = {
enable = true;
@ -10,7 +9,7 @@
# All options from the config.json can be used here.
config = {
search.placeholder = "Example";
list = {height = 200;};
list = { height = 200; };
websearch.prefix = "?";
switcher.prefix = "/";
};

View file

@ -1,10 +1,9 @@
{
config,
pkgs,
...
{ config
, pkgs
, ...
}: {
home.packages = [
(import ./heic-to-jpg.script.nix {inherit pkgs;})
(import ./heic-to-jpg.script.nix { inherit pkgs; })
(import ./tmux-default.script.nix {
inherit pkgs;
inherit config;

View file

@ -1,54 +1,55 @@
{
pkgs,
config,
}: let
{ pkgs
, config
,
}:
let
git = config.programs.git.package;
# checks for any Git repositories with uncommitted changes
# used because I am too lazy
in
pkgs.writeShellScriptBin "git-check" ''
#!${pkgs.bash}/bin/bash
cd_err() {
echo "change-directory occurred error. interrupting..."
}
git_check() {
prev=$1
repo_dir=$2
#echo "Checking git-cleanliness at $repo_dir, working in $PWD"
cd "$repo_dir" || return
inside_git_repo="$(${git}/bin/git rev-parse --is-inside-work-tree 2>/dev/null)"
result=256
default_skip=false
if [ "$inside_git_repo" ]; then
if [ "$(${git}/bin/git status --porcelain)" ]; then
result=0
else
result=1
fi
#echo "not a git repository"
fi
if [[ $result -eq 0 ]]; then
echo "DIRTY $PWD"
if $default_skip; then return; fi
read -rp "Enter dirty directory? [y/n/N(skip others)] " userinput
if [[ "$userinput" = "y" ]]; then
$SHELL
fi
if [[ "$userinput" = "N" ]]; then
default_skip=true
fi
fi
#echo "going back to $prev"
cd "$prev" || return
}
path=$PWD
scan_path=$PWD
if [ -z "$1" ]; then
scan_path=$PWD
pkgs.writeShellScriptBin "git-check" ''
#!${pkgs.bash}/bin/bash
cd_err() {
echo "change-directory occurred error. interrupting..."
}
git_check() {
prev=$1
repo_dir=$2
#echo "Checking git-cleanliness at $repo_dir, working in $PWD"
cd "$repo_dir" || return
inside_git_repo="$(${git}/bin/git rev-parse --is-inside-work-tree 2>/dev/null)"
result=256
default_skip=false
if [ "$inside_git_repo" ]; then
if [ "$(${git}/bin/git status --porcelain)" ]; then
result=0
else
scan_path=$1
result=1
fi
#echo "not a git repository"
fi
for item in $(find $scan_path -maxdepth 1 -type d); do
git_check "$path" "$item"
done
''
if [[ $result -eq 0 ]]; then
echo "DIRTY $PWD"
if $default_skip; then return; fi
read -rp "Enter dirty directory? [y/n/N(skip others)] " userinput
if [[ "$userinput" = "y" ]]; then
$SHELL
fi
if [[ "$userinput" = "N" ]]; then
default_skip=true
fi
fi
#echo "going back to $prev"
cd "$prev" || return
}
path=$PWD
scan_path=$PWD
if [ -z "$1" ]; then
scan_path=$PWD
else
scan_path=$1
fi
for item in $(find $scan_path -maxdepth 1 -type d); do
git_check "$path" "$item"
done
''

View file

@ -1,4 +1,4 @@
{pkgs}:
{ pkgs }:
pkgs.writeShellScriptBin "heic-to-jpg" ''
mkdir -p ./heic-to-jpg-out
${pkgs.findutils}/bin/find . -type f -print0 | ${pkgs.findutils}/bin/xargs -0 -I "{}" ${pkgs.imagemagick}/bin/magick "{}" -quality 100% ./jpg-out/"{}.conv.jpg"

View file

@ -1,18 +1,19 @@
{
pkgs,
config,
}: let
{ pkgs
, config
,
}:
let
tmux = config.programs.tmux.package;
windowName = "code-mode";
in
pkgs.writeShellScriptBin "tmux-code" ''
#!${pkgs.bash}/bin/bash
${tmux}/bin/tmux has-session -t ${windowName} 2>/dev/null
if [ $? != 0 ]; then
# setting up session
${tmux}/bin/tmux new -s ${windowName} -d
${tmux}/bin/tmux send-keys -t ${windowName} 'nvim' Enter
${tmux}/bin/tmux split-window -h
fi
${tmux}/bin/tmux attach -t ${windowName}
''
pkgs.writeShellScriptBin "tmux-code" ''
#!${pkgs.bash}/bin/bash
${tmux}/bin/tmux has-session -t ${windowName} 2>/dev/null
if [ $? != 0 ]; then
# setting up session
${tmux}/bin/tmux new -s ${windowName} -d
${tmux}/bin/tmux send-keys -t ${windowName} 'nvim' Enter
${tmux}/bin/tmux split-window -h
fi
${tmux}/bin/tmux attach -t ${windowName}
''

View file

@ -1,9 +1,9 @@
{
pkgs,
config,
...
{ pkgs
, config
, ...
}: {
imports = [
./swaync.nix
./mpd.nix
];
}

View file

@ -0,0 +1,29 @@
{ pkgs, config, lib, ... }:
lib.mkIf config.usingMusicPlayerDaemon {
home.packages = [ pkgs.ncmpc ];
services.mpd = {
enable = true;
network.listenAddress = "any";
network.port = 6600;
extraConfig = ''
audio_output {
type "pipewire"
name "my pipewire output"
}
audio_output {
type "httpd"
name "My HTTP Stream"
encoder "vorbis" # optional, vorbis or lame
port "8000"
# bind_to_address "0.0.0.0" # optional, IPv4 or IPv6
quality "5.0" # do not define if bitrate is defined
# bitrate "128" # do not define if quality is defined
format "44100:16:1"
max_clients "5" # optional 0=no limit
}
'';
};
services.mpd-mpris = {
enable = true;
};
}

View file

@ -1,7 +1,6 @@
{
pkgs,
config,
...
{ pkgs
, config
, ...
}: {
services.swaync = {
enable = true;

View file

@ -1,4 +1,4 @@
{pkgs}: {
{ pkgs }: {
gil = "${pkgs.lazygit}/bin/lazygit";
cd = "z";
cdi = "zi";

View file

@ -1,32 +1,32 @@
{
pkgs,
lib,
config,
...
}: let
{ pkgs
, lib
, config
, ...
}:
let
cfg = config.myShells;
in
with lib; {
imports = [
./zsh.nix
./fish
./nushell
./zoxide.nix
./direnv.nix
./starship
];
with lib; {
imports = [
./zsh.nix
./fish
./nushell
./zoxide.nix
./direnv.nix
./starship
];
options.myShells = {
defaultShell = with types; mkOption {type = str;};
enable = mkEnableOption "Enables the shell customisation module.";
options.myShells = {
defaultShell = with types; mkOption { type = str; };
enable = mkEnableOption "Enables the shell customisation module.";
};
config = {
myShells = {
zsh.enable = false;
fish.enable = true;
#nushell.enable = true;
defaultShell = "${config.programs.fish.package}/bin/fish";
prompts.starship.enable = true;
};
config = {
myShells = {
zsh.enable = false;
fish.enable = true;
#nushell.enable = true;
defaultShell = "${config.programs.fish.package}/bin/fish";
prompts.starship.enable = true;
};
};
}
};
}

View file

@ -1,4 +1,4 @@
{config, ...}: {
{ config, ... }: {
programs = {
direnv = {
enable = true;

View file

@ -1,7 +1,6 @@
{
pkgs,
config,
...
{ pkgs
, config
, ...
}: {
EDITOR = "nvim";
}

View file

@ -1,65 +1,65 @@
{
pkgs,
config,
lib,
...
}: let
{ pkgs
, config
, lib
, ...
}:
let
cfg = config.myShells.fish;
in
with lib; {
options = {
myShells.fish = {enable = mkEnableOption "Enables fish and components.";};
};
config = mkIf cfg.enable {
programs.fish = {
enable = true;
shellInit = ''
${builtins.readFile ./init/zoxide.fish}
${builtins.readFile ./init/nh.fish}
${builtins.readFile ./init/tailscale.fish}
${builtins.readFile ./init/pass.fish}
function fish_greeting
${(pkgs.fortune.override {withOffensive = true;})}/bin/fortune -as
end
funcsave -q fish_greeting
with lib; {
options = {
myShells.fish = { enable = mkEnableOption "Enables fish and components."; };
};
config = mkIf cfg.enable {
programs.fish = {
enable = true;
shellInit = ''
${builtins.readFile ./init/zoxide.fish}
${builtins.readFile ./init/nh.fish}
${builtins.readFile ./init/tailscale.fish}
${builtins.readFile ./init/pass.fish}
function fish_greeting
${(pkgs.fortune.override {withOffensive = true;})}/bin/fortune -as
end
funcsave -q fish_greeting
${pkgs.thefuck}/bin/thefuck --alias | source
'';
shellAliases = import ../aliases {inherit pkgs;};
plugins = with pkgs.fishPlugins; [
{
name = "z";
src = z.src;
}
{
name = "plugin-git";
src = plugin-git.src;
}
{
name = "transient-fish";
src = transient-fish.src;
}
{
name = "done";
src = done.src;
}
{
name = "gruvbox";
src = gruvbox.src;
}
{
name = "colored-man-pages";
src = colored-man-pages.src;
}
{
name = "puffer";
src = puffer.src;
}
{
name = "pisces";
src = pisces.src;
}
];
};
${pkgs.thefuck}/bin/thefuck --alias | source
'';
shellAliases = import ../aliases { inherit pkgs; };
plugins = with pkgs.fishPlugins; [
{
name = "z";
src = z.src;
}
{
name = "plugin-git";
src = plugin-git.src;
}
{
name = "transient-fish";
src = transient-fish.src;
}
{
name = "done";
src = done.src;
}
{
name = "gruvbox";
src = gruvbox.src;
}
{
name = "colored-man-pages";
src = colored-man-pages.src;
}
{
name = "puffer";
src = puffer.src;
}
{
name = "pisces";
src = pisces.src;
}
];
};
}
};
}

View file

@ -1,26 +1,26 @@
{
pkgs,
config,
lib,
...
}: let
{ pkgs
, config
, lib
, ...
}:
let
cfg = config.myShells.nushell;
in
with lib; {
options = {
myShells.nushell = {enable = mkEnableOption "Enables nushell config";};
};
config = mkIf cfg.enable {
programs = {
nushell = {
enable = true;
configFile.source = ./init/config.nu;
shellAliases = import ../aliases/default.nix {inherit pkgs;};
};
carapace = {
enable = true;
enableNushellIntegration = true;
};
with lib; {
options = {
myShells.nushell = { enable = mkEnableOption "Enables nushell config"; };
};
config = mkIf cfg.enable {
programs = {
nushell = {
enable = true;
configFile.source = ./init/config.nu;
shellAliases = import ../aliases/default.nix { inherit pkgs; };
};
carapace = {
enable = true;
enableNushellIntegration = true;
};
};
}
};
}

View file

@ -1,27 +1,27 @@
{
lib,
pkgs,
config,
...
}: let
{ lib
, pkgs
, config
, ...
}:
let
cfg = config.myShells.prompts.starship;
in
with lib; {
options = {
myShells.prompts.starship.enable = mkEnableOption "Enables starship prompts.";
myShells.prompts.starship.confPath = mkOption {
type = types.path;
default = ./presets/default.toml;
};
with lib; {
options = {
myShells.prompts.starship.enable = mkEnableOption "Enables starship prompts.";
myShells.prompts.starship.confPath = mkOption {
type = types.path;
default = ./presets/default.toml;
};
config = mkIf cfg.enable {
myShells.prompts.starship.confPath = ./presets/pure-direnv.toml;
programs.starship = {
enable = true;
enableZshIntegration = config.myShells.zsh.enable;
enableFishIntegration = config.myShells.fish.enable;
enableNushellIntegration = config.myShells.nushell.enable;
settings = builtins.fromTOML (builtins.readFile cfg.confPath);
};
};
config = mkIf cfg.enable {
myShells.prompts.starship.confPath = ./presets/pure-direnv.toml;
programs.starship = {
enable = true;
enableZshIntegration = config.myShells.zsh.enable;
enableFishIntegration = config.myShells.fish.enable;
enableNushellIntegration = config.myShells.nushell.enable;
settings = builtins.fromTOML (builtins.readFile cfg.confPath);
};
}
};
}

View file

@ -1,8 +1,7 @@
{
pkgs,
config,
lib,
...
{ pkgs
, config
, lib
, ...
}: {
programs.zoxide = {
enable = true;

View file

@ -1,36 +1,36 @@
{
pkgs,
lib,
config,
...
}: let
{ pkgs
, lib
, config
, ...
}:
let
cfg = config.shell.zsh;
in
with lib; {
options.myShells.zsh = {
enable = mkEnableOption "Enables zsh and components.";
};
config = {
programs.zsh = {
enable = true;
syntaxHighlighting.enable = true;
shellAliases = import ./aliases {inherit pkgs;};
dirHashes = {
docs = "$HOME/Documents";
dl = "$HOME/Downloads";
dev = "$HOME/devel";
screen = "$HOME/Pictures/Screenshots";
};
oh-my-zsh = {
enable = true;
plugins = [
"git"
"rsync"
"zoxide"
];
theme = "agnoster";
};
with lib; {
options.myShells.zsh = {
enable = mkEnableOption "Enables zsh and components.";
};
config = {
programs.zsh = {
enable = true;
syntaxHighlighting.enable = true;
shellAliases = import ./aliases { inherit pkgs; };
dirHashes = {
docs = "$HOME/Documents";
dl = "$HOME/Downloads";
dev = "$HOME/devel";
screen = "$HOME/Pictures/Screenshots";
};
oh-my-zsh = {
enable = true;
plugins = [
"git"
"rsync"
"zoxide"
];
theme = "agnoster";
};
home.packages = with pkgs; [zoxide];
};
}
home.packages = with pkgs; [ zoxide ];
};
}

View file

@ -1,11 +1,12 @@
{
pkgs,
lib,
inputs,
...
}: let
{ pkgs
, lib
, inputs
, ...
}:
let
spicePkgs = inputs.spicetify-nix.legacyPackages.${pkgs.system};
in {
in
{
# allow spotify to be installed if you don't have unfree enabled already
nixpkgs.config.allowUnfreePredicate = pkg:
builtins.elem (lib.getName pkg) [

View file

@ -1,10 +1,11 @@
{
pkgs,
config,
...
}: let
{ pkgs
, config
, ...
}:
let
globalOpacity = 0.75;
in {
in
{
stylix = {
enable = true;
autoEnable = true;

View file

@ -1,4 +1,4 @@
{pkgs, ...}: {
{ pkgs, ... }: {
nixpkgs.config.permittedInsecurePackages = [
"openssl-1.1.1w"
];

View file

@ -1,6 +1,7 @@
{pkgs, ...}: {
{ pkgs, ... }: {
xdg = {
enable = true;
userDirs.enable = true;
mimeApps = {
enable = true;
defaultApplications = {