format with nix-fmt, use nix tree
This commit is contained in:
parent
b26856d2ed
commit
0d34a0f6a8
11 changed files with 307 additions and 188 deletions
24
flake.nix
24
flake.nix
|
|
@ -13,12 +13,23 @@
|
||||||
claude-code.url = "github:ryoppippi/claude-code-overlay";
|
claude-code.url = "github:ryoppippi/claude-code-overlay";
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = { nixpkgs, home-manager, nixos-hardware, neovim-nightly, zen-browser, claude-code, ... }:
|
outputs =
|
||||||
|
{
|
||||||
|
nixpkgs,
|
||||||
|
home-manager,
|
||||||
|
nixos-hardware,
|
||||||
|
neovim-nightly,
|
||||||
|
zen-browser,
|
||||||
|
claude-code,
|
||||||
|
...
|
||||||
|
}:
|
||||||
let
|
let
|
||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
pkgs = import nixpkgs {
|
pkgs = import nixpkgs {
|
||||||
inherit system;
|
inherit system;
|
||||||
config.allowUnfreePredicate = pkg: builtins.elem (nixpkgs.lib.getName pkg) [
|
config.allowUnfreePredicate =
|
||||||
|
pkg:
|
||||||
|
builtins.elem (nixpkgs.lib.getName pkg) [
|
||||||
"slack"
|
"slack"
|
||||||
"claude-code"
|
"claude-code"
|
||||||
"claude"
|
"claude"
|
||||||
|
|
@ -31,8 +42,9 @@
|
||||||
claude-code.overlays.default
|
claude-code.overlays.default
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
in {
|
in
|
||||||
formatter.${system} = pkgs.nixfmt;
|
{
|
||||||
|
formatter.${system} = pkgs.nixfmt-tree;
|
||||||
|
|
||||||
nixosConfigurations.xps15 = nixpkgs.lib.nixosSystem {
|
nixosConfigurations.xps15 = nixpkgs.lib.nixosSystem {
|
||||||
inherit system;
|
inherit system;
|
||||||
|
|
@ -44,7 +56,9 @@
|
||||||
neovim-nightly.overlays.default
|
neovim-nightly.overlays.default
|
||||||
claude-code.overlays.default
|
claude-code.overlays.default
|
||||||
];
|
];
|
||||||
nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (nixpkgs.lib.getName pkg) [
|
nixpkgs.config.allowUnfreePredicate =
|
||||||
|
pkg:
|
||||||
|
builtins.elem (nixpkgs.lib.getName pkg) [
|
||||||
"slack"
|
"slack"
|
||||||
"claude-code"
|
"claude-code"
|
||||||
"claude"
|
"claude"
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,14 @@
|
||||||
{ lib, config, pkgs, ... }:
|
{
|
||||||
|
lib,
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
isNixOS = builtins.pathExists /etc/NIXOS;
|
isNixOS = builtins.pathExists /etc/NIXOS;
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
imports = [
|
imports = [
|
||||||
./modules/bootstrap.nix
|
./modules/bootstrap.nix
|
||||||
./modules/theme.nix
|
./modules/theme.nix
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,23 @@
|
||||||
{ lib, config, pkgs, ... }:
|
{
|
||||||
|
lib,
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
homeDir = config.home.homeDirectory;
|
homeDir = config.home.homeDirectory;
|
||||||
repoDir = "${homeDir}/nix-config";
|
repoDir = "${homeDir}/nix-config";
|
||||||
|
|
||||||
directories = [ "dev" "dl" "img" "img/screen" "wp" ];
|
directories = [
|
||||||
in {
|
"dev"
|
||||||
|
"dl"
|
||||||
|
"img"
|
||||||
|
"img/screen"
|
||||||
|
"wp"
|
||||||
|
];
|
||||||
|
in
|
||||||
|
{
|
||||||
home.activation.createDirectories = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
|
home.activation.createDirectories = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
|
||||||
for dir in ${lib.concatStringsSep " " directories}; do
|
for dir in ${lib.concatStringsSep " " directories}; do
|
||||||
$DRY_RUN_CMD mkdir -p "$HOME/$dir"
|
$DRY_RUN_CMD mkdir -p "$HOME/$dir"
|
||||||
|
|
|
||||||
|
|
@ -13,5 +13,6 @@
|
||||||
vimAlias = true;
|
vimAlias = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
xdg.configFile."nvim".source = config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/nix-config/config/nvim";
|
xdg.configFile."nvim".source =
|
||||||
|
config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/nix-config/config/nvim";
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,9 @@
|
||||||
{ lib, config, pkgs, ... }:
|
{
|
||||||
|
lib,
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
{
|
{
|
||||||
programs.git = {
|
programs.git = {
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,11 @@
|
||||||
{ pkgs, lib, config, zen-browser, hostPlatform, ... }:
|
{
|
||||||
|
pkgs,
|
||||||
|
lib,
|
||||||
|
config,
|
||||||
|
zen-browser,
|
||||||
|
hostPlatform,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
enableClaude = true;
|
enableClaude = true;
|
||||||
|
|
@ -6,14 +13,17 @@ let
|
||||||
enableSioyek = true;
|
enableSioyek = true;
|
||||||
enableVesktop = true;
|
enableVesktop = true;
|
||||||
enableNeovim = config.programs.neovim.enable;
|
enableNeovim = config.programs.neovim.enable;
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
home.sessionVariables = lib.optionalAttrs enableZen {
|
home.sessionVariables = lib.optionalAttrs enableZen {
|
||||||
BROWSER = "zen-browser";
|
BROWSER = "zen-browser";
|
||||||
};
|
};
|
||||||
|
|
||||||
programs.mpv.enable = true;
|
programs.mpv.enable = true;
|
||||||
|
|
||||||
home.packages = with pkgs; [
|
home.packages =
|
||||||
|
with pkgs;
|
||||||
|
[
|
||||||
signal-desktop
|
signal-desktop
|
||||||
slack
|
slack
|
||||||
bitwarden-desktop
|
bitwarden-desktop
|
||||||
|
|
@ -86,7 +96,8 @@ in {
|
||||||
|
|
||||||
xdg.mimeApps = {
|
xdg.mimeApps = {
|
||||||
enable = true;
|
enable = true;
|
||||||
defaultApplications = {}
|
defaultApplications =
|
||||||
|
{ }
|
||||||
// lib.optionalAttrs enableZen {
|
// lib.optionalAttrs enableZen {
|
||||||
"x-scheme-handler/http" = "zen.desktop";
|
"x-scheme-handler/http" = "zen.desktop";
|
||||||
"x-scheme-handler/https" = "zen.desktop";
|
"x-scheme-handler/https" = "zen.desktop";
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,9 @@
|
||||||
{ pkgs, lib, config, ... }:
|
{
|
||||||
|
pkgs,
|
||||||
|
lib,
|
||||||
|
config,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
c = config.colors;
|
c = config.colors;
|
||||||
|
|
@ -15,7 +20,8 @@ let
|
||||||
aws = true;
|
aws = true;
|
||||||
psql = true;
|
psql = true;
|
||||||
sqlite = true;
|
sqlite = true;
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
pure-prompt
|
pure-prompt
|
||||||
xclip
|
xclip
|
||||||
|
|
@ -225,7 +231,8 @@ in {
|
||||||
zle -N fzf-config-widget
|
zle -N fzf-config-widget
|
||||||
bindkey '^E' fzf-config-widget
|
bindkey '^E' fzf-config-widget
|
||||||
|
|
||||||
'' + lib.optionalString ocaml ''
|
''
|
||||||
|
+ lib.optionalString ocaml ''
|
||||||
[[ ! -r "$OPAMROOT/opam-init/init.zsh" ]] || source "$OPAMROOT/opam-init/init.zsh" > /dev/null 2> /dev/null
|
[[ ! -r "$OPAMROOT/opam-init/init.zsh" ]] || source "$OPAMROOT/opam-init/init.zsh" > /dev/null 2> /dev/null
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
@ -452,27 +459,32 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
commands = {
|
commands = {
|
||||||
open = ''$${{
|
open = ''
|
||||||
|
$${{
|
||||||
setsid -f xdg-open "$f" 2>/dev/null 2>&1 &
|
setsid -f xdg-open "$f" 2>/dev/null 2>&1 &
|
||||||
}}'';
|
}}'';
|
||||||
sopen = ''$${{
|
sopen = ''
|
||||||
|
$${{
|
||||||
for f in $fx; do
|
for f in $fx; do
|
||||||
setsid -f xdg-open "$f" >/dev/null 2>&1 &
|
setsid -f xdg-open "$f" >/dev/null 2>&1 &
|
||||||
done
|
done
|
||||||
}}'';
|
}}'';
|
||||||
rmd = ''$${{
|
rmd = ''
|
||||||
|
$${{
|
||||||
set -f
|
set -f
|
||||||
while IFS= read -r dir; do
|
while IFS= read -r dir; do
|
||||||
rmdir -v -- "$dir"
|
rmdir -v -- "$dir"
|
||||||
done <<< "$fx"
|
done <<< "$fx"
|
||||||
}}'';
|
}}'';
|
||||||
rmf = ''$${{
|
rmf = ''
|
||||||
|
$${{
|
||||||
set -f
|
set -f
|
||||||
while IFS= read -r file; do
|
while IFS= read -r file; do
|
||||||
rm -v -- "$file"
|
rm -v -- "$file"
|
||||||
done <<< "$fx"
|
done <<< "$fx"
|
||||||
}}'';
|
}}'';
|
||||||
resize = ''%{{
|
resize = ''
|
||||||
|
%{{
|
||||||
w=$(tmux display-message -p '#{pane_width}' || tput cols)
|
w=$(tmux display-message -p '#{pane_width}' || tput cols)
|
||||||
if [ $w -le 62 ]; then
|
if [ $w -le 62 ]; then
|
||||||
lf -remote "send $id set ratios 1:4"
|
lf -remote "send $id set ratios 1:4"
|
||||||
|
|
@ -485,7 +497,8 @@ in {
|
||||||
lf -remote "send $id set ratios 2:4:5"
|
lf -remote "send $id set ratios 2:4:5"
|
||||||
fi
|
fi
|
||||||
}}'';
|
}}'';
|
||||||
on-init = ''%{{
|
on-init = ''
|
||||||
|
%{{
|
||||||
lf -remote "send $id resize"
|
lf -remote "send $id resize"
|
||||||
}}'';
|
}}'';
|
||||||
};
|
};
|
||||||
|
|
@ -517,6 +530,8 @@ in {
|
||||||
source = config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/nix-config/config/lf/cleaner";
|
source = config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/nix-config/config/lf/cleaner";
|
||||||
};
|
};
|
||||||
|
|
||||||
xdg.configFile."lf/lf.lua".source = config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/nix-config/config/lf/lf.lua";
|
xdg.configFile."lf/lf.lua".source =
|
||||||
xdg.configFile."lf/sort.py".source = config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/nix-config/config/lf/sort.py";
|
config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/nix-config/config/lf/lf.lua";
|
||||||
|
xdg.configFile."lf/sort.py".source =
|
||||||
|
config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/nix-config/config/lf/sort.py";
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,8 @@
|
||||||
|
|
||||||
let
|
let
|
||||||
c = config.colors;
|
c = config.colors;
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
home.sessionVariables = {
|
home.sessionVariables = {
|
||||||
TERMINAL = "ghostty";
|
TERMINAL = "ghostty";
|
||||||
TERM = "xterm-ghostty";
|
TERM = "xterm-ghostty";
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,9 @@
|
||||||
{ lib, config, pkgs, ... }:
|
{
|
||||||
|
lib,
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
palettes = {
|
palettes = {
|
||||||
|
|
@ -35,9 +40,13 @@ let
|
||||||
activityFg = "#3b5bdb";
|
activityFg = "#3b5bdb";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
options.theme = lib.mkOption {
|
options.theme = lib.mkOption {
|
||||||
type = lib.types.enum [ "midnight" "daylight" ];
|
type = lib.types.enum [
|
||||||
|
"midnight"
|
||||||
|
"daylight"
|
||||||
|
];
|
||||||
default = "midnight";
|
default = "midnight";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,9 @@
|
||||||
{ pkgs, lib, config, ... }:
|
{
|
||||||
|
pkgs,
|
||||||
|
lib,
|
||||||
|
config,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
isNixOS = builtins.pathExists /etc/NIXOS;
|
isNixOS = builtins.pathExists /etc/NIXOS;
|
||||||
|
|
@ -6,7 +11,8 @@ let
|
||||||
|
|
||||||
nvidia = true;
|
nvidia = true;
|
||||||
backlightDevice = "intel_backlight";
|
backlightDevice = "intel_backlight";
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
wl-clipboard
|
wl-clipboard
|
||||||
cliphist
|
cliphist
|
||||||
|
|
@ -42,7 +48,8 @@ in {
|
||||||
env = QT_QPA_PLATFORM,wayland
|
env = QT_QPA_PLATFORM,wayland
|
||||||
env = GDK_BACKEND,wayland,x11
|
env = GDK_BACKEND,wayland,x11
|
||||||
env = SDL_VIDEODRIVER,wayland
|
env = SDL_VIDEODRIVER,wayland
|
||||||
'' + lib.optionalString nvidia ''
|
''
|
||||||
|
+ lib.optionalString nvidia ''
|
||||||
env = LIBVA_DRIVER_NAME,nvidia
|
env = LIBVA_DRIVER_NAME,nvidia
|
||||||
env = __GLX_VENDOR_LIBRARY_NAME,nvidia
|
env = __GLX_VENDOR_LIBRARY_NAME,nvidia
|
||||||
env = NVD_BACKEND,direct
|
env = NVD_BACKEND,direct
|
||||||
|
|
@ -50,15 +57,18 @@ in {
|
||||||
env = GSK_RENDERER,ngl
|
env = GSK_RENDERER,ngl
|
||||||
env = __NV_PRIME_RENDER_OFFLOAD,1
|
env = __NV_PRIME_RENDER_OFFLOAD,1
|
||||||
env = __VK_LAYER_NV_optimus,NVIDIA_only
|
env = __VK_LAYER_NV_optimus,NVIDIA_only
|
||||||
'' + ''
|
''
|
||||||
|
+ ''
|
||||||
|
|
||||||
env = XCURSOR_SIZE,24
|
env = XCURSOR_SIZE,24
|
||||||
env = HYPRCURSOR_SIZE,24
|
env = HYPRCURSOR_SIZE,24
|
||||||
'' + lib.optionalString nvidia ''
|
''
|
||||||
|
+ lib.optionalString nvidia ''
|
||||||
cursor {
|
cursor {
|
||||||
no_hardware_cursors = true
|
no_hardware_cursors = true
|
||||||
}
|
}
|
||||||
'' + ''
|
''
|
||||||
|
+ ''
|
||||||
|
|
||||||
general {
|
general {
|
||||||
gaps_in = 0
|
gaps_in = 0
|
||||||
|
|
@ -249,10 +259,12 @@ in {
|
||||||
hide_cursor = true;
|
hide_cursor = true;
|
||||||
grace = 0;
|
grace = 0;
|
||||||
};
|
};
|
||||||
background = [{
|
background = [
|
||||||
|
{
|
||||||
monitor = "";
|
monitor = "";
|
||||||
path = "~/img/screen/lock.jpg";
|
path = "~/img/screen/lock.jpg";
|
||||||
}];
|
}
|
||||||
|
];
|
||||||
animations.enabled = false;
|
animations.enabled = false;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
@ -275,9 +287,18 @@ in {
|
||||||
exclusive = true;
|
exclusive = true;
|
||||||
height = 34;
|
height = 34;
|
||||||
|
|
||||||
modules-left = [ "hyprland/workspaces" "hyprland/window" ];
|
modules-left = [
|
||||||
|
"hyprland/workspaces"
|
||||||
|
"hyprland/window"
|
||||||
|
];
|
||||||
modules-center = [ ];
|
modules-center = [ ];
|
||||||
modules-right = [ "backlight" "pulseaudio" "network" "battery" "clock" ];
|
modules-right = [
|
||||||
|
"backlight"
|
||||||
|
"pulseaudio"
|
||||||
|
"network"
|
||||||
|
"battery"
|
||||||
|
"clock"
|
||||||
|
];
|
||||||
|
|
||||||
"hyprland/workspaces" = {
|
"hyprland/workspaces" = {
|
||||||
disable-scroll = true;
|
disable-scroll = true;
|
||||||
|
|
@ -405,9 +426,11 @@ in {
|
||||||
extraConfig = {
|
extraConfig = {
|
||||||
show-icons = false;
|
show-icons = false;
|
||||||
};
|
};
|
||||||
theme = let
|
theme =
|
||||||
|
let
|
||||||
inherit (config.lib.formats.rasi) mkLiteral;
|
inherit (config.lib.formats.rasi) mkLiteral;
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
"*" = {
|
"*" = {
|
||||||
selected-normal-foreground = mkLiteral "${c.fg}";
|
selected-normal-foreground = mkLiteral "${c.fg}";
|
||||||
foreground = mkLiteral "${c.fg}";
|
foreground = mkLiteral "${c.fg}";
|
||||||
|
|
@ -463,7 +486,12 @@ in {
|
||||||
spacing = 0;
|
spacing = 0;
|
||||||
text-color = mkLiteral "@normal-foreground";
|
text-color = mkLiteral "@normal-foreground";
|
||||||
padding = mkLiteral "1px";
|
padding = mkLiteral "1px";
|
||||||
children = map mkLiteral [ "prompt" "textbox-prompt-colon" "entry" "case-indicator" ];
|
children = map mkLiteral [
|
||||||
|
"prompt"
|
||||||
|
"textbox-prompt-colon"
|
||||||
|
"entry"
|
||||||
|
"case-indicator"
|
||||||
|
];
|
||||||
};
|
};
|
||||||
textbox-prompt-colon = {
|
textbox-prompt-colon = {
|
||||||
expand = false;
|
expand = false;
|
||||||
|
|
@ -502,5 +530,6 @@ in {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
xdg.configFile."X11".source = config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/nix-config/config/X11";
|
xdg.configFile."X11".source =
|
||||||
|
config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/nix-config/config/X11";
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,12 @@
|
||||||
};
|
};
|
||||||
boot.loader.efi.canTouchEfiVariables = true;
|
boot.loader.efi.canTouchEfiVariables = true;
|
||||||
boot.loader.efi.efiSysMountPoint = "/boot/efi";
|
boot.loader.efi.efiSysMountPoint = "/boot/efi";
|
||||||
boot.kernelParams = [ "nvidia-drm.modeset=1" "ibt=off" "loglevel=3" "quiet" ];
|
boot.kernelParams = [
|
||||||
|
"nvidia-drm.modeset=1"
|
||||||
|
"ibt=off"
|
||||||
|
"loglevel=3"
|
||||||
|
"quiet"
|
||||||
|
];
|
||||||
|
|
||||||
networking.hostName = "xps15";
|
networking.hostName = "xps15";
|
||||||
networking.wireless.iwd = {
|
networking.wireless.iwd = {
|
||||||
|
|
@ -35,18 +40,26 @@
|
||||||
|
|
||||||
security.doas = {
|
security.doas = {
|
||||||
enable = true;
|
enable = true;
|
||||||
extraRules = [{
|
extraRules = [
|
||||||
|
{
|
||||||
groups = [ "wheel" ];
|
groups = [ "wheel" ];
|
||||||
persist = true;
|
persist = true;
|
||||||
keepEnv = true;
|
keepEnv = true;
|
||||||
}];
|
}
|
||||||
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
environment.binsh = "${pkgs.dash}/bin/dash";
|
environment.binsh = "${pkgs.dash}/bin/dash";
|
||||||
|
|
||||||
users.users.barrett = {
|
users.users.barrett = {
|
||||||
isNormalUser = true;
|
isNormalUser = true;
|
||||||
extraGroups = [ "wheel" "docker" "libvirt" "storage" "power" ];
|
extraGroups = [
|
||||||
|
"wheel"
|
||||||
|
"docker"
|
||||||
|
"libvirt"
|
||||||
|
"storage"
|
||||||
|
"power"
|
||||||
|
];
|
||||||
shell = pkgs.zsh;
|
shell = pkgs.zsh;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -119,7 +132,10 @@
|
||||||
dmidecode
|
dmidecode
|
||||||
];
|
];
|
||||||
|
|
||||||
nix.settings.experimental-features = [ "nix-command" "flakes" ];
|
nix.settings.experimental-features = [
|
||||||
|
"nix-command"
|
||||||
|
"flakes"
|
||||||
|
];
|
||||||
|
|
||||||
system.stateVersion = "24.11";
|
system.stateVersion = "24.11";
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue