1
mirror of https://github.com/wlcx/home.git synced 2025-12-10 12:33:45 +00:00

Compare commits

..

No commits in common. "aebb5dcd08871450ec6bd788c278f44ccbc84b68" and "6e55465310e8d652c19ab415f9effa518f5b0de9" have entirely different histories.

20 changed files with 610 additions and 1837 deletions

37
flake.lock generated
View File

@ -2,16 +2,19 @@
"nodes": { "nodes": {
"devshell": { "devshell": {
"inputs": { "inputs": {
"flake-utils": [
"flake-utils"
],
"nixpkgs": [ "nixpkgs": [
"nixpkgs" "nixpkgs"
] ]
}, },
"locked": { "locked": {
"lastModified": 1764011051, "lastModified": 1713532798,
"narHash": "sha256-M7SZyPZiqZUR/EiiBJnmyUbOi5oE/03tCeFrTiUZchI=", "narHash": "sha256-wtBhsdMJA3Wa32Wtm1eeo84GejtI43pMrFrmwLXrsEc=",
"owner": "numtide", "owner": "numtide",
"repo": "devshell", "repo": "devshell",
"rev": "17ed8d9744ebe70424659b0ef74ad6d41fc87071", "rev": "12e914740a25ea1891ec619bb53cf5e6ca922e40",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -25,11 +28,11 @@
"systems": "systems" "systems": "systems"
}, },
"locked": { "locked": {
"lastModified": 1731533236, "lastModified": 1710146030,
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
"owner": "numtide", "owner": "numtide",
"repo": "flake-utils", "repo": "flake-utils",
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -45,43 +48,43 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1764866045, "lastModified": 1756245065,
"narHash": "sha256-0GsEtXV9OquDQ1VclQfP16cU5VZh7NEVIOjSH4UaJuM=", "narHash": "sha256-aAZNbGcWrVRZgWgkQbkabSGcDVRDMgON4BipMy69gvI=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "f63d0fe9d81d36e5fc95497217a72e02b8b7bcab", "rev": "54b2879ce622d44415e727905925e21b8f833a98",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "nix-community", "owner": "nix-community",
"ref": "release-25.11", "ref": "release-25.05",
"repo": "home-manager", "repo": "home-manager",
"type": "github" "type": "github"
} }
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1764831616, "lastModified": 1756494058,
"narHash": "sha256-OtzF5wBvO0jgW1WW1rQU9cMGx7zuvkF7CAVJ1ypzkxA=", "narHash": "sha256-Yxg5zKIM450FAq7ihT6wkbuJ+Fl3KjbSpPjwFhSgMGc=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "c97c47f2bac4fa59e2cbdeba289686ae615f8ed4", "rev": "2788026c663a210beeb81e85f93ca5e86243fb3c",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "nixos", "owner": "nixos",
"ref": "nixos-25.11", "ref": "release-25.05",
"repo": "nixpkgs", "repo": "nixpkgs",
"type": "github" "type": "github"
} }
}, },
"nixpkgs-unstable": { "nixpkgs-unstable": {
"locked": { "locked": {
"lastModified": 1764951420, "lastModified": 1713995654,
"narHash": "sha256-oLJXP0fb5hyUvHGKAWdtjhl1/4ivxXy3HsuMMTTxrd8=", "narHash": "sha256-S+4C0H9w7H9tSv1RviD/otsTmf1ECuxJMJ/j1t9gjPE=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "0b784f7c32b9bbab8a599ccc6b4acc58f42d6f4f", "rev": "ce6da85c2dc9e659bef799c2ed053771e1bb8ee3",
"type": "github" "type": "github"
}, },
"original": { "original": {

231
flake.nix
View File

@ -2,157 +2,106 @@
description = "Samw's home environment, as managed by nix/home-manager."; description = "Samw's home environment, as managed by nix/home-manager.";
inputs = { inputs = {
# Nixpkgs # Nixpkgs
nixpkgs = { nixpkgs = {url = "github:nixos/nixpkgs/release-25.05";};
# N.B. we use the nixos-x branch as this is updated *after* successful hydra builds nixpkgs-unstable = {url = "github:nixos/nixpkgs";};
# rather than release-x. See https://wiki.nixos.org/wiki/Channel_branches
url = "github:nixos/nixpkgs/nixos-25.11";
};
nixpkgs-unstable = {
url = "github:nixos/nixpkgs";
};
# Other modules # Other modules
home-manager = { home-manager = {
url = "github:nix-community/home-manager/release-25.11"; url = "github:nix-community/home-manager/release-25.05";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
flake-utils.url = "github:numtide/flake-utils"; flake-utils.url = "github:numtide/flake-utils";
devshell = { devshell = {
url = "github:numtide/devshell"; url = "github:numtide/devshell";
inputs.flake-utils.follows = "flake-utils";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
}; };
outputs = outputs = inputs: let
inputs: overlays = [
let # Add our own local packages
overlays = [ (final: prev: {
# Add our own local packages # Make my local packages available as pkgs.mypkgs.<foo>
(final: prev: { mypkgs = prev.callPackage ./pkgs {};
# Make my local packages available as pkgs.mypkgs.<foo> })
mypkgs = prev.callPackage ./pkgs { }; # more up to date ssh-tpm-agent. Can probably ditch this post-24.05
}) (final: prev: {
# more up to date ssh-tpm-agent. Can probably ditch this post-24.05 ssh-tpm-agent = (import inputs.nixpkgs-unstable { system = prev.system; }).ssh-tpm-agent;
(final: prev: { })
ssh-tpm-agent = (import inputs.nixpkgs-unstable { system = prev.system; }).ssh-tpm-agent; ];
}) in (rec {
]; profiles = import ./home/profiles.nix;
in lib = {
( mkHome = {
rec { profiles,
profiles = import ./home/profiles.nix; system,
lib = { username ? "samw",
mkHome = }:
{ inputs.home-manager.lib.homeManagerConfiguration {
profiles, pkgs = (import inputs.nixpkgs {
system, inherit system;
username ? "samw", config.allowUnfree = true; # Yes I know it's bad for me
}: });
inputs.home-manager.lib.homeManagerConfiguration { modules = [
pkgs = ( { home = {
import inputs.nixpkgs { inherit username;
inherit system; homeDirectory =
config.allowUnfree = true; # Yes I know it's bad for me if (inputs.nixpkgs.lib.systems.elaborate system).isDarwin
} then "/Users/${username}"
); else "/home/${username}";
modules = [ stateVersion = "21.11";
{ };}] ++ profiles ++ [
home = { {nixpkgs.overlays = overlays;}
inherit username; # See comment in home/default.nix.
homeDirectory = ({ pkgs, ... }: {
if (inputs.nixpkgs.lib.systems.elaborate system).isDarwin then nix = {
"/Users/${username}" enable = true;
else package = pkgs.nix;
"/home/${username}"; settings.experimental-features = "nix-command flakes";
stateVersion = "21.11"; settings.max-jobs = "auto"; # Gotta go fast (build derivations in parallel)
}; # Pin the nixpkgs registry to our locked nixpkgs. This means that we
} # get the same packages via e.g. nix shell as we have at the system
] # level, so less duplication overall and no more fetching that 30MB src
++ profiles # every time you run nix shell.
++ [ registry.nixpkgs.flake = inputs.nixpkgs;
{ nixpkgs.overlays = overlays; } };
# See comment in home/default.nix. })
( ];
{ pkgs, ... }: extraSpecialArgs = {inherit system;};
{ };
nix = { };
enable = true;
package = pkgs.nix;
settings.experimental-features = "nix-command flakes";
settings.max-jobs = "auto"; # Gotta go fast (build derivations in parallel)
# Pin the nixpkgs registry to our locked nixpkgs. This means that we
# get the same packages via e.g. nix shell as we have at the system
# level, so less duplication overall and no more fetching that 30MB src
# every time you run nix shell.
registry.nixpkgs.flake = inputs.nixpkgs;
registry.nixpkgs-unstable.to = {
owner = "nixos";
repo = "nixpkgs";
type = "github";
};
};
}
)
];
extraSpecialArgs = { inherit system; };
};
};
# Standalone home-manager configurations # Standalone home-manager configurations
homeConfigurations = { homeConfigurations = {
zinc = lib.mkHome { zinc = lib.mkHome {
system = "aarch64-darwin"; system = "aarch64-darwin";
profiles = with profiles; [ profiles = with profiles; [default dev dev-gui sensitive mac];
default
dev
dev-gui
sensitive
mac
];
};
luroy = lib.mkHome {
system = "x86_64-linux";
profiles = with profiles; [
default
dev
];
};
phosphorus = lib.mkHome {
system = "aarch64-darwin";
profiles = with profiles; [
default
dev
sensitive
mac
];
};
}; };
} luroy = lib.mkHome {
# Per-system things system = "x86_64-linux";
// (inputs.flake-utils.lib.eachDefaultSystem ( profiles = with profiles; [default dev];
system: };
let };
pkgs = import inputs.nixpkgs { }
inherit system; # Per-system things
overlays = overlays ++ [ inputs.devshell.overlays.default ]; // (inputs.flake-utils.lib.eachDefaultSystem (system: let
}; pkgs = import inputs.nixpkgs {
platform = pkgs.lib.systems.elaborate system; inherit system;
in overlays = overlays ++ [inputs.devshell.overlays.default];
{ };
# Flake interface to my local packages. platform = pkgs.lib.systems.elaborate system;
# - `callPackage` puts some junk in mypkgs (`override` and in {
# `overrideDerivation`) so we filter out anything that isn't a derivation # Flake interface to my local packages.
# - We also filter out any packages that aren't supported on the current # - `callPackage` puts some junk in mypkgs (`override` and
# platform. # `overrideDerivation`) so we filter out anything that isn't a derivation
packages = # - We also filter out any packages that aren't supported on the current
with pkgs.lib; # platform.
(filterAttrs (_: v: (isDerivation v && meta.availableOn platform v)) pkgs.mypkgs); packages = with pkgs.lib; (filterAttrs (_: v: (isDerivation v && meta.availableOn platform v)) pkgs.mypkgs);
formatter = pkgs.nixfmt-tree; formatter = pkgs.alejandra;
# A devshell with useful utils # A devshell with useful utils
devShells.default = pkgs.devshell.mkShell { devShells.default = pkgs.devshell.mkShell {
packages = [ packages = [
inputs.home-manager.packages.${system}.default inputs.home-manager.packages.${system}.default
]; ];
}; };
} })));
))
);
} }

View File

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

File diff suppressed because it is too large Load Diff

View File

@ -1,25 +1,23 @@
{ {
pkgs, pkgs,
... ...
}: }: let
let packages = pkgs.callPackage ./packages.nix {};
packages = pkgs.callPackage ./packages.nix { }; in {
in
{
home.packages = packages.all; home.packages = packages.all;
home.sessionVariables = { home.sessionVariables = {
EDITOR = "vim"; # is overriden to nvim in vim.nix if needed EDITOR = "vim"; # is overriden to nvim in vim.nix if needed
WORDCHARS = "\${WORDCHARS//[\\/.=]/}"; # ctrl-w on paths without make angery WORDCHARS = "\${WORDCHARS//[\\/.=]/}"; # ctrl-w on paths without make angery
}; };
/* /*
# For some reason this doesn't play nice when using home manager config from inside # For some reason this doesn't play nice when using home manager config from inside
# a nixos configuration. # a nixos configuration.
nix = { nix = {
enable = true; enable = true;
package = pkgs.nix; package = pkgs.nix;
settings.experimental-features = "nix-command flakes"; settings.experimental-features = "nix-command flakes";
settings.max-jobs = "auto"; # Gotta go fast (build derivations in parallel) settings.max-jobs = "auto"; # Gotta go fast (build derivations in parallel)
}; };
*/ */
programs = { programs = {
home-manager.enable = true; home-manager.enable = true;
@ -57,6 +55,9 @@ in
# Don't honk at me constantly # Don't honk at me constantly
unsetopt beep unsetopt beep
''; '';
envExtra = ''
export FZF_DEFAULT_COMMAND='${pkgs.fd}/bin/fd --type f --strip-cwd-prefix'
'';
syntaxHighlighting.enable = true; syntaxHighlighting.enable = true;
plugins = [ plugins = [
{ {
@ -76,37 +77,30 @@ in
enable = true; enable = true;
settings = { settings = {
add_newline = false; add_newline = false;
direnv.disabled = false; format = "$username$hostname$shlvl$directory$git_branch$git_commit$git_state$git_metrics$git_status$hg_branch$docker_context$golang$kotlin$nodejs$python$rust$terraform$nix_shell$memory_usage$aws$gcloud$openstack$azure$env_var$crystal$custom$sudo$cmd_duration$line_break$jobs$status$shell$character";
format = "$all";
username.format = "[$user]($style) "; username.format = "[$user]($style) ";
hostname.format = "[$hostname]($style) "; hostname.format = "[$hostname]($style) ";
directory = { directory = {truncation_length = -1;};
truncation_length = -1;
};
git_branch.format = "[$symbol$branch]($style) "; git_branch.format = "[$symbol$branch]($style) ";
python.symbol = "py "; python.format = "[py \${pyenv_prefix}(\${version} )(\\($virtualenv\\) )]($style)";
nodejs.symbol = "js "; nodejs.format = "[js ($version )]($style)";
nix_shell.symbol = "nix "; nix_shell.format = "[nix $state( \\($name\\))]($style) ";
rust.symbol = "rs ";
direnv.symbol = "de ";
}; };
}; };
direnv = { direnv = {
enable = true; enable = true;
nix-direnv.enable = true; nix-direnv.enable = true;
config.global.warn_timeout = "30s";
}; };
fzf = { fzf = {
enable = true; enable = true;
defaultCommand = "${pkgs.fd}/bin/fd --type f"; defaultCommand = "${pkgs.ripgrep}/bin/rg --files";
fileWidgetCommand = "${pkgs.fd}/bin/fd --type f";
}; };
ssh = { ssh = {
enable = true; enable = true;
includes = [ "~/.ssh/config.local" ]; includes = ["~/.ssh/config.local"];
matchBlocks."*" = { matchBlocks."*" = {
user = "samw"; user = "samw";
serverAliveInterval = 30; serverAliveInterval = 30;

View File

@ -1,7 +1 @@
{ pkgs, ... }: {pkgs, ...}: {home.packages = with pkgs; [docker colima];}
{
home.packages = with pkgs; [
docker
colima
];
}

View File

@ -1,59 +1,48 @@
{ pkgs, ... }: {pkgs, ...}: {
{ home.packages = with pkgs; [ git-open tea ];
home.packages = with pkgs; [
git-open
tea
];
programs.delta = {
# Better diffs
enable = true;
enableGitIntegration = true;
options = {
line-numbers = true;
};
};
programs.git = { programs.git = {
enable = true; enable = true;
lfs.enable = true; lfs.enable = true;
settings = { userName = "Sam Willcocks";
user.name = "Sam Willcocks"; userEmail = "sam@wlcx.cc";
user.email = "sam@wlcx.cc";
alias = {
a = "add";
ap = "add -p";
br = "branch";
c = "commit";
ca = "commit --amend";
can = "commit --amend --no-edit";
cm = "commit -m";
co = "checkout";
d = "diff";
dc = "diff --cached";
l = "log";
lp = "log --patch";
p = "push";
pf = "push --force-with-lease";
r = "rebase";
rc = "rebase --continue";
ra = "rebase --autostash";
rai = "rebase --autostash --interactive";
rs = "restore --staged";
st = "status";
sw = "switch";
swc = "switch --create";
gone = ''! git fetch -p && git for-each-ref --format '%(refname:short) %(upstream:track)' awk '$2 == "[gone]" {print $1}' | xargs -r git branch -D''; delta = {
}; # Better diffs
enable = true;
options = {line-numbers = true;};
};
aliases = {
a = "add";
ap = "add -p";
br = "branch";
c = "commit";
ca = "commit --amend";
can = "commit --amend --no-edit";
cm = "commit -m";
co = "checkout";
d = "diff";
dc = "diff --cached";
l = "log";
lp = "log --patch";
p = "push";
pf = "push --force-with-lease";
r = "rebase";
rc = "rebase --continue";
ra = "rebase --autostash";
rai = "rebase --autostash --interactive";
rs = "restore --staged";
st = "status";
sw = "switch";
swc = "switch --create";
gone = ''
! git fetch -p && git for-each-ref --format '%(refname:short) %(upstream:track)' awk '$2 == "[gone]" {print $1}' | xargs -r git branch -D'';
};
extraConfig = {
branch.sort = "-committerdate"; branch.sort = "-committerdate";
push.default = "current"; push.default = "current";
init.defaultBranch = "main"; init.defaultBranch = "main";
merge = {
conflictStyle = "diff3";
mergiraf = {
name = "mergiraf";
driver = "${pkgs.mergiraf}/bin/mergiraf merge --git %O %A %B -s %S -x %X -y %Y -p %P -l %L";
};
};
}; };
includes = [ includes = [
# Always include local gitconfig if it's there # Always include local gitconfig if it's there

View File

@ -1,5 +1,4 @@
{ pkgs, lib, ... }: {pkgs, lib, ...}: {
{
programs.gpg = { programs.gpg = {
enable = true; enable = true;
mutableKeys = false; mutableKeys = false;
@ -20,7 +19,7 @@
]; ];
# make yubikey work on macos? lolgpg # make yubikey work on macos? lolgpg
# https://github.com/NixOS/nixpkgs/issues/155629 # https://github.com/NixOS/nixpkgs/issues/155629
scdaemonSettings = (lib.optionalAttrs pkgs.stdenv.isDarwin { disable-ccid = true; }); scdaemonSettings = (lib.optionalAttrs pkgs.stdenv.isDarwin {disable-ccid = true;});
}; };
# Shouldn't have an effect on macos, on linux we need to specify a pinentry # Shouldn't have an effect on macos, on linux we need to specify a pinentry

View File

@ -1,32 +0,0 @@
{ ... }:
{
programs.helix = {
enable = true;
settings = {
theme = "monokai_pro";
editor."soft-wrap".enable = true;
};
languages = {
language-server.basedpyright = {
command = "basedpyright-langserver";
args = [ "--stdio" ];
};
language = [
{
name = "python";
roots = [
"pyproject.toml"
"setup.py"
"poetry.lock"
".git"
];
language-servers = [
{
name = "basedpyright";
}
];
}
];
};
};
}

View File

@ -2,20 +2,14 @@
pkgs, pkgs,
lib, lib,
... ...
}: }: {
{
# Mac specific packages. # Mac specific packages.
# TODO: have this in a central packages place rather than here # TODO: have this in a central packages place rather than here
home.packages = with pkgs; [ home.packages = with pkgs; [pngpaste mypkgs.qrclip];
pngpaste
mypkgs.qrclip
];
# Use secretive for SSH agent # Use secretive for SSH agent
programs.ssh.matchBlocks.all = lib.mkIf pkgs.stdenv.isDarwin { programs.ssh.matchBlocks.all = lib.mkIf pkgs.stdenv.isDarwin {
host = "*"; host = "*";
extraOptions."IdentityAgent" = extraOptions."IdentityAgent" = "~/Library/Containers/com.maxgoedjen.Secretive.SecretAgent/Data/socket.ssh";
"~/Library/Containers/com.maxgoedjen.Secretive.SecretAgent/Data/socket.ssh";
}; };
programs.zsh.sessionVariables.SSH_AUTH_SOCK = "$HOME/Library/Containers/com.maxgoedjen.Secretive.SecretAgent/Data/socket.ssh";
programs.zsh.initExtra = "eval $(/opt/homebrew/bin/brew shellenv)"; programs.zsh.initExtra = "eval $(/opt/homebrew/bin/brew shellenv)";
} }

View File

@ -1,6 +1,5 @@
{ pkgs }: {pkgs}:
with pkgs; with pkgs; rec {
rec {
# The stuff you want installed everywhere. The necessities. # The stuff you want installed everywhere. The necessities.
base = [ base = [
bat # cat replacement, aliased to cat in home-manager bat # cat replacement, aliased to cat in home-manager
@ -13,28 +12,13 @@ rec {
unzip unzip
vim vim
wget wget
helix
]; ];
# Networking shit # Networking shit
net = [ net = [dig iperf3 nmap socat tcpdump whois];
dig
iperf3
mtr
nmap
socat
tcpdump
];
# development tools # development tools
dev = [ dev = [jq nixfmt gh glab hexyl helix];
jq
nixfmt-rfc-style
gh
glab
hexyl
attic-client
];
all = base ++ net ++ dev; all = base ++ net ++ dev;
} }

View File

@ -1,12 +1,9 @@
{ pkgs, ... }: {pkgs, ...}: {
{ home.packages = with pkgs; [yubikey-manager];
home.packages = with pkgs; [ yubikey-manager ];
programs.password-store = { programs.password-store = {
enable = true; enable = true;
settings = { settings = {PASSWORD_STORE_DIR = "$HOME/.password-store";};
PASSWORD_STORE_DIR = "$HOME/.password-store"; package = pkgs.pass.withExtensions (exts: [exts.pass-otp]);
};
package = pkgs.pass.withExtensions (exts: [ exts.pass-otp ]);
}; };
programs.zsh.shellAliases = { programs.zsh.shellAliases = {
p = "pass"; p = "pass";

View File

@ -2,33 +2,22 @@
# The basics that you'll want everywhere # The basics that you'll want everywhere
default = ./default.nix; default = ./default.nix;
# A machine for development # A machine for development
dev = dev = {...}: {
{ ... }: imports = [./git.nix ./vim.nix ./vim-dev];
{ };
imports = [
./git.nix
./vim.nix
./vim-dev
./helix.nix
];
};
# A machine for dev with a GUI # A machine for dev with a GUI
# TODO: detect this automatically somehow? # TODO: detect this automatically somehow?
dev-gui = dev-gui = {...}: {
{ ... }: imports = [./vscode.nix];
{ };
imports = [ ./vscode.nix ];
};
tpmssh = ./tpmssh.nix; tpmssh = ./tpmssh.nix;
# Sensitive stuff # Sensitive stuff
sensitive = sensitive = {...}: {
{ ... }: imports = [
{ ./passwords.nix
imports = [ ./gpg.nix
./passwords.nix ];
./gpg.nix };
];
};
# A MacOS machine # A MacOS machine
mac = ./macs.nix; mac = ./macs.nix;
# A machine you want to do docker stuff on # A machine you want to do docker stuff on
@ -36,13 +25,5 @@
# A machine you want to do aws stuff on # A machine you want to do aws stuff on
aws = ./aws.nix; aws = ./aws.nix;
# A server # A server
server = server = {...}: {imports = [./default.nix ./git.nix ./vim.nix];};
{ ... }:
{
imports = [
./default.nix
./git.nix
./vim.nix
];
};
} }

View File

@ -1,6 +1,5 @@
# Enable tpm-ssh-agent in a systemd user service # Enable tpm-ssh-agent in a systemd user service
{ pkgs, config, ... }: {pkgs, config, ...}: {
{
home.packages = [ pkgs.ssh-tpm-agent ]; home.packages = [ pkgs.ssh-tpm-agent ];
home.sessionVariables = { home.sessionVariables = {
SSH_AUTH_SOCK = "$(${pkgs.ssh-tpm-agent}/bin/ssh-tpm-agent --print-socket)"; SSH_AUTH_SOCK = "$(${pkgs.ssh-tpm-agent}/bin/ssh-tpm-agent --print-socket)";
@ -23,18 +22,11 @@
Environment = '' Environment = ''
SSH_AUTH_SOCK="%t/ssh-tpm-agent.sock" SSH_AUTH_SOCK="%t/ssh-tpm-agent.sock"
''; '';
ExecStart = "${ ExecStart = "${pkgs.writeShellScriptBin "start-ssh-tpm-agent" (if config.services.gpg-agent.enableSshSupport then ''
pkgs.writeShellScriptBin "start-ssh-tpm-agent" ( ${pkgs.ssh-tpm-agent}/bin/ssh-tpm-agent -A $(${config.programs.gpg.package}/bin/gpgconf --list-dirs agent-ssh-socket)
if config.services.gpg-agent.enableSshSupport then '' else ''
'' ${pkgs.ssh-tpm-agent}/bin/ssh-tpm-agent
${pkgs.ssh-tpm-agent}/bin/ssh-tpm-agent -A $(${config.programs.gpg.package}/bin/gpgconf --list-dirs agent-ssh-socket) '')}/bin/start-ssh-tpm-agent";
''
else
''
${pkgs.ssh-tpm-agent}/bin/ssh-tpm-agent
''
)
}/bin/start-ssh-tpm-agent";
PassEnvironment = "SSH_AGENT_PID"; PassEnvironment = "SSH_AGENT_PID";
SuccessExitStatus = 2; SuccessExitStatus = 2;
Type = "simple"; Type = "simple";

View File

@ -3,19 +3,14 @@
lib, lib,
system, system,
... ...
}: }: {
{ home.packages = with pkgs; [nil];
home.packages = with pkgs; [ programs.neovim.plugins = with pkgs.vimPlugins;
nil
nixd
];
programs.neovim.plugins =
with pkgs.vimPlugins;
[ [
# More fancy shit # More fancy shit
nvim-treesitter nvim-treesitter
trouble-nvim trouble-nvim
# Language server/completions # Language server/completions
nvim-lspconfig nvim-lspconfig
nvim-cmp nvim-cmp
cmp-nvim-lsp cmp-nvim-lsp
@ -37,7 +32,7 @@
] ]
# delve is unsupported on aarch64-linux and golangci-lint is broken on darwin # delve is unsupported on aarch64-linux and golangci-lint is broken on darwin
# (see https://github.com/NixOS/nixpkgs/issues/168984). # (see https://github.com/NixOS/nixpkgs/issues/168984).
++ lib.optionals (system != "aarch64-linux" && !pkgs.stdenv.isDarwin) [ vim-go ]; ++ lib.optionals (system != "aarch64-linux" && !pkgs.stdenv.isDarwin) [vim-go];
programs.neovim.extraConfig = '' programs.neovim.extraConfig = ''
lua <<EOF lua <<EOF
${builtins.readFile ./dev.lua} ${builtins.readFile ./dev.lua}

View File

@ -54,10 +54,6 @@ require'lspconfig'.nil_ls.setup{
on_attach = on_attach, on_attach = on_attach,
capabilities = capabilities, capabilities = capabilities,
} }
require'lspconfig'.nixd.setup{
on_attach = on_attach,
capabilities = capabilities,
}
require'lspconfig'.rust_analyzer.setup{ require'lspconfig'.rust_analyzer.setup{
on_attach = on_attach, on_attach = on_attach,
capabilities = capabilities, capabilities = capabilities,
@ -75,13 +71,6 @@ require'lspconfig'.rust_analyzer.setup{
description = 'Open documentation for the symbol under the cursor in default browser', description = 'Open documentation for the symbol under the cursor in default browser',
}, },
}, },
settings = {
["rust-analyzer"] = {
procMacro = {
enable = false,
},
},
},
} }
require'lspconfig'.dhall_lsp_server.setup{ require'lspconfig'.dhall_lsp_server.setup{
on_attach = on_attach, on_attach = on_attach,

View File

@ -4,10 +4,9 @@
pkgs, pkgs,
lib, lib,
... ...
}: }: {
{
home.sessionVariables.EDITOR = lib.mkForce "nvim"; home.sessionVariables.EDITOR = lib.mkForce "nvim";
home.packages = with pkgs; [ ripgrep ]; home.packages = with pkgs; [ripgrep];
programs.neovim = { programs.neovim = {
enable = true; enable = true;
viAlias = true; viAlias = true;
@ -27,7 +26,7 @@
vim-gitgutter vim-gitgutter
# More stuff idk # More stuff idk
emmet-vim emmet-vim
vim-sleuth # guess whitespace settings from file vim-sleuth # guess whitespace settings from file
]; ];
extraConfig = '' extraConfig = ''
lua <<EOF lua <<EOF

View File

@ -1,22 +1,19 @@
{ pkgs, ... }: {pkgs, ...}: {
{
programs.vscode = { programs.vscode = {
enable = true; enable = true;
package = pkgs.vscodium; package = pkgs.vscodium;
mutableExtensionsDir = false; mutableExtensionsDir = false;
profiles.default.extensions = with pkgs.vscode-extensions; [ extensions = with pkgs.vscode-extensions; [
rust-lang.rust-analyzer matklad.rust-analyzer
jdinhlife.gruvbox jdinhlife.gruvbox
jnoortheen.nix-ide jnoortheen.nix-ide
editorconfig.editorconfig editorconfig.editorconfig
]; ];
profiles.default.userSettings = { userSettings = {
"update.mode" = "none"; "update.mode" = "none";
"window.autoDetectColorScheme" = true; "window.autoDetectColorScheme" = true;
"workbench.preferredDarkColorTheme" = "Gruvbox Dark Hard"; "workbench.preferredDarkColorTheme" = "Gruvbox Dark Hard";
"workbench.preferredLightColorTheme" = "Gruvbox Light Hard";
"files.trimTrailingWhitespace" = true; "files.trimTrailingWhitespace" = true;
"emmet.includeLanguages"."django-html" = "html";
# Don't try to write to the nix-managed .ssh/config # Don't try to write to the nix-managed .ssh/config
"remote.SSH.configFile" = "~/.ssh/config.local"; "remote.SSH.configFile" = "~/.ssh/config.local";
"editor.rulers" = [ 90 ]; "editor.rulers" = [ 90 ];

View File

@ -1,5 +1,4 @@
# TODO: auto import everything # TODO: auto import everything
{ pkgs, ... }: {pkgs, ...}: {
{ qrclip = pkgs.callPackage ./qrclip {};
qrclip = pkgs.callPackage ./qrclip { };
} }

View File

@ -2,14 +2,11 @@
pkgs, pkgs,
lib, lib,
stdenv, stdenv,
}: }: let
let zbar = pkgs.zbar.override {enableVideo = false;};
zbar = pkgs.zbar.override { enableVideo = false; };
in in
(pkgs.writeShellScriptBin "qrclip" '' (pkgs.writeShellScriptBin "qrclip" ''
set -eo pipefail set -eo pipefail
${pkgs.pngpaste}/bin/pngpaste - | ${zbar}/bin/zbarimg --raw -q1 - ${pkgs.pngpaste}/bin/pngpaste - | ${zbar}/bin/zbarimg --raw -q1 -
'') '')
// { // {meta.platforms = lib.platforms.darwin;}
meta.platforms = lib.platforms.darwin;
}