mirror of
https://github.com/wlcx/home.git
synced 2025-12-08 19:43:46 +00:00
Compare commits
15 Commits
6e55465310
...
aebb5dcd08
| Author | SHA1 | Date | |
|---|---|---|---|
| aebb5dcd08 | |||
| 7a1df05022 | |||
| 97d3c6f0af | |||
| c4953a227a | |||
| 84d4741d98 | |||
| 924177bd4c | |||
| b15ba6c14c | |||
| d90384b2de | |||
| 31b30027ce | |||
| 7c56f42779 | |||
| ef681a3ba8 | |||
| cee2d8e6bc | |||
| b3fedf3584 | |||
| 1e8b5ebb0d | |||
| f89e0bcec7 |
37
flake.lock
generated
37
flake.lock
generated
@ -2,19 +2,16 @@
|
||||
"nodes": {
|
||||
"devshell": {
|
||||
"inputs": {
|
||||
"flake-utils": [
|
||||
"flake-utils"
|
||||
],
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1713532798,
|
||||
"narHash": "sha256-wtBhsdMJA3Wa32Wtm1eeo84GejtI43pMrFrmwLXrsEc=",
|
||||
"lastModified": 1764011051,
|
||||
"narHash": "sha256-M7SZyPZiqZUR/EiiBJnmyUbOi5oE/03tCeFrTiUZchI=",
|
||||
"owner": "numtide",
|
||||
"repo": "devshell",
|
||||
"rev": "12e914740a25ea1891ec619bb53cf5e6ca922e40",
|
||||
"rev": "17ed8d9744ebe70424659b0ef74ad6d41fc87071",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@ -28,11 +25,11 @@
|
||||
"systems": "systems"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1710146030,
|
||||
"narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
|
||||
"lastModified": 1731533236,
|
||||
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
|
||||
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@ -48,43 +45,43 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1756245065,
|
||||
"narHash": "sha256-aAZNbGcWrVRZgWgkQbkabSGcDVRDMgON4BipMy69gvI=",
|
||||
"lastModified": 1764866045,
|
||||
"narHash": "sha256-0GsEtXV9OquDQ1VclQfP16cU5VZh7NEVIOjSH4UaJuM=",
|
||||
"owner": "nix-community",
|
||||
"repo": "home-manager",
|
||||
"rev": "54b2879ce622d44415e727905925e21b8f833a98",
|
||||
"rev": "f63d0fe9d81d36e5fc95497217a72e02b8b7bcab",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-community",
|
||||
"ref": "release-25.05",
|
||||
"ref": "release-25.11",
|
||||
"repo": "home-manager",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1756494058,
|
||||
"narHash": "sha256-Yxg5zKIM450FAq7ihT6wkbuJ+Fl3KjbSpPjwFhSgMGc=",
|
||||
"lastModified": 1764831616,
|
||||
"narHash": "sha256-OtzF5wBvO0jgW1WW1rQU9cMGx7zuvkF7CAVJ1ypzkxA=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "2788026c663a210beeb81e85f93ca5e86243fb3c",
|
||||
"rev": "c97c47f2bac4fa59e2cbdeba289686ae615f8ed4",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nixos",
|
||||
"ref": "release-25.05",
|
||||
"ref": "nixos-25.11",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs-unstable": {
|
||||
"locked": {
|
||||
"lastModified": 1713995654,
|
||||
"narHash": "sha256-S+4C0H9w7H9tSv1RviD/otsTmf1ECuxJMJ/j1t9gjPE=",
|
||||
"lastModified": 1764951420,
|
||||
"narHash": "sha256-oLJXP0fb5hyUvHGKAWdtjhl1/4ivxXy3HsuMMTTxrd8=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "ce6da85c2dc9e659bef799c2ed053771e1bb8ee3",
|
||||
"rev": "0b784f7c32b9bbab8a599ccc6b4acc58f42d6f4f",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
||||
231
flake.nix
231
flake.nix
@ -2,106 +2,157 @@
|
||||
description = "Samw's home environment, as managed by nix/home-manager.";
|
||||
inputs = {
|
||||
# Nixpkgs
|
||||
nixpkgs = {url = "github:nixos/nixpkgs/release-25.05";};
|
||||
nixpkgs-unstable = {url = "github:nixos/nixpkgs";};
|
||||
nixpkgs = {
|
||||
# N.B. we use the nixos-x branch as this is updated *after* successful hydra builds
|
||||
# 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
|
||||
home-manager = {
|
||||
url = "github:nix-community/home-manager/release-25.05";
|
||||
url = "github:nix-community/home-manager/release-25.11";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
flake-utils.url = "github:numtide/flake-utils";
|
||||
devshell = {
|
||||
url = "github:numtide/devshell";
|
||||
inputs.flake-utils.follows = "flake-utils";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
};
|
||||
outputs = inputs: let
|
||||
overlays = [
|
||||
# Add our own local packages
|
||||
(final: prev: {
|
||||
# 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: {
|
||||
ssh-tpm-agent = (import inputs.nixpkgs-unstable { system = prev.system; }).ssh-tpm-agent;
|
||||
})
|
||||
];
|
||||
in (rec {
|
||||
profiles = import ./home/profiles.nix;
|
||||
lib = {
|
||||
mkHome = {
|
||||
profiles,
|
||||
system,
|
||||
username ? "samw",
|
||||
}:
|
||||
inputs.home-manager.lib.homeManagerConfiguration {
|
||||
pkgs = (import inputs.nixpkgs {
|
||||
inherit system;
|
||||
config.allowUnfree = true; # Yes I know it's bad for me
|
||||
});
|
||||
modules = [
|
||||
{ home = {
|
||||
inherit username;
|
||||
homeDirectory =
|
||||
if (inputs.nixpkgs.lib.systems.elaborate system).isDarwin
|
||||
then "/Users/${username}"
|
||||
else "/home/${username}";
|
||||
stateVersion = "21.11";
|
||||
};}] ++ profiles ++ [
|
||||
{nixpkgs.overlays = overlays;}
|
||||
# See comment in home/default.nix.
|
||||
({ pkgs, ... }: {
|
||||
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;
|
||||
};
|
||||
})
|
||||
];
|
||||
extraSpecialArgs = {inherit system;};
|
||||
};
|
||||
};
|
||||
outputs =
|
||||
inputs:
|
||||
let
|
||||
overlays = [
|
||||
# Add our own local packages
|
||||
(final: prev: {
|
||||
# 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: {
|
||||
ssh-tpm-agent = (import inputs.nixpkgs-unstable { system = prev.system; }).ssh-tpm-agent;
|
||||
})
|
||||
];
|
||||
in
|
||||
(
|
||||
rec {
|
||||
profiles = import ./home/profiles.nix;
|
||||
lib = {
|
||||
mkHome =
|
||||
{
|
||||
profiles,
|
||||
system,
|
||||
username ? "samw",
|
||||
}:
|
||||
inputs.home-manager.lib.homeManagerConfiguration {
|
||||
pkgs = (
|
||||
import inputs.nixpkgs {
|
||||
inherit system;
|
||||
config.allowUnfree = true; # Yes I know it's bad for me
|
||||
}
|
||||
);
|
||||
modules = [
|
||||
{
|
||||
home = {
|
||||
inherit username;
|
||||
homeDirectory =
|
||||
if (inputs.nixpkgs.lib.systems.elaborate system).isDarwin then
|
||||
"/Users/${username}"
|
||||
else
|
||||
"/home/${username}";
|
||||
stateVersion = "21.11";
|
||||
};
|
||||
}
|
||||
]
|
||||
++ profiles
|
||||
++ [
|
||||
{ nixpkgs.overlays = overlays; }
|
||||
# See comment in home/default.nix.
|
||||
(
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
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
|
||||
homeConfigurations = {
|
||||
zinc = lib.mkHome {
|
||||
system = "aarch64-darwin";
|
||||
profiles = with profiles; [default dev dev-gui sensitive mac];
|
||||
# Standalone home-manager configurations
|
||||
homeConfigurations = {
|
||||
zinc = lib.mkHome {
|
||||
system = "aarch64-darwin";
|
||||
profiles = with profiles; [
|
||||
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 {
|
||||
system = "x86_64-linux";
|
||||
profiles = with profiles; [default dev];
|
||||
};
|
||||
};
|
||||
}
|
||||
# Per-system things
|
||||
// (inputs.flake-utils.lib.eachDefaultSystem (system: let
|
||||
pkgs = import inputs.nixpkgs {
|
||||
inherit system;
|
||||
overlays = overlays ++ [inputs.devshell.overlays.default];
|
||||
};
|
||||
platform = pkgs.lib.systems.elaborate system;
|
||||
in {
|
||||
# Flake interface to my local packages.
|
||||
# - `callPackage` puts some junk in mypkgs (`override` and
|
||||
# `overrideDerivation`) so we filter out anything that isn't a derivation
|
||||
# - We also filter out any packages that aren't supported on the current
|
||||
# platform.
|
||||
packages = with pkgs.lib; (filterAttrs (_: v: (isDerivation v && meta.availableOn platform v)) pkgs.mypkgs);
|
||||
formatter = pkgs.alejandra;
|
||||
# A devshell with useful utils
|
||||
devShells.default = pkgs.devshell.mkShell {
|
||||
packages = [
|
||||
inputs.home-manager.packages.${system}.default
|
||||
];
|
||||
};
|
||||
})));
|
||||
}
|
||||
# Per-system things
|
||||
// (inputs.flake-utils.lib.eachDefaultSystem (
|
||||
system:
|
||||
let
|
||||
pkgs = import inputs.nixpkgs {
|
||||
inherit system;
|
||||
overlays = overlays ++ [ inputs.devshell.overlays.default ];
|
||||
};
|
||||
platform = pkgs.lib.systems.elaborate system;
|
||||
in
|
||||
{
|
||||
# Flake interface to my local packages.
|
||||
# - `callPackage` puts some junk in mypkgs (`override` and
|
||||
# `overrideDerivation`) so we filter out anything that isn't a derivation
|
||||
# - We also filter out any packages that aren't supported on the current
|
||||
# platform.
|
||||
packages =
|
||||
with pkgs.lib;
|
||||
(filterAttrs (_: v: (isDerivation v && meta.availableOn platform v)) pkgs.mypkgs);
|
||||
formatter = pkgs.nixfmt-tree;
|
||||
# A devshell with useful utils
|
||||
devShells.default = pkgs.devshell.mkShell {
|
||||
packages = [
|
||||
inputs.home-manager.packages.${system}.default
|
||||
];
|
||||
};
|
||||
}
|
||||
))
|
||||
);
|
||||
}
|
||||
|
||||
@ -1 +1,4 @@
|
||||
{pkgs, ...}: {home.packages = with pkgs; [awscli2];}
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
home.packages = with pkgs; [ awscli2 ];
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,23 +1,25 @@
|
||||
{
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
packages = pkgs.callPackage ./packages.nix {};
|
||||
in {
|
||||
}:
|
||||
let
|
||||
packages = pkgs.callPackage ./packages.nix { };
|
||||
in
|
||||
{
|
||||
home.packages = packages.all;
|
||||
home.sessionVariables = {
|
||||
EDITOR = "vim"; # is overriden to nvim in vim.nix if needed
|
||||
WORDCHARS = "\${WORDCHARS//[\\/.=]/}"; # ctrl-w on paths without make angery
|
||||
};
|
||||
/*
|
||||
# For some reason this doesn't play nice when using home manager config from inside
|
||||
# a nixos configuration.
|
||||
nix = {
|
||||
enable = true;
|
||||
package = pkgs.nix;
|
||||
settings.experimental-features = "nix-command flakes";
|
||||
settings.max-jobs = "auto"; # Gotta go fast (build derivations in parallel)
|
||||
};
|
||||
# For some reason this doesn't play nice when using home manager config from inside
|
||||
# a nixos configuration.
|
||||
nix = {
|
||||
enable = true;
|
||||
package = pkgs.nix;
|
||||
settings.experimental-features = "nix-command flakes";
|
||||
settings.max-jobs = "auto"; # Gotta go fast (build derivations in parallel)
|
||||
};
|
||||
*/
|
||||
programs = {
|
||||
home-manager.enable = true;
|
||||
@ -55,9 +57,6 @@ in {
|
||||
# Don't honk at me constantly
|
||||
unsetopt beep
|
||||
'';
|
||||
envExtra = ''
|
||||
export FZF_DEFAULT_COMMAND='${pkgs.fd}/bin/fd --type f --strip-cwd-prefix'
|
||||
'';
|
||||
syntaxHighlighting.enable = true;
|
||||
plugins = [
|
||||
{
|
||||
@ -77,30 +76,37 @@ in {
|
||||
enable = true;
|
||||
settings = {
|
||||
add_newline = 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";
|
||||
direnv.disabled = false;
|
||||
format = "$all";
|
||||
username.format = "[$user]($style) ";
|
||||
hostname.format = "[$hostname]($style) ";
|
||||
directory = {truncation_length = -1;};
|
||||
directory = {
|
||||
truncation_length = -1;
|
||||
};
|
||||
git_branch.format = "[$symbol$branch]($style) ";
|
||||
python.format = "[py \${pyenv_prefix}(\${version} )(\\($virtualenv\\) )]($style)";
|
||||
nodejs.format = "[js ($version )]($style)";
|
||||
nix_shell.format = "[nix $state( \\($name\\))]($style) ";
|
||||
python.symbol = "py ";
|
||||
nodejs.symbol = "js ";
|
||||
nix_shell.symbol = "nix ";
|
||||
rust.symbol = "rs ";
|
||||
direnv.symbol = "de ";
|
||||
};
|
||||
};
|
||||
|
||||
direnv = {
|
||||
enable = true;
|
||||
nix-direnv.enable = true;
|
||||
config.global.warn_timeout = "30s";
|
||||
};
|
||||
|
||||
fzf = {
|
||||
enable = true;
|
||||
defaultCommand = "${pkgs.ripgrep}/bin/rg --files";
|
||||
defaultCommand = "${pkgs.fd}/bin/fd --type f";
|
||||
fileWidgetCommand = "${pkgs.fd}/bin/fd --type f";
|
||||
};
|
||||
|
||||
ssh = {
|
||||
enable = true;
|
||||
includes = ["~/.ssh/config.local"];
|
||||
includes = [ "~/.ssh/config.local" ];
|
||||
matchBlocks."*" = {
|
||||
user = "samw";
|
||||
serverAliveInterval = 30;
|
||||
|
||||
@ -1 +1,7 @@
|
||||
{pkgs, ...}: {home.packages = with pkgs; [docker colima];}
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
home.packages = with pkgs; [
|
||||
docker
|
||||
colima
|
||||
];
|
||||
}
|
||||
|
||||
87
home/git.nix
87
home/git.nix
@ -1,48 +1,59 @@
|
||||
{pkgs, ...}: {
|
||||
home.packages = with pkgs; [ git-open tea ];
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
home.packages = with pkgs; [
|
||||
git-open
|
||||
tea
|
||||
];
|
||||
programs.delta = {
|
||||
# Better diffs
|
||||
enable = true;
|
||||
enableGitIntegration = true;
|
||||
options = {
|
||||
line-numbers = true;
|
||||
};
|
||||
};
|
||||
programs.git = {
|
||||
enable = true;
|
||||
lfs.enable = true;
|
||||
userName = "Sam Willcocks";
|
||||
userEmail = "sam@wlcx.cc";
|
||||
settings = {
|
||||
user.name = "Sam Willcocks";
|
||||
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";
|
||||
|
||||
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 = {
|
||||
gone = ''! git fetch -p && git for-each-ref --format '%(refname:short) %(upstream:track)' │ awk '$2 == "[gone]" {print $1}' | xargs -r git branch -D'';
|
||||
};
|
||||
branch.sort = "-committerdate";
|
||||
push.default = "current";
|
||||
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 = [
|
||||
# Always include local gitconfig if it's there
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
{pkgs, lib, ...}: {
|
||||
{ pkgs, lib, ... }:
|
||||
{
|
||||
programs.gpg = {
|
||||
enable = true;
|
||||
mutableKeys = false;
|
||||
@ -19,7 +20,7 @@
|
||||
];
|
||||
# make yubikey work on macos? lolgpg
|
||||
# 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
|
||||
|
||||
32
home/helix.nix
Normal file
32
home/helix.nix
Normal file
@ -0,0 +1,32 @@
|
||||
{ ... }:
|
||||
{
|
||||
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";
|
||||
}
|
||||
];
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
@ -2,14 +2,20 @@
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
}:
|
||||
{
|
||||
# Mac specific packages.
|
||||
# TODO: have this in a central packages place rather than here
|
||||
home.packages = with pkgs; [pngpaste mypkgs.qrclip];
|
||||
home.packages = with pkgs; [
|
||||
pngpaste
|
||||
mypkgs.qrclip
|
||||
];
|
||||
# Use secretive for SSH agent
|
||||
programs.ssh.matchBlocks.all = lib.mkIf pkgs.stdenv.isDarwin {
|
||||
host = "*";
|
||||
extraOptions."IdentityAgent" = "~/Library/Containers/com.maxgoedjen.Secretive.SecretAgent/Data/socket.ssh";
|
||||
extraOptions."IdentityAgent" =
|
||||
"~/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)";
|
||||
}
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
{pkgs}:
|
||||
with pkgs; rec {
|
||||
{ pkgs }:
|
||||
with pkgs;
|
||||
rec {
|
||||
# The stuff you want installed everywhere. The necessities.
|
||||
base = [
|
||||
bat # cat replacement, aliased to cat in home-manager
|
||||
@ -12,13 +13,28 @@ with pkgs; rec {
|
||||
unzip
|
||||
vim
|
||||
wget
|
||||
helix
|
||||
];
|
||||
|
||||
# Networking shit
|
||||
net = [dig iperf3 nmap socat tcpdump whois];
|
||||
net = [
|
||||
dig
|
||||
iperf3
|
||||
mtr
|
||||
nmap
|
||||
socat
|
||||
tcpdump
|
||||
];
|
||||
|
||||
# development tools
|
||||
dev = [jq nixfmt gh glab hexyl helix];
|
||||
dev = [
|
||||
jq
|
||||
nixfmt-rfc-style
|
||||
gh
|
||||
glab
|
||||
hexyl
|
||||
attic-client
|
||||
];
|
||||
|
||||
all = base ++ net ++ dev;
|
||||
}
|
||||
|
||||
@ -1,9 +1,12 @@
|
||||
{pkgs, ...}: {
|
||||
home.packages = with pkgs; [yubikey-manager];
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
home.packages = with pkgs; [ yubikey-manager ];
|
||||
programs.password-store = {
|
||||
enable = true;
|
||||
settings = {PASSWORD_STORE_DIR = "$HOME/.password-store";};
|
||||
package = pkgs.pass.withExtensions (exts: [exts.pass-otp]);
|
||||
settings = {
|
||||
PASSWORD_STORE_DIR = "$HOME/.password-store";
|
||||
};
|
||||
package = pkgs.pass.withExtensions (exts: [ exts.pass-otp ]);
|
||||
};
|
||||
programs.zsh.shellAliases = {
|
||||
p = "pass";
|
||||
|
||||
@ -2,22 +2,33 @@
|
||||
# The basics that you'll want everywhere
|
||||
default = ./default.nix;
|
||||
# A machine for development
|
||||
dev = {...}: {
|
||||
imports = [./git.nix ./vim.nix ./vim-dev];
|
||||
};
|
||||
dev =
|
||||
{ ... }:
|
||||
{
|
||||
imports = [
|
||||
./git.nix
|
||||
./vim.nix
|
||||
./vim-dev
|
||||
./helix.nix
|
||||
];
|
||||
};
|
||||
# A machine for dev with a GUI
|
||||
# TODO: detect this automatically somehow?
|
||||
dev-gui = {...}: {
|
||||
imports = [./vscode.nix];
|
||||
};
|
||||
dev-gui =
|
||||
{ ... }:
|
||||
{
|
||||
imports = [ ./vscode.nix ];
|
||||
};
|
||||
tpmssh = ./tpmssh.nix;
|
||||
# Sensitive stuff
|
||||
sensitive = {...}: {
|
||||
imports = [
|
||||
./passwords.nix
|
||||
./gpg.nix
|
||||
];
|
||||
};
|
||||
sensitive =
|
||||
{ ... }:
|
||||
{
|
||||
imports = [
|
||||
./passwords.nix
|
||||
./gpg.nix
|
||||
];
|
||||
};
|
||||
# A MacOS machine
|
||||
mac = ./macs.nix;
|
||||
# A machine you want to do docker stuff on
|
||||
@ -25,5 +36,13 @@
|
||||
# A machine you want to do aws stuff on
|
||||
aws = ./aws.nix;
|
||||
# A server
|
||||
server = {...}: {imports = [./default.nix ./git.nix ./vim.nix];};
|
||||
server =
|
||||
{ ... }:
|
||||
{
|
||||
imports = [
|
||||
./default.nix
|
||||
./git.nix
|
||||
./vim.nix
|
||||
];
|
||||
};
|
||||
}
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
# Enable tpm-ssh-agent in a systemd user service
|
||||
{pkgs, config, ...}: {
|
||||
{ pkgs, config, ... }:
|
||||
{
|
||||
home.packages = [ pkgs.ssh-tpm-agent ];
|
||||
home.sessionVariables = {
|
||||
SSH_AUTH_SOCK = "$(${pkgs.ssh-tpm-agent}/bin/ssh-tpm-agent --print-socket)";
|
||||
@ -22,11 +23,18 @@
|
||||
Environment = ''
|
||||
SSH_AUTH_SOCK="%t/ssh-tpm-agent.sock"
|
||||
'';
|
||||
ExecStart = "${pkgs.writeShellScriptBin "start-ssh-tpm-agent" (if config.services.gpg-agent.enableSshSupport then ''
|
||||
${pkgs.ssh-tpm-agent}/bin/ssh-tpm-agent -A $(${config.programs.gpg.package}/bin/gpgconf --list-dirs agent-ssh-socket)
|
||||
'' else ''
|
||||
${pkgs.ssh-tpm-agent}/bin/ssh-tpm-agent
|
||||
'')}/bin/start-ssh-tpm-agent";
|
||||
ExecStart = "${
|
||||
pkgs.writeShellScriptBin "start-ssh-tpm-agent" (
|
||||
if config.services.gpg-agent.enableSshSupport then
|
||||
''
|
||||
${pkgs.ssh-tpm-agent}/bin/ssh-tpm-agent -A $(${config.programs.gpg.package}/bin/gpgconf --list-dirs agent-ssh-socket)
|
||||
''
|
||||
else
|
||||
''
|
||||
${pkgs.ssh-tpm-agent}/bin/ssh-tpm-agent
|
||||
''
|
||||
)
|
||||
}/bin/start-ssh-tpm-agent";
|
||||
PassEnvironment = "SSH_AGENT_PID";
|
||||
SuccessExitStatus = 2;
|
||||
Type = "simple";
|
||||
|
||||
@ -3,9 +3,14 @@
|
||||
lib,
|
||||
system,
|
||||
...
|
||||
}: {
|
||||
home.packages = with pkgs; [nil];
|
||||
programs.neovim.plugins = with pkgs.vimPlugins;
|
||||
}:
|
||||
{
|
||||
home.packages = with pkgs; [
|
||||
nil
|
||||
nixd
|
||||
];
|
||||
programs.neovim.plugins =
|
||||
with pkgs.vimPlugins;
|
||||
[
|
||||
# More fancy shit
|
||||
nvim-treesitter
|
||||
@ -32,7 +37,7 @@
|
||||
]
|
||||
# delve is unsupported on aarch64-linux and golangci-lint is broken on darwin
|
||||
# (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 = ''
|
||||
lua <<EOF
|
||||
${builtins.readFile ./dev.lua}
|
||||
|
||||
@ -54,6 +54,10 @@ require'lspconfig'.nil_ls.setup{
|
||||
on_attach = on_attach,
|
||||
capabilities = capabilities,
|
||||
}
|
||||
require'lspconfig'.nixd.setup{
|
||||
on_attach = on_attach,
|
||||
capabilities = capabilities,
|
||||
}
|
||||
require'lspconfig'.rust_analyzer.setup{
|
||||
on_attach = on_attach,
|
||||
capabilities = capabilities,
|
||||
@ -71,6 +75,13 @@ require'lspconfig'.rust_analyzer.setup{
|
||||
description = 'Open documentation for the symbol under the cursor in default browser',
|
||||
},
|
||||
},
|
||||
settings = {
|
||||
["rust-analyzer"] = {
|
||||
procMacro = {
|
||||
enable = false,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
require'lspconfig'.dhall_lsp_server.setup{
|
||||
on_attach = on_attach,
|
||||
|
||||
@ -4,9 +4,10 @@
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
}:
|
||||
{
|
||||
home.sessionVariables.EDITOR = lib.mkForce "nvim";
|
||||
home.packages = with pkgs; [ripgrep];
|
||||
home.packages = with pkgs; [ ripgrep ];
|
||||
programs.neovim = {
|
||||
enable = true;
|
||||
viAlias = true;
|
||||
@ -26,7 +27,7 @@
|
||||
vim-gitgutter
|
||||
# More stuff idk
|
||||
emmet-vim
|
||||
vim-sleuth # guess whitespace settings from file
|
||||
vim-sleuth # guess whitespace settings from file
|
||||
];
|
||||
extraConfig = ''
|
||||
lua <<EOF
|
||||
|
||||
@ -1,19 +1,22 @@
|
||||
{pkgs, ...}: {
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
programs.vscode = {
|
||||
enable = true;
|
||||
package = pkgs.vscodium;
|
||||
mutableExtensionsDir = false;
|
||||
extensions = with pkgs.vscode-extensions; [
|
||||
matklad.rust-analyzer
|
||||
profiles.default.extensions = with pkgs.vscode-extensions; [
|
||||
rust-lang.rust-analyzer
|
||||
jdinhlife.gruvbox
|
||||
jnoortheen.nix-ide
|
||||
editorconfig.editorconfig
|
||||
];
|
||||
userSettings = {
|
||||
profiles.default.userSettings = {
|
||||
"update.mode" = "none";
|
||||
"window.autoDetectColorScheme" = true;
|
||||
"workbench.preferredDarkColorTheme" = "Gruvbox Dark Hard";
|
||||
"workbench.preferredLightColorTheme" = "Gruvbox Light Hard";
|
||||
"files.trimTrailingWhitespace" = true;
|
||||
"emmet.includeLanguages"."django-html" = "html";
|
||||
# Don't try to write to the nix-managed .ssh/config
|
||||
"remote.SSH.configFile" = "~/.ssh/config.local";
|
||||
"editor.rulers" = [ 90 ];
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
# TODO: auto import everything
|
||||
{pkgs, ...}: {
|
||||
qrclip = pkgs.callPackage ./qrclip {};
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
qrclip = pkgs.callPackage ./qrclip { };
|
||||
}
|
||||
|
||||
@ -2,11 +2,14 @@
|
||||
pkgs,
|
||||
lib,
|
||||
stdenv,
|
||||
}: let
|
||||
zbar = pkgs.zbar.override {enableVideo = false;};
|
||||
}:
|
||||
let
|
||||
zbar = pkgs.zbar.override { enableVideo = false; };
|
||||
in
|
||||
(pkgs.writeShellScriptBin "qrclip" ''
|
||||
set -eo pipefail
|
||||
${pkgs.pngpaste}/bin/pngpaste - | ${zbar}/bin/zbarimg --raw -q1 -
|
||||
'')
|
||||
// {meta.platforms = lib.platforms.darwin;}
|
||||
(pkgs.writeShellScriptBin "qrclip" ''
|
||||
set -eo pipefail
|
||||
${pkgs.pngpaste}/bin/pngpaste - | ${zbar}/bin/zbarimg --raw -q1 -
|
||||
'')
|
||||
// {
|
||||
meta.platforms = lib.platforms.darwin;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user