Compare commits
11 Commits
f1b828c7fe
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
b6386b6094
|
|||
|
134fe16393
|
|||
|
af86c0c1e5
|
|||
|
15662647d7
|
|||
|
9f8ed18d72
|
|||
|
7acae9b431
|
|||
|
049c916f46
|
|||
|
7ca50dd7fe
|
|||
|
1eb41ac84e
|
|||
|
0009b7c33c
|
|||
|
056888e635
|
67
blueplum.nix
67
blueplum.nix
@@ -6,10 +6,46 @@
|
|||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
concat = strings: lib.concatStringsSep " " strings;
|
concat = strings: builtins.concatStringsSep " " strings;
|
||||||
|
wacom.src =
|
||||||
|
let
|
||||||
|
xsetwacom = "${pkgs.xf86_input_wacom}/bin/xsetwacom";
|
||||||
|
awk = lib.getExe pkgs.gawk;
|
||||||
|
in
|
||||||
|
''
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# Wait for X socket
|
||||||
|
for i in $(seq 30); do
|
||||||
|
[ -S /tmp/.X11-unix/X0 ] && break
|
||||||
|
sleep 0.5
|
||||||
|
done
|
||||||
|
|
||||||
|
# Just to be sure that the displays are ready...
|
||||||
|
sleep 5
|
||||||
|
|
||||||
|
export DISPLAY=:0
|
||||||
|
export XAUTHORITY="$HOME/.Xauthority"
|
||||||
|
|
||||||
|
for i in $(seq 10); do
|
||||||
|
if ${xsetwacom} list devices | grep -q Wacom; then
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
sleep 1
|
||||||
|
done
|
||||||
|
|
||||||
|
stylus=$(${xsetwacom} list devices | ${awk} -F' \t' '/stylus/{print $1}')
|
||||||
|
|
||||||
|
if [ -z "$${stylus}" ]; then
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
${xsetwacom} set "$stylus" MapToOutput HEAD-0
|
||||||
|
'';
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
services.xserver.videoDrivers = [ "nvidia" ];
|
services.xserver.videoDrivers = [ "nvidia" ];
|
||||||
|
services.xserver.wacom.enable = true;
|
||||||
|
|
||||||
hardware.nvidia = {
|
hardware.nvidia = {
|
||||||
modesetting.enable = true;
|
modesetting.enable = true;
|
||||||
@@ -21,22 +57,35 @@ in
|
|||||||
package = config.boot.kernelPackages.nvidiaPackages.stable;
|
package = config.boot.kernelPackages.nvidiaPackages.stable;
|
||||||
};
|
};
|
||||||
|
|
||||||
services.xserver.displayManager.setupCommands = concat [
|
home-manager.users.anton.xsession.profileExtra = concat [
|
||||||
"${lib.getExe pkgs.xorg.xrandr}"
|
"${lib.getExe pkgs.xorg.xrandr}"
|
||||||
concat
|
"${concat [
|
||||||
[
|
"--output DP-2"
|
||||||
"--output DP-0"
|
|
||||||
"--mode 1920x1080"
|
"--mode 1920x1080"
|
||||||
"--pos 0x0"
|
"--pos 0x0"
|
||||||
"--rate 144"
|
"--rate 144"
|
||||||
"--primary"
|
"--primary"
|
||||||
]
|
]}"
|
||||||
concat
|
"${concat [
|
||||||
[
|
|
||||||
"--output HDMI-0"
|
"--output HDMI-0"
|
||||||
"--mode 1920x1080"
|
"--mode 1920x1080"
|
||||||
"--pos 1920x0"
|
"--pos 1920x0"
|
||||||
"--rate 144"
|
"--rate 144"
|
||||||
]
|
]}"
|
||||||
];
|
];
|
||||||
|
|
||||||
|
systemd.user.services.wacom = {
|
||||||
|
enable = true;
|
||||||
|
description = "Configure my Wacom (One) tablet";
|
||||||
|
wantedBy = [ "default.target" ];
|
||||||
|
after = [ "graphical-session.target" ];
|
||||||
|
serviceConfig = {
|
||||||
|
Type = "oneshot";
|
||||||
|
ExecStart = pkgs.writeShellScript "wacom.sh" wacom.src;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
services.udev.extraRules = ''
|
||||||
|
ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="056a", TAG+="systemd", ENV{SYSTEMD_USER_WANTS}+="wacom.service"
|
||||||
|
'';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,18 +8,19 @@
|
|||||||
let
|
let
|
||||||
stateVersion = "25.05";
|
stateVersion = "25.05";
|
||||||
env = import ./.env.nix { inherit pkgs; };
|
env = import ./.env.nix { inherit pkgs; };
|
||||||
|
|
||||||
|
mpkgs = import ./pkgs/default.nix {
|
||||||
|
config = {
|
||||||
|
system.stateVersion = stateVersion;
|
||||||
|
};
|
||||||
|
};
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
# Include the results of the hardware scan.
|
# Include the results of the hardware scan.
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
(import (./. + "/${env.hostname}.nix"))
|
(import (./. + "/${env.hostname}.nix"))
|
||||||
(
|
mpkgs.home-manager.module
|
||||||
let
|
|
||||||
home-manager = builtins.fetchTarball "https://github.com/nix-community/home-manager/archive/release-${stateVersion}.tar.gz";
|
|
||||||
in
|
|
||||||
import "${home-manager}/nixos"
|
|
||||||
)
|
|
||||||
];
|
];
|
||||||
|
|
||||||
nixpkgs.config.allowUnfree = true;
|
nixpkgs.config.allowUnfree = true;
|
||||||
@@ -39,8 +40,10 @@ in
|
|||||||
git
|
git
|
||||||
xh
|
xh
|
||||||
jq
|
jq
|
||||||
|
fzf
|
||||||
|
ripgrep
|
||||||
|
|
||||||
(fenix.complete.withComponents [
|
(fenix.stable.withComponents [
|
||||||
"rustc"
|
"rustc"
|
||||||
"cargo"
|
"cargo"
|
||||||
"clippy"
|
"clippy"
|
||||||
@@ -48,13 +51,16 @@ in
|
|||||||
"rustfmt"
|
"rustfmt"
|
||||||
"rust-analyzer"
|
"rust-analyzer"
|
||||||
])
|
])
|
||||||
nodejs-slim_latest
|
nodejs_latest
|
||||||
|
prettierd
|
||||||
|
typescript-language-server
|
||||||
pnpm
|
pnpm
|
||||||
nixd
|
nixd
|
||||||
nixfmt-rfc-style
|
nixfmt-rfc-style
|
||||||
clang
|
clang
|
||||||
llvmPackages.bintools
|
llvmPackages.bintools
|
||||||
stylua
|
stylua
|
||||||
|
go
|
||||||
];
|
];
|
||||||
|
|
||||||
fonts.packages = with pkgs; [
|
fonts.packages = with pkgs; [
|
||||||
@@ -65,7 +71,7 @@ in
|
|||||||
nerd-fonts.symbols-only
|
nerd-fonts.symbols-only
|
||||||
inter
|
inter
|
||||||
times-newer-roman
|
times-newer-roman
|
||||||
(import ./pkgs/monaco-font/default.nix { inherit pkgs; })
|
(mpkgs.font.monaco)
|
||||||
];
|
];
|
||||||
|
|
||||||
fonts.fontconfig = {
|
fonts.fontconfig = {
|
||||||
@@ -149,9 +155,12 @@ in
|
|||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
home-manager.useUserPackages = true;
|
home-manager = {
|
||||||
home-manager.useGlobalPkgs = true;
|
useUserPackages = true;
|
||||||
home-manager.users.anton = import ./home.nix;
|
useGlobalPkgs = true;
|
||||||
|
sharedModules = [ ] ++ (mpkgs.home-manager.sharedModules);
|
||||||
|
users.anton = import ./home.nix;
|
||||||
|
};
|
||||||
|
|
||||||
# programs.home-manager.enable = true;
|
# programs.home-manager.enable = true;
|
||||||
programs.dconf.enable = true;
|
programs.dconf.enable = true;
|
||||||
@@ -161,7 +170,15 @@ in
|
|||||||
style = "adwaita-dark";
|
style = "adwaita-dark";
|
||||||
};
|
};
|
||||||
|
|
||||||
hardware.graphics.enable = true;
|
hardware.graphics = {
|
||||||
|
enable = true;
|
||||||
|
extraPackages = with pkgs; [
|
||||||
|
intel-media-driver
|
||||||
|
intel-vaapi-driver
|
||||||
|
libvdpau-va-gl
|
||||||
|
mesa
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
hardware.bluetooth = {
|
hardware.bluetooth = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|||||||
80
home.nix
80
home.nix
@@ -5,14 +5,16 @@
|
|||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
neovim = pkgs.callPackage ./pkgs/neovim/default.nix { };
|
mpkgs = import ./pkgs/default.nix { };
|
||||||
fish = pkgs.callPackage ./pkgs/fish/default.nix { };
|
inherit (mpkgs.config) neovim fish;
|
||||||
|
|
||||||
env = import ./.env.nix;
|
env = import ./.env.nix { inherit pkgs; };
|
||||||
|
|
||||||
home = /home/anton;
|
home = /home/anton;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
imports = [ ];
|
||||||
|
|
||||||
home.username = lib.mkDefault "anton";
|
home.username = lib.mkDefault "anton";
|
||||||
home.homeDirectory = lib.mkDefault home;
|
home.homeDirectory = lib.mkDefault home;
|
||||||
|
|
||||||
@@ -24,14 +26,20 @@ in
|
|||||||
flameshot
|
flameshot
|
||||||
krita
|
krita
|
||||||
davinci-resolve
|
davinci-resolve
|
||||||
|
vscode
|
||||||
|
godotPackages_4_5.godot
|
||||||
|
|
||||||
btop
|
|
||||||
neovim
|
neovim
|
||||||
|
btop
|
||||||
xclip
|
xclip
|
||||||
tree
|
tree
|
||||||
xh
|
xh
|
||||||
babelfish
|
babelfish
|
||||||
hyperfine
|
hyperfine
|
||||||
|
bat
|
||||||
|
|
||||||
|
typst
|
||||||
|
tinymist
|
||||||
|
|
||||||
# required by spotify
|
# required by spotify
|
||||||
ffmpeg_4
|
ffmpeg_4
|
||||||
@@ -127,6 +135,68 @@ in
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
programs.tetrio-desktop = {
|
||||||
|
enable = true;
|
||||||
|
package = mpkgs.tetrio.desktop;
|
||||||
|
|
||||||
|
plus = {
|
||||||
|
enable = true;
|
||||||
|
package = mpkgs.tetrio.plus;
|
||||||
|
skin.package = mpkgs.tetrio.skins.simple-connected;
|
||||||
|
};
|
||||||
|
|
||||||
|
settings = {
|
||||||
|
handling = {
|
||||||
|
auto_repeat_rate = 0;
|
||||||
|
delayed_auto_shift = 7;
|
||||||
|
soft_drop_factor = 14;
|
||||||
|
};
|
||||||
|
audio = {
|
||||||
|
scroll_adjust_volume = false;
|
||||||
|
stereo = 60;
|
||||||
|
|
||||||
|
music.preferences = {
|
||||||
|
kaze-no-sanpomichi = "-";
|
||||||
|
muscat-to-shiroi-osara = "-";
|
||||||
|
akindo = "+";
|
||||||
|
yoru-no-niji = "+";
|
||||||
|
burari-tokyo = "+";
|
||||||
|
fuyu-no-jinkoueisei = "+";
|
||||||
|
honemi-ni-shimiiru-karasukaze = "-";
|
||||||
|
"21seiki-no-hitobito" = "+";
|
||||||
|
haru-wo-machinagara = "++";
|
||||||
|
go-go-go-summer = "-";
|
||||||
|
sasurai-no-hitoritabi = "++";
|
||||||
|
wakana = "-";
|
||||||
|
zange-no-ma = "-";
|
||||||
|
asphalt = "-";
|
||||||
|
madobe-no-hidamari = "--";
|
||||||
|
sora-no-sakura = "-";
|
||||||
|
suiu = "-";
|
||||||
|
burning-heart = "+";
|
||||||
|
hayate-no-sei = "-";
|
||||||
|
ima-koso = "+";
|
||||||
|
chiheisen-wo-koete = "--";
|
||||||
|
moyase-toushi-yobisamase-tamashii = "-";
|
||||||
|
uchuu-5239 = "+";
|
||||||
|
ultra-super-heros = "-";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
visual = {
|
||||||
|
board_bounciness = 20;
|
||||||
|
background_opacity = 0;
|
||||||
|
};
|
||||||
|
multiplayer.notifications.suppress_while_playing = true;
|
||||||
|
|
||||||
|
skip_login_screen = "by-url";
|
||||||
|
advertisments.i_support_the_devs.i_cannot_play_with_ads.and_i_really_want_to.disable = true;
|
||||||
|
|
||||||
|
devtools = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
programs.vesktop = import ./home/vesktop.nix;
|
||||||
|
|
||||||
services.gpg-agent = {
|
services.gpg-agent = {
|
||||||
enable = true;
|
enable = true;
|
||||||
enableSshSupport = true;
|
enableSshSupport = true;
|
||||||
@@ -149,5 +219,5 @@ in
|
|||||||
NIXPKGS_ALLOW_UNFREE = 1;
|
NIXPKGS_ALLOW_UNFREE = 1;
|
||||||
};
|
};
|
||||||
|
|
||||||
home.stateVersion = (pkgs.callPackage <nixos-config> { }).system.stateVersion;
|
home.stateVersion = mpkgs.system.stateVersion;
|
||||||
}
|
}
|
||||||
|
|||||||
18
home/i3.nix
18
home/i3.nix
@@ -56,8 +56,8 @@ in
|
|||||||
let
|
let
|
||||||
background = lib.concatStringsSep " " [
|
background = lib.concatStringsSep " " [
|
||||||
"exec --no-startup-id"
|
"exec --no-startup-id"
|
||||||
"${lib.concatStringsSep " " [
|
(lib.concatStringsSep " " [
|
||||||
"${lib.getExe pkgs.xwinwrap}"
|
(lib.getExe pkgs.xwinwrap)
|
||||||
"-g 3820x1080"
|
"-g 3820x1080"
|
||||||
"-s"
|
"-s"
|
||||||
"-b"
|
"-b"
|
||||||
@@ -65,10 +65,10 @@ in
|
|||||||
"-sp"
|
"-sp"
|
||||||
"-ov"
|
"-ov"
|
||||||
"-nf"
|
"-nf"
|
||||||
]}"
|
])
|
||||||
"--"
|
"--"
|
||||||
"${lib.concatStringsSep " " [
|
(lib.concatStringsSep " " [
|
||||||
"${lib.getExe pkgs.mpv}"
|
(lib.getExe pkgs.mpv)
|
||||||
"${wallpaper}/wallpaper.mov"
|
"${wallpaper}/wallpaper.mov"
|
||||||
"-wid WID"
|
"-wid WID"
|
||||||
"--loop"
|
"--loop"
|
||||||
@@ -81,7 +81,7 @@ in
|
|||||||
"--framedrop=vo"
|
"--framedrop=vo"
|
||||||
"--profile=low-latency"
|
"--profile=low-latency"
|
||||||
"--hwdec=auto"
|
"--hwdec=auto"
|
||||||
]}"
|
])
|
||||||
];
|
];
|
||||||
displays =
|
displays =
|
||||||
if (env ? displays) then
|
if (env ? displays) then
|
||||||
@@ -89,6 +89,12 @@ in
|
|||||||
"workspace 1 output ${env.displays.primary}"
|
"workspace 1 output ${env.displays.primary}"
|
||||||
(if (env.displays ? secondary) then "workspace 2 output ${env.displays.secondary}" else "")
|
(if (env.displays ? secondary) then "workspace 2 output ${env.displays.secondary}" else "")
|
||||||
"exec i3-msg focus output ${env.displays.primary}"
|
"exec i3-msg focus output ${env.displays.primary}"
|
||||||
|
(
|
||||||
|
if (env.displays ? xrandr) then
|
||||||
|
"exec \"${lib.getExe pkgs.xorg.xrandr} ${env.displays.xrandr}\""
|
||||||
|
else
|
||||||
|
""
|
||||||
|
)
|
||||||
]
|
]
|
||||||
else
|
else
|
||||||
"";
|
"";
|
||||||
|
|||||||
55
pkgs/default.nix
Normal file
55
pkgs/default.nix
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
{
|
||||||
|
pkgs ? import <nixpkgs> { config.allowUnfree = true; },
|
||||||
|
config ? (import <nixpkgs/nixos> { }).config,
|
||||||
|
fetchzip ? pkgs.fetchzip,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
|
let
|
||||||
|
system = {
|
||||||
|
stateVersion = config.system.stateVersion;
|
||||||
|
};
|
||||||
|
use = path: pkgs.callPackage (import path) { inherit pkgs; };
|
||||||
|
in
|
||||||
|
{
|
||||||
|
inherit system;
|
||||||
|
|
||||||
|
wallpaper = use ./wallpaper/default.nix;
|
||||||
|
tetrio.desktop = use ./tetrio/default.nix;
|
||||||
|
tetrio.plus =
|
||||||
|
let
|
||||||
|
repo = {
|
||||||
|
owner = "UniQMG";
|
||||||
|
name = "tetrio-plus";
|
||||||
|
job = "11675178434";
|
||||||
|
hash = "sha256-j3ACcnT64eMQtWYDGOE2oGXpnN5EUqk+lyV6ARBEtU8=";
|
||||||
|
};
|
||||||
|
src = fetchzip {
|
||||||
|
url = "https://gitlab.com/${repo.owner}/${repo.name}/-/jobs/${repo.job}/artifacts/raw/app.asar.zip";
|
||||||
|
hash = repo.hash;
|
||||||
|
};
|
||||||
|
in
|
||||||
|
"${src}/app.asar";
|
||||||
|
tetrio.skins = {
|
||||||
|
simple-connected = use ./tetrio/skins/simple-connected.nix;
|
||||||
|
};
|
||||||
|
|
||||||
|
leveldb-cli = use ./leveldb/default.nix;
|
||||||
|
|
||||||
|
config.neovim = use ./neovim/default.nix;
|
||||||
|
config.fish = use ./fish/default.nix;
|
||||||
|
|
||||||
|
font.monaco = use ./monaco-font/default.nix;
|
||||||
|
|
||||||
|
home-manager = {
|
||||||
|
module =
|
||||||
|
let
|
||||||
|
home-manager = fetchzip {
|
||||||
|
url = "https://github.com/nix-community/home-manager/archive/release-${system.stateVersion}.tar.gz";
|
||||||
|
hash = "sha256-WHkdBlw6oyxXIra/vQPYLtqY+3G8dUVZM8bEXk0t8x4=";
|
||||||
|
};
|
||||||
|
in
|
||||||
|
import "${home-manager}/nixos";
|
||||||
|
sharedModules = [ ./home-manager/initialFile.nix ./tetrio/module.nix ];
|
||||||
|
};
|
||||||
|
}
|
||||||
172
pkgs/home-manager/initialFile.nix
Normal file
172
pkgs/home-manager/initialFile.nix
Normal file
@@ -0,0 +1,172 @@
|
|||||||
|
{
|
||||||
|
pkgs,
|
||||||
|
lib ? pkgs.lib,
|
||||||
|
config,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
|
let
|
||||||
|
inherit (lib) mkOption types;
|
||||||
|
|
||||||
|
cfg = lib.filterAttrs (n: f: f.enable) config.home.initialFile;
|
||||||
|
home = config.home.homeDirectory;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options = {
|
||||||
|
home.initialFile = mkOption {
|
||||||
|
type = types.attrsOf (
|
||||||
|
types.submodule (
|
||||||
|
{ name, config, ... }:
|
||||||
|
{
|
||||||
|
options = {
|
||||||
|
enable = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = true;
|
||||||
|
};
|
||||||
|
target = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
apply =
|
||||||
|
path:
|
||||||
|
let
|
||||||
|
absPath = if lib.hasPrefix "/" path then path else "${home}/${path}";
|
||||||
|
in
|
||||||
|
lib.removePrefix (home + "/") absPath;
|
||||||
|
description = "Path to target file relative to home directory";
|
||||||
|
default = "/homeless-shelter/home";
|
||||||
|
};
|
||||||
|
text = mkOption {
|
||||||
|
type = types.nullOr types.lines;
|
||||||
|
description = "Text of the file, otherwise copies .source file.";
|
||||||
|
default = null;
|
||||||
|
};
|
||||||
|
source = mkOption {
|
||||||
|
type = types.path;
|
||||||
|
description = "Path of file whose source to copy";
|
||||||
|
};
|
||||||
|
mode = mkOption {
|
||||||
|
type = types.nullOr types.str;
|
||||||
|
description = "File mode to apply to target file (sourced from .source / .text if not specified)";
|
||||||
|
default = null;
|
||||||
|
};
|
||||||
|
dir_mode = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
description = "File mode to apply to directories";
|
||||||
|
default = "0755";
|
||||||
|
};
|
||||||
|
recursive = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
description = "Whether or not to recursively copy .source as a directory instead of as a file";
|
||||||
|
default = false;
|
||||||
|
};
|
||||||
|
force = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
description = "Whether to unconditionally replace the target file, even if it already exists.";
|
||||||
|
default = false;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
config = {
|
||||||
|
target = lib.mkDefault name;
|
||||||
|
source = lib.mkIf (config.text != null) (
|
||||||
|
lib.mkDefault (
|
||||||
|
pkgs.writeTextFile {
|
||||||
|
inherit (config) text;
|
||||||
|
name = lib.hm.strings.storeFileName name;
|
||||||
|
}
|
||||||
|
)
|
||||||
|
);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
)
|
||||||
|
);
|
||||||
|
description = "Attribute set of files to write into the user home (if they don't already exist).";
|
||||||
|
default = { };
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = {
|
||||||
|
assertions = [
|
||||||
|
(
|
||||||
|
let
|
||||||
|
dups = lib.attrNames (
|
||||||
|
lib.filterAttrs (n: v: v > 1) (
|
||||||
|
lib.foldAttrs (acc: v: acc + v) 0 (lib.mapAttrsToList (n: v: { ${v.target} = 1; }) cfg)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
dupsStr = lib.concatStringsSep ", " dups;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
assertion = dups == [ ];
|
||||||
|
message = ''
|
||||||
|
Conflicting managed target files: ${dupsStr}
|
||||||
|
|
||||||
|
This may happen, for example, if you have a configuration similar to
|
||||||
|
|
||||||
|
home.initialFile = {
|
||||||
|
conflict1 = { source = ./foo.nix; target = "baz"; };
|
||||||
|
conflict2 = { source = ./bar.nix; target = "baz"; };
|
||||||
|
}'';
|
||||||
|
}
|
||||||
|
)
|
||||||
|
];
|
||||||
|
|
||||||
|
home.activation.copyInitialFiles = lib.hm.dag.entryAfter [ "writeBoundary" ] (
|
||||||
|
let
|
||||||
|
homeArg = lib.escapeShellArg home;
|
||||||
|
in
|
||||||
|
''
|
||||||
|
function copyFile() {
|
||||||
|
local source="$1"
|
||||||
|
local targetRel="$2"
|
||||||
|
local mode="$3"
|
||||||
|
local dirMode="$4"
|
||||||
|
local recursive="$5"
|
||||||
|
local force="$6"
|
||||||
|
|
||||||
|
local target="${homeArg}/$targetRel"
|
||||||
|
|
||||||
|
if [[ -e "$target" && "$force" != "true" ]]; then
|
||||||
|
verboseEcho "Skipping existing $target"
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
run mkdir -p "$(dirname "$target")"
|
||||||
|
|
||||||
|
if [[ -d "$source" ]]; then
|
||||||
|
if [[ "$recursive" != "true" ]]; then
|
||||||
|
errorEcho "Source '$source' is a directory but recursive=false"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
run rm -rf "$target"
|
||||||
|
run cp -r "$source" "$target"
|
||||||
|
else
|
||||||
|
if [[ -e "$target" && "$force" == "true" ]]; then
|
||||||
|
run rm -f "$target"
|
||||||
|
fi
|
||||||
|
run cp "$source" "$target"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ -n "$mode" ]]; then
|
||||||
|
if [[ -d "$target" && "$recursive" == "true" ]]; then
|
||||||
|
run chmod "$dirMode" "$target"
|
||||||
|
find "$target" -type f -exec chmod "$mode" {} +
|
||||||
|
else
|
||||||
|
run chmod "$mode" "$target"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
''
|
||||||
|
+ lib.concatMapStrings (
|
||||||
|
v:
|
||||||
|
let
|
||||||
|
src = lib.escapeShellArg (toString v.source);
|
||||||
|
tgt = lib.escapeShellArg v.target;
|
||||||
|
mode = if v.mode == null then "''" else lib.escapeShellArg v.mode;
|
||||||
|
in
|
||||||
|
''
|
||||||
|
copyFile ${src} ${tgt} ${mode} ${lib.escapeShellArg v.dir_mode} ${lib.trivial.boolToString v.recursive} ${lib.trivial.boolToString v.force}
|
||||||
|
''
|
||||||
|
) (lib.attrValues cfg)
|
||||||
|
);
|
||||||
|
|
||||||
|
};
|
||||||
|
}
|
||||||
21
pkgs/leveldb/default.nix
Normal file
21
pkgs/leveldb/default.nix
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
{
|
||||||
|
pkgs ? import <nixpkgs> { },
|
||||||
|
}:
|
||||||
|
|
||||||
|
pkgs.buildGoModule {
|
||||||
|
name = "leveldb-cli";
|
||||||
|
version = "1.0.0";
|
||||||
|
|
||||||
|
src = pkgs.fetchFromGitHub {
|
||||||
|
owner = "theblueplum";
|
||||||
|
repo = "leveldb-cli";
|
||||||
|
rev = "main";
|
||||||
|
hash = "sha256-Q4BVmmqc6MPrOLy/lSV1FyhAoKBq0U2UcMHYEMOhtpo=";
|
||||||
|
};
|
||||||
|
|
||||||
|
vendorHash = "sha256-b25hlPQft9iKyIw6E9jtORBgoLPnNa4+Z5QoeFoayfc=";
|
||||||
|
|
||||||
|
meta = {
|
||||||
|
mainProgram = "leveldb";
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -53,6 +53,9 @@ local keymap = {
|
|||||||
goto_last_buffer = {
|
goto_last_buffer = {
|
||||||
['<leader>l'] = ':e#<CR>',
|
['<leader>l'] = ':e#<CR>',
|
||||||
},
|
},
|
||||||
|
goto_definition = {
|
||||||
|
['gd'] = vim.lsp.buf.declaration
|
||||||
|
},
|
||||||
scratch_pad = {
|
scratch_pad = {
|
||||||
['<leader>s'] = table.concat({
|
['<leader>s'] = table.concat({
|
||||||
':bo vs',
|
':bo vs',
|
||||||
|
|||||||
@@ -9,10 +9,14 @@ return {
|
|||||||
{
|
{
|
||||||
'tpope/vim-fugitive',
|
'tpope/vim-fugitive',
|
||||||
cmd = { 'Git' },
|
cmd = { 'Git' },
|
||||||
|
enabled = false, -- prefer using a terminal buffer with unnest.nvim
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
dir = '~/dev/share.nvim/',
|
dir = '~/dev/share.nvim/',
|
||||||
opts = {},
|
opts = {},
|
||||||
enabled = false,
|
enabled = false,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
'brianhuster/unnest.nvim',
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ local function formatter(exe, args)
|
|||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
local prettier = formatter('prettier', {
|
local prettier = formatter('prettierd', {
|
||||||
'--config-precedence prefer-file',
|
'--config-precedence prefer-file',
|
||||||
'--single-quote',
|
'--single-quote',
|
||||||
'--use-tabs',
|
'--use-tabs',
|
||||||
|
|||||||
@@ -11,11 +11,12 @@ return {
|
|||||||
|
|
||||||
mason_lspconfig.setup(lazy.opts)
|
mason_lspconfig.setup(lazy.opts)
|
||||||
mason_lspconfig.setup_handlers({
|
mason_lspconfig.setup_handlers({
|
||||||
vim.lsp.enable
|
vim.lsp.enable,
|
||||||
})
|
})
|
||||||
|
|
||||||
vim.lsp.enable('nixd')
|
for _, lsp in pairs({ 'nixd', 'rust_analyzer', 'ts_ls' }) do
|
||||||
vim.lsp.enable('rust_analyzer')
|
vim.lsp.enable(lsp)
|
||||||
|
end
|
||||||
end,
|
end,
|
||||||
dependencies = {
|
dependencies = {
|
||||||
'mason-org/mason.nvim',
|
'mason-org/mason.nvim',
|
||||||
@@ -51,11 +52,16 @@ return {
|
|||||||
menu = {
|
menu = {
|
||||||
auto_show = true,
|
auto_show = true,
|
||||||
draw = {
|
draw = {
|
||||||
columns = { { 'kind_icon' }, { 'label', 'label_description', gap = 1 }, { 'kind' } },
|
columns = {
|
||||||
|
{ 'kind_icon' },
|
||||||
|
{ 'label', 'label_description', gap = 1 },
|
||||||
|
{ 'kind' },
|
||||||
|
},
|
||||||
components = {
|
components = {
|
||||||
kind_icon = {
|
kind_icon = {
|
||||||
text = function(ctx)
|
text = function(ctx)
|
||||||
local icon, _, _ = common.icons_require().get('lsp', ctx.kind)
|
local icon, _, _ =
|
||||||
|
common.icons_require().get('lsp', ctx.kind)
|
||||||
return icon
|
return icon
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,24 +1,32 @@
|
|||||||
local common = require('BluePlum.lazy')
|
local common = require('BluePlum.lazy')
|
||||||
local telescope = {
|
local fzf_lua = {
|
||||||
find_files = function()
|
find_files = function()
|
||||||
require('telescope.builtin').find_files({ show_hidden = true })
|
require('fzf-lua').files()
|
||||||
end,
|
end,
|
||||||
live_grep = function()
|
live_grep = function()
|
||||||
require('telescope.builtin').live_grep()
|
require('fzf-lua').grep()
|
||||||
end,
|
end,
|
||||||
buffers = function()
|
buffers = function()
|
||||||
require('telescope.builtin').buffers()
|
require('fzf-lua').buffers()
|
||||||
|
end,
|
||||||
|
quick_fix = function()
|
||||||
|
require('fzf-lua').lsp_code_actions()
|
||||||
|
end,
|
||||||
|
diagnostics = function()
|
||||||
|
require('fzf-lua').diagnostics_workspace()
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
{
|
{
|
||||||
'nvim-telescope/telescope.nvim',
|
'ibhagwan/fzf-lua',
|
||||||
dependencies = { common.plenary },
|
dependencies = { common.icons },
|
||||||
keys = {
|
keys = {
|
||||||
{ '<leader>ff', telescope.find_files },
|
{ '<leader>ff', fzf_lua.find_files },
|
||||||
{ '<leader>fs', telescope.live_grep },
|
{ '<leader>fs', fzf_lua.live_grep },
|
||||||
{ '<leader>bb', telescope.buffers },
|
{ '<leader>fd', fzf_lua.diagnostics },
|
||||||
|
{ '<leader>bb', fzf_lua.buffers },
|
||||||
|
{ 'gra', fzf_lua.quick_fix },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
30
pkgs/tetrio/default.nix
Normal file
30
pkgs/tetrio/default.nix
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
{
|
||||||
|
pkgs ? import <nixpkgs> { },
|
||||||
|
fetchzip ? pkgs.fetchzip,
|
||||||
|
withTetrioPlus ? false,
|
||||||
|
tetrio-plus ? pkgs.tetrio-plus,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
|
let
|
||||||
|
tetrio-desktop =
|
||||||
|
let
|
||||||
|
version = "10";
|
||||||
|
in
|
||||||
|
{
|
||||||
|
inherit version;
|
||||||
|
src = fetchzip {
|
||||||
|
url = "https://tetr.io/about/desktop/builds/${version}/TETR.IO%20Setup.deb";
|
||||||
|
hash = "sha256-2FtFCajNEj7O8DGangDecs2yeKbufYLx1aZb3ShnYvw=";
|
||||||
|
nativeBuildInputs = with pkgs; [ dpkg ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
in
|
||||||
|
|
||||||
|
(pkgs.tetrio-desktop.overrideAttrs {
|
||||||
|
version = tetrio-desktop.version;
|
||||||
|
src = tetrio-desktop.src;
|
||||||
|
}).override {
|
||||||
|
inherit withTetrioPlus tetrio-plus;
|
||||||
|
}
|
||||||
32
pkgs/tetrio/leveldb.nix
Normal file
32
pkgs/tetrio/leveldb.nix
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
{
|
||||||
|
pkgs ? import <nixpkgs> { },
|
||||||
|
mpkgs ? import /etc/nixos/pkgs/default.nix { },
|
||||||
|
origin ? "https://tetr.io",
|
||||||
|
key ? "userConfig",
|
||||||
|
value,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
|
let
|
||||||
|
src = ./.;
|
||||||
|
in
|
||||||
|
pkgs.stdenv.mkDerivation {
|
||||||
|
pname = "tetrio-leveldb";
|
||||||
|
version = "1";
|
||||||
|
|
||||||
|
inherit src;
|
||||||
|
|
||||||
|
nativeBuildInputs = [ mpkgs.leveldb-cli ];
|
||||||
|
|
||||||
|
buildPhase = ''
|
||||||
|
runHook preBuild
|
||||||
|
|
||||||
|
${pkgs.lib.getExe mpkgs.leveldb-cli} \
|
||||||
|
$out \
|
||||||
|
${pkgs.lib.escapeShellArg origin} \
|
||||||
|
${pkgs.lib.escapeShellArg key} \
|
||||||
|
${pkgs.lib.escapeShellArg (builtins.toJSON value)}
|
||||||
|
|
||||||
|
runHook postBuild
|
||||||
|
'';
|
||||||
|
}
|
||||||
725
pkgs/tetrio/module.nix
Normal file
725
pkgs/tetrio/module.nix
Normal file
File diff suppressed because it is too large
Load Diff
31
pkgs/tetrio/skins/simple-connected.nix
Normal file
31
pkgs/tetrio/skins/simple-connected.nix
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
{
|
||||||
|
pkgs ? import <nixpkgs> { },
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
|
let
|
||||||
|
src = pkgs.fetchurl {
|
||||||
|
url = "https://you.have.fail/tetrioplus/data/tpsefiles/skin/SpooKoArts/simple_connected.zip.tpse";
|
||||||
|
hash = "sha256-dIrEpEV9Gy2iU6K6rMrNX4XFQEchkJqSmOuQwVF4EQQ=";
|
||||||
|
};
|
||||||
|
in
|
||||||
|
pkgs.stdenv.mkDerivation {
|
||||||
|
name = "simple-connected";
|
||||||
|
version = "2022-06-26";
|
||||||
|
inherit src;
|
||||||
|
|
||||||
|
dontUnpack = true;
|
||||||
|
dontBuild = true;
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
runHook preInstall
|
||||||
|
cp ${src} $out
|
||||||
|
runHook postInstall
|
||||||
|
'';
|
||||||
|
|
||||||
|
fixupPhase = ''
|
||||||
|
runHook preFixup
|
||||||
|
sed -i 's/\bskin\b/value/' $out
|
||||||
|
runHook postFixup
|
||||||
|
'';
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user