38 Commits

Author SHA1 Message Date
Smaug123
b9bb4c49fa Merge branch 'main' into more-earthworm 2024-02-23 22:47:53 +00:00
Patrick Stevens
75c77e99c0 Rem oh-my-zsh (#32) 2024-02-23 22:47:37 +00:00
Smaug123
d2718febf8 Rem oh-my-zsh 2024-02-23 22:44:39 +00:00
Patrick Stevens
ef6d3d4445 FiraCode (#31) 2024-02-23 14:18:18 +00:00
Smaug123
b3eb9adb9f Format 2024-02-23 14:16:04 +00:00
Smaug123
ada02e558b FiraCode 2024-02-23 14:11:48 +00:00
Smaug123
ae96250101 Delete unused keybinds 2024-02-23 11:15:36 +00:00
Smaug123
5e3f257ce6 Merge branch 'main' into more-earthworm 2024-02-23 11:11:39 +00:00
Patrick Stevens
a3a8a5598a Add some extensions (#30) 2024-02-23 11:11:31 +00:00
Smaug123
134b0dc8a7 CHADdeps and coq_nvim 2024-02-23 11:06:57 +00:00
Smaug123
a290279914 Relegate to Linux 2024-02-04 23:39:41 +00:00
Patrick Stevens
bea4ca1220 More earthworm 2024-02-04 20:15:15 +00:00
Patrick Stevens
6af765d032 Update (#29) 2024-01-29 00:42:13 +00:00
dependabot[bot]
02c87e8ea4 Bump cachix/install-nix-action from 24 to 25 (#28)
Bumps [cachix/install-nix-action](https://github.com/cachix/install-nix-action) from 24 to 25.
- [Release notes](https://github.com/cachix/install-nix-action/releases)
- [Commits](https://github.com/cachix/install-nix-action/compare/v24...v25)

---
updated-dependencies:
- dependency-name: cachix/install-nix-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-15 01:58:46 +00:00
dependabot[bot]
0339c1f051 Bump cachix/install-nix-action from 23 to 24 (#27)
Bumps [cachix/install-nix-action](https://github.com/cachix/install-nix-action) from 23 to 24.
- [Release notes](https://github.com/cachix/install-nix-action/releases)
- [Commits](https://github.com/cachix/install-nix-action/compare/v23...v24)

---
updated-dependencies:
- dependency-name: cachix/install-nix-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-04 09:11:42 +00:00
Patrick Stevens
3743aead94 Mailcap and flake check (#26) 2023-10-04 14:25:52 +00:00
Patrick Stevens
8f956b631c Add mailcap (#25) 2023-10-04 15:11:10 +01:00
Patrick Stevens
142e7f2244 Improve Git config, add lynx, add F# Vim config (#24) 2023-10-04 15:04:44 +01:00
dependabot[bot]
166ef06a35 Bump actions/checkout from 3 to 4 (#22)
Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-11 09:09:19 +01:00
dependabot[bot]
b07f725d3d Bump cachix/install-nix-action from 22 to 23 (#23)
Bumps [cachix/install-nix-action](https://github.com/cachix/install-nix-action) from 22 to 23.
- [Release notes](https://github.com/cachix/install-nix-action/releases)
- [Commits](https://github.com/cachix/install-nix-action/compare/v22...v23)

---
updated-dependencies:
- dependency-name: cachix/install-nix-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-11 09:07:16 +01:00
dependabot[bot]
4b3f3f886b Bump cachix/install-nix-action from 17 to 22 (#21)
Bumps [cachix/install-nix-action](https://github.com/cachix/install-nix-action) from 17 to 22.
- [Release notes](https://github.com/cachix/install-nix-action/releases)
- [Commits](https://github.com/cachix/install-nix-action/compare/v17...v22)

---
updated-dependencies:
- dependency-name: cachix/install-nix-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-04 08:40:18 +01:00
Patrick Stevens
028225eca7 Add more linting (#20) 2023-08-28 20:25:01 +01:00
Patrick Stevens
b343f6bb01 Add config for Earthworm (#19) 2023-08-28 19:52:17 +01:00
Patrick Stevens
2cd767ae5b Add rg, poetry, woodpecker-agent, stable Emacs, upstreamed VSCode plugins (#18) 2023-08-28 11:18:05 +01:00
Patrick Stevens
44856ee782 Many updates (#16) 2023-04-01 09:00:45 +01:00
Patrick Stevens
36171014c8 Split into multiple configs (#10) 2022-11-24 20:07:50 +00:00
Patrick Stevens
df297beff1 Add VSCode pull-requests extension, add more libraries to Rust flags (#15) 2022-11-24 19:42:41 +00:00
Patrick Stevens
4e6c9b03af Add PR checks (#14) 2022-11-24 19:30:04 +00:00
Patrick Stevens
460af9d007 Flake update (#13) 2022-11-24 19:24:38 +00:00
Patrick Stevens
b72a716083 Better gitignore for darwin (#12) 2022-11-24 19:15:06 +00:00
Patrick Stevens
f1d917d4ec Add JSON reformat to init.vim (#11) 2022-11-24 19:13:39 +00:00
Patrick Stevens
f4678f910f General faff (#9) 2022-08-20 21:45:49 +01:00
Smaug123
cf0dbe7f44 Merge branch 'main' of ssh://ssh.github.com:443/Smaug123/nix-dotfiles 2022-03-17 22:13:20 +00:00
Patrick Stevens
c45a0d9df6 Add yt-dlp config and fix up git diff style (#8)
* Update git diff method

* Bump flake

* Add yt-dlp
2022-03-17 22:13:13 +00:00
Smaug123
d22ad837a0 Bump flake 2022-03-06 15:33:19 +00:00
Smaug123
005de0c62a Update git diff method 2022-03-02 19:14:46 +00:00
Smaug123
c9dd6b03ec Merge branch 'update-extensions' 2022-02-20 10:23:04 +00:00
Smaug123
5fda4e0165 Add config for LaTeX 2022-02-20 10:22:33 +00:00
32 changed files with 1206 additions and 469 deletions

8
.github/dependabot.yml vendored Normal file
View File

@@ -0,0 +1,8 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"

26
.github/workflows/lint.yaml vendored Normal file
View File

@@ -0,0 +1,26 @@
name: Lint
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
flake-check:
runs-on: "ubuntu-latest"
steps:
- name: "Checkout"
uses: "actions/checkout@v4"
- name: "Install Nix"
uses: "cachix/install-nix-action@v25"
with: { "extra_nix_config": "access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}" }
- name: "Check flake"
run: "nix flake check --all-systems"
all-required-checks-complete:
runs-on: "ubuntu-latest"
steps:
- run: "echo \"All required checks complete.\""
needs:
- "flake-check"

1
.gitignore vendored
View File

@@ -2,3 +2,4 @@ result
.idea/
bin/
obj/
.DS_Store

View File

@@ -81,14 +81,14 @@ type NixFile =
static member Parse (s : string) : NixFile =
let pre, post =
s.Split "\n] ++ pkgs.vscode-utils.extensionsFromVscodeMarketplace [\n"
s.Split "++ pkgs.vscode-utils.extensionsFromVscodeMarketplace ["
|> function
| [| pre ; post |] -> pre, post
| _ -> failwith "Unexpected number of '++'"
let verbatim, skipped =
match pre.Split "\n" |> List.ofArray with
| "{ pkgs }:" :: "" :: "with pkgs.vscode-extensions; [" :: rest ->
match pre.Split "\n" |> Seq.filter (fun s -> s <> "") |> List.ofSeq with
| pkgsStr :: "with pkgs.vscode-extensions; [" :: rest when pkgsStr.Replace(" ", "") = "{pkgs}:" ->
rest
|> List.map (fun s ->
if s.StartsWith '#' then Choice2Of2 (s.[2..].Trim()) else Choice1Of2 (s.Trim())
@@ -146,7 +146,9 @@ let upgradeExtension (client : HttpClient) (e : Extension) : Extension Async =
|> sprintf "[%s]"
|> fun s -> JsonSerializer.Deserialize<Version array> (s, options)
|> Seq.head
return { e with Version = latestVersion.Version }
if latestVersion.Version <> e.Version then
return { e with Version = latestVersion.Version ; Sha256 = "sha256-/000+cQBqzb6QB5+AizlyIcjqNpZ86o2at885hOcro0=" }
else return e
}
let upgrade (nixFile : NixFile) : NixFile =
@@ -170,7 +172,7 @@ module Program =
File.ReadAllText sourceFile
|> NixFile.Parse
|> upgrade
|> sprintf "%O"
|> string<NixFile>
|> fun s -> File.WriteAllText (sourceFile, s)
0

View File

@@ -2,7 +2,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
</PropertyGroup>
<ItemGroup>

View File

@@ -1,13 +1,13 @@
#!/bin/sh
install_nix () {
install_nix() {
echo "Installing Nix..."
diskutil list > /dev/null || export PATH=/usr/sbin:$PATH
diskutil list >/dev/null || export PATH="/usr/sbin:$PATH"
curl -L https://nixos.org/nix/install | sh -s -- --darwin-use-unencrypted-nix-store-volume --daemon || exit 1
echo "Nix installed."
}
install_darwin_build () {
install_darwin_build() {
echo "Installing nix-darwin..."
nix-build https://github.com/LnL7/nix-darwin/archive/master.tar.gz -A installer || exit 1
./result/bin/darwin-installer || exit 1
@@ -23,4 +23,4 @@ nix-channel --update || exit 1
darwin-rebuild changelog || install_darwin_build || exit 1
NIX_PATH="darwin-config=$HOME/.nixpkgs/darwin-configuration.nix:/nix/var/nix/profiles/per-user/Patrick/channels:$NIX_PATH" darwin-rebuild switch || exit 1
NIX_PATH="darwin-config=$HOME/.nixpkgs/darwin-configuration.nix:/nix/var/nix/profiles/per-user/patrick/channels:$NIX_PATH" darwin-rebuild switch || exit 1

View File

@@ -1,22 +1,23 @@
{ pkgs, ... }:
let python = import ./python.nix { inherit pkgs; }; in
{
{pkgs, ...}: let
python = import ./python.nix {inherit pkgs;};
in {
nix.useDaemon = true;
# List packages installed in system profile. To search by name, run:
# $ nix-env -qaP | grep wget
environment.systemPackages =
[
pkgs.alacritty
pkgs.rustup
pkgs.libiconv
pkgs.clang
#pkgs.keepassxc
python
];
environment.systemPackages = [
pkgs.alacritty
pkgs.rustup
pkgs.libiconv
pkgs.clang
python
];
users.users.patrick = {
home = "/Users/patrick";
name = "patrick";
};
# This line is required; otherwise, on shell startup, you won't have Nix stuff in the PATH.
programs.zsh.enable = true;
@@ -27,17 +28,20 @@ let python = import ./python.nix { inherit pkgs; }; in
# Auto upgrade nix package and the daemon service.
services.nix-daemon.enable = true;
nix.package = pkgs.nixFlakes;
nix.package = pkgs.nixVersions.stable;
nix.gc.automatic = true;
nix.nixPath = ["darwin=/nix/store/zq4v3pi2wsfsrjkpk71kcn8srhbwjabf-nix-darwin"];
# Sandbox causes failure: https://github.com/NixOS/nix/issues/4119
nix.useSandbox = false;
nix.settings.sandbox = false;
nix.extraOptions = ''
auto-optimise-store = true
experimental-features = nix-command flakes
extra-experimental-features = ca-derivations
max-jobs = auto # Allow building multiple derivations in parallel
keep-outputs = true # Do not garbage-collect build time-only dependencies (e.g. clang)
keep-derivations = true
# Allow fetching build results from the Lean Cachix cache
trusted-substituters = https://lean4.cachix.org/
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= lean4.cachix.org-1:mawtxSxcaiWE24xCXXgh3qnvlTkyU7evRRnGeAhD4Wk=

View File

270
flake.lock generated
View File

@@ -1,5 +1,25 @@
{
"nodes": {
"apple-silicon": {
"inputs": {
"flake-compat": "flake-compat",
"nixpkgs": "nixpkgs",
"rust-overlay": "rust-overlay"
},
"locked": {
"lastModified": 1705557527,
"narHash": "sha256-DuxxHTQ/W5KToFLWG4FUF8hLldNo9eXlbt7JgvhrMnY=",
"owner": "tpwrules",
"repo": "nixos-apple-silicon",
"rev": "6e324ab06cb27a19409ebc1dc2664bf1e585490a",
"type": "github"
},
"original": {
"owner": "tpwrules",
"repo": "nixos-apple-silicon",
"type": "github"
}
},
"darwin": {
"inputs": {
"nixpkgs": [
@@ -7,11 +27,11 @@
]
},
"locked": {
"lastModified": 1645007752,
"narHash": "sha256-FQZMiVP/1vgR7x+TWonMf0NZczrZ4ZjhSTj3rM+kglY=",
"lastModified": 1705915768,
"narHash": "sha256-+Jlz8OAqkOwJlioac9wtpsCnjgGYUhvLpgJR/5tP9po=",
"owner": "lnl7",
"repo": "nix-darwin",
"rev": "c944b5ee82a829ddf7fa6bd9300bc2fe3d005fa1",
"rev": "1e706ef323de76236eb183d7784f3bd57255ec0b",
"type": "github"
},
"original": {
@@ -22,12 +42,19 @@
}
},
"emacs": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": [
"nixpkgs"
],
"nixpkgs-stable": "nixpkgs-stable"
},
"locked": {
"lastModified": 1644143491,
"narHash": "sha256-ld5MzYesjOE8Ml5uvjFUFaxAozJEl48svwWQ3i7oggc=",
"lastModified": 1706170797,
"narHash": "sha256-oGuFylWYU9OY5DaEJEK+Z7EL81Ln27xz01LN9+8U0P0=",
"owner": "nix-community",
"repo": "emacs-overlay",
"rev": "4c7e0980a5f23684ca3ea772d4f62b0da4f55e3c",
"rev": "dd5d758f69dd1ae6d0399763aa73ca34974ce9e3",
"type": "github"
},
"original": {
@@ -36,6 +63,57 @@
"type": "github"
}
},
"flake-compat": {
"locked": {
"lastModified": 1688025799,
"narHash": "sha256-ktpB4dRtnksm9F5WawoIkEneh1nrEvuxb5lJFt1iOyw=",
"owner": "nix-community",
"repo": "flake-compat",
"rev": "8bf105319d44f6b9f0d764efa4fdef9f1cc9ba1c",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "flake-compat",
"type": "github"
}
},
"flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1705309234,
"narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flake-utils_2": {
"inputs": {
"systems": "systems_2"
},
"locked": {
"lastModified": 1701680307,
"narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "4022d587cbbfd70fe950c1e2083a02621806a725",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"home-manager": {
"inputs": {
"nixpkgs": [
@@ -43,11 +121,11 @@
]
},
"locked": {
"lastModified": 1645140957,
"narHash": "sha256-WTJzLSCDLBI537o2L/3kRyqEV5YRT7+1QSGryeKReHE=",
"lastModified": 1706134977,
"narHash": "sha256-KwNb1Li3K6vuVwZ77tFjZ89AWBo7AiCs9t0Cens4BsM=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "4f4165a8b9108818ab0193bbd1a252106870b2a2",
"rev": "6359d40f6ec0b72a38e02b333f343c3d4929ec10",
"type": "github"
},
"original": {
@@ -56,28 +134,194 @@
"type": "github"
}
},
"model": {
"flake": false,
"locked": {
"narHash": "sha256-aMuDhcvEaioTWn+LUcnxfAgs2VFbM8xBVVfdzx2Cu8I=",
"type": "file",
"url": "https://huggingface.co/ggerganov/whisper.cpp/resolve/main/ggml-large-v3.bin?download=true"
},
"original": {
"type": "file",
"url": "https://huggingface.co/ggerganov/whisper.cpp/resolve/main/ggml-large-v3.bin?download=true"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1644972330,
"narHash": "sha256-hEDWZcTDopnz4jRDhCmnH9VztdKSfR6mrudSM8+Jfco",
"lastModified": 1705316053,
"narHash": "sha256-J2Ey5mPFT8gdfL2XC0JTZvKaBw/b2pnyudEXFvl+dQM=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "1a5ff5ea0297dc8ec5a33b87dfb4fc78687068e6",
"rev": "c3e128f3c0ecc1fb04aef9f72b3dcc2f6cecf370",
"type": "github"
},
"original": {
"owner": "nixos",
"repo": "nixpkgs",
"rev": "c3e128f3c0ecc1fb04aef9f72b3dcc2f6cecf370",
"type": "github"
}
},
"nixpkgs-stable": {
"locked": {
"lastModified": 1705916986,
"narHash": "sha256-iBpfltu6QvN4xMpen6jGGEb6jOqmmVQKUrXdOJ32u8w=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "d7f206b723e42edb09d9d753020a84b3061a79d8",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-23.11",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-stable_2": {
"locked": {
"lastModified": 1705033721,
"narHash": "sha256-K5eJHmL1/kev6WuqyqqbS1cdNnSidIZ3jeqJ7GbrYnQ=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "a1982c92d8980a0114372973cbdfe0a307f1bdea",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "release-23.05",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1706006310,
"narHash": "sha256-nDPz0fj0IFcDhSTlXBU2aixcnGs2Jm4Zcuoj0QtmiXQ=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "b43bb235efeab5324c5e486882ef46749188eee2",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_3": {
"locked": {
"lastModified": 1695033101,
"narHash": "sha256-RQ4m+ycjdLdass7Hr4+Lzwnjw7wGhcUkKqWiJS3YxPM=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "d941d9491804e0ca01e03468dbf6f8d3a7919a16",
"type": "github"
},
"original": {
"owner": "nixos",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"apple-silicon": "apple-silicon",
"darwin": "darwin",
"emacs": "emacs",
"home-manager": "home-manager",
"nixpkgs": "nixpkgs"
"nixpkgs": "nixpkgs_2",
"sops-nix": "sops-nix",
"whisper": "whisper"
}
},
"rust-overlay": {
"flake": false,
"locked": {
"lastModified": 1686795910,
"narHash": "sha256-jDa40qRZ0GRQtP9EMZdf+uCbvzuLnJglTUI2JoHfWDc=",
"owner": "oxalica",
"repo": "rust-overlay",
"rev": "5c2b97c0a9bc5217fc3dfb1555aae0fb756d99f9",
"type": "github"
},
"original": {
"owner": "oxalica",
"repo": "rust-overlay",
"type": "github"
}
},
"sops-nix": {
"inputs": {
"nixpkgs": [
"nixpkgs"
],
"nixpkgs-stable": "nixpkgs-stable_2"
},
"locked": {
"lastModified": 1706130372,
"narHash": "sha256-fHZxKH1DhsXPP36a2vJ91Zy6S+q6+QRIFlpLr9fZHU8=",
"owner": "Mic92",
"repo": "sops-nix",
"rev": "4606d9b1595e42ffd9b75b9e69667708c70b1d68",
"type": "github"
},
"original": {
"owner": "Mic92",
"repo": "sops-nix",
"type": "github"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"systems_2": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"whisper": {
"inputs": {
"flake-utils": "flake-utils_2",
"model": "model",
"nixpkgs": "nixpkgs_3"
},
"locked": {
"lastModified": 1704121968,
"narHash": "sha256-N8FJb+ohJ4Qt/m5RoAbwm3RP4VRjl+hA6PUCfjPhZo8=",
"owner": "Smaug123",
"repo": "whisper.cpp",
"rev": "04f8e0cdc73abe7c593b2c9405f0f590c51de95a",
"type": "github"
},
"original": {
"owner": "Smaug123",
"ref": "nix",
"repo": "whisper.cpp",
"type": "github"
}
}
},

149
flake.nix
View File

@@ -2,45 +2,156 @@
description = "Patrick's Darwin Nix setup";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
nixpkgs = {
url = "github:NixOS/nixpkgs/nixpkgs-unstable";
};
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
darwin = {
url = "github:lnl7/nix-darwin/master";
# url = "github:Smaug123/nix-darwin/extract";
inputs.nixpkgs.follows = "nixpkgs";
};
emacs = {
url = "github:nix-community/emacs-overlay";
inputs.nixpkgs.follows = "nixpkgs";
};
sops-nix = {
url = "github:Mic92/sops-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
apple-silicon = {
url = "github:tpwrules/nixos-apple-silicon";
};
whisper = {
url = "github:Smaug123/whisper.cpp/nix";
};
};
outputs = { self, darwin, emacs, nixpkgs, home-manager, ... }@inputs:
let system = "aarch64-darwin"; in
let config = {
allowUnfreePredicate = pkg: builtins.elem (nixpkgs.lib.getName pkg) [
"vscode"
];
}; in
let overlays = [ emacs.overlay ] ++ import ./overlays.nix; in
let pkgs = (import nixpkgs { inherit system config overlays; }); in
{
darwinConfigurations = {
nixpkgs = pkgs;
patrick = darwin.lib.darwinSystem {
system = system;
modules = [
./darwin-configuration.nix
home-manager.darwinModules.home-manager
outputs = {
self,
darwin,
emacs,
nixpkgs,
home-manager,
sops-nix,
apple-silicon,
whisper,
...
} @ inputs: let
config = {
# contentAddressedByDefault = true;
allowUnfree = true;
};
systems = ["aarch64-darwin" "aarch64-linux" "x86_64-linux"];
in let
overlays = [emacs.overlay] ++ import ./overlays.nix;
recursiveMerge = attrList: let
f = attrPath:
builtins.zipAttrsWith (n: values:
if builtins.tail values == []
then builtins.head values
else if builtins.all builtins.isList values
then nixpkgs.lib.unique (builtins.concatLists values)
else if builtins.all builtins.isAttrs values
then f (attrPath ++ [n]) values
else builtins.last values);
in
f [] attrList;
in {
nixosConfigurations = {
earthworm = let
system = "aarch64-linux";
in let
pkgs = import nixpkgs {inherit system config overlays;};
in
nixpkgs.lib.nixosSystem {
inherit system;
modules = let
args = {
nixpkgs = pkgs;
username = "patrick";
dotnet = pkgs.dotnet-sdk_8;
};
in [
./home-manager/earthworm-config.nix
apple-silicon.nixosModules.default
home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.Patrick = import ./home.nix { nixpkgs = pkgs; };
home-manager.users.patrick = recursiveMerge [(import ./home-manager/earthworm.nix args) (import ./home-manager/home.nix args)];
}
];
};
};
darwinConfigurations = let
system = "aarch64-darwin";
in let
pkgs = import nixpkgs {inherit system config overlays;};
in {
nixpkgs = pkgs;
patrick = darwin.lib.darwinSystem {
system = system;
modules = let
args = {
nixpkgs = pkgs;
username = "patrick";
dotnet = pkgs.dotnet-sdk_8;
whisper = whisper.packages.${system};
};
in [
./darwin-configuration.nix
sops-nix.nixosModules.sops
home-manager.darwinModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.patrick = recursiveMerge [(import ./home-manager/darwin.nix args) (import ./home-manager/home.nix args)];
}
];
};
};
checks = let
fmt-check = system: let
pkgs = import nixpkgs {inherit config system;};
in
pkgs.stdenvNoCC.mkDerivation {
name = "fmt-check";
src = ./.;
nativeBuildInputs = [pkgs.alejandra pkgs.shellcheck pkgs.shfmt];
checkPhase = ''
find . -type f -name '*.sh' | xargs shfmt -d -s -i 2 -ci
alejandra -c .
find . -type f -name '*.sh' -exec shellcheck -x {} \;
'';
installPhase = "mkdir $out";
dontBuild = true;
doCheck = true;
};
in
builtins.listToAttrs (builtins.map (system: {
name = system;
value = {fmt-check = fmt-check system;};
})
systems);
devShells = let
devShell = system: (
let
pkgs = import nixpkgs {inherit config system;};
in {
default = pkgs.mkShell {
buildInputs = [pkgs.alejandra pkgs.shellcheck];
};
}
);
in
builtins.listToAttrs (builtins.map (system: {
name = system;
value = devShell system;
})
systems);
};
}

41
hardware/earthworm.nix Normal file
View File

@@ -0,0 +1,41 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{
config,
lib,
pkgs,
modulesPath,
...
}: {
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = ["usb_storage" "sdhci_pci"];
boot.initrd.kernelModules = [];
boot.kernelModules = [];
boot.extraModulePackages = [];
fileSystems."/" = {
device = "/dev/disk/by-uuid/49068d2d-13e6-43b5-a740-f23db6fbd6b2";
fsType = "ext4";
};
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/43ED-0FE7";
fsType = "vfat";
};
swapDevices = [];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true;
# networking.interfaces.wlan0.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "aarch64-linux";
powerManagement.cpuFreqGovernor = lib.mkDefault "ondemand";
}

23
home-manager/.zshrc Normal file
View File

@@ -0,0 +1,23 @@
prompt_custom() {
local cyan='%F{cyan}'
local red='%F{red}'
local blue='%F{blue}'
local reset_color='%f'
local git_info=$(git symbolic-ref --short HEAD 2> /dev/null || git describe --tags --exact-match 2> /dev/null || git rev-parse --short HEAD 2> /dev/null)
if [[ -n "$git_info" ]]; then
# escape the percent character, which is the only zsh prompt metacharacter
git_info=$git_info:s/%/%%/
git_info=" ${blue}git:${reset_color}${red}(${git_info})${reset_color}"
else
git_info=""
fi
# %1 is the name of cwd
PROMPT="${cyan}%1~${reset_color}${git_info} > "
}
# Full path to cwd, with `~` for any initial home component, in light green,
RPROMPT='%F{155}%~%f'
precmd_functions+=(prompt_custom)

View File

@@ -0,0 +1,2 @@
[registries.crates-io]
protocol = "sparse"

43
home-manager/darwin.nix Normal file
View File

@@ -0,0 +1,43 @@
{
nixpkgs,
username,
dotnet,
whisper,
...
}: {
imports = [./rider];
rider = {
enable = true;
username = username;
dotnet = dotnet;
};
home.packages = [
whisper.default
whisper.normalize
# "Damaged and can't be opened"
#nixpkgs.bcompare
#nixpkgs.gdb
#nixpkgs.handbrake
];
programs.vscode = {
userSettings = {
"lean.leanpkgPath" = "/Users/${username}/.elan/toolchains/stable/bin/leanpkg";
"lean.executablePath" = "/Users/${username}/.elan/toolchains/stable/bin/lean";
"lean.memoryLimit" = 16384;
"latex-workshop.view.pdf.viewer" = "tab";
"lean4.toolchainPath" = "/Users/${username}/.elan/toolchains/leanprover--lean4---nightly-2022-12-16";
};
};
programs.zsh = {
shellAliases = {
cmake = "cmake -DCMAKE_MAKE_PROGRAM=${nixpkgs.gnumake}/bin/make -DCMAKE_AR=${nixpkgs.darwin.cctools}/bin/ar -DCMAKE_RANLIB=${nixpkgs.darwin.cctools}/bin/ranlib -DGMP_INCLUDE_DIR=${nixpkgs.gmp.dev}/include/ -DGMP_LIBRARIES=${nixpkgs.gmp}/lib/libgmp.10.dylib";
ar = "${nixpkgs.darwin.cctools}/bin/ar";
};
};
home.file.".ssh/config".source = ./ssh.config;
}

View File

@@ -0,0 +1,56 @@
{
config,
pkgs,
...
}: {
imports = [
../hardware/earthworm.nix
];
hardware.asahi.peripheralFirmwareDirectory = ../firmware;
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = false;
boot.extraModprobeConfig = ''
options hid_apple iso_layout=0
'';
networking = {
hostName = "earthworm";
networkmanager.enable = true;
};
time.timeZone = "Europe/London";
programs.sway.enable = true;
programs.zsh.enable = true;
# TODO: work out secrets management for password, then set mutableUsers to false
users.mutableUsers = true;
users.users.patrick = {
isNormalUser = true;
extraGroups = ["wheel" "networkManager"];
};
environment.systemPackages = [
pkgs.vim
pkgs.wget
];
environment.loginShellInit = ''
[[ "$(tty)" == /dev/tty1 ]] && sway
'';
services.openssh.enable = true;
system.stateVersion = "23.11";
nix.settings.experimental-features = ["nix-command" "flakes" "ca-derivations"];
nix.gc.automatic = true;
nix.extraOptions = ''
auto-optimise-store = true
max-jobs = auto
keep-outputs = true
keep-derivations = true
'';
}

112
home-manager/earthworm.nix Normal file
View File

@@ -0,0 +1,112 @@
{
nixpkgs,
username,
dotnet,
...
}: {
home.packages = [nixpkgs.firefox-wayland nixpkgs.wl-clipboard];
nixpkgs.config.firefox = {
speechSynthesisSupport = true;
};
# Sadly not implemented on Darwin
programs.firefox = {
enable = true;
profiles = {
patrick = {
isDefault = true;
name = "patrick";
search = {default = "Google";};
settings = {
# see https://github.com/TLATER/dotfiles/blob/b39af91fbd13d338559a05d69f56c5a97f8c905d/home-config/config/graphical-applications/firefox.nix
# see https://www.ghacks.net/2015/08/18/a-comprehensive-list-of-firefox-privacy-and-security-settings/
"browser.search.isUS" = false;
"browser.search.region" = "GB";
"gfx.webrender.all" = true; # enable GPU acceleration
"media.ffmpeg.vaapi.enabled" = true;
"widget.dmabuf.force-enabled" = true;
"privacy.webrtc.legacyGlobalIndicator" = false;
"app.shield.optoutstudies.enabled" = false;
"app.update.enabled" = false;
"app.update.auto" = false;
"app.update.silent" = false;
"app.update.service.enabled" = false;
"app.update.staging.enabled" = false;
"browser.discovery.enabled" = false;
"browser.laterrun.enabled" = false;
"browser.shell.checkDefaultBrowser" = false;
"browser.rights.3.shown" = true;
"browser.search.update" = false;
"extensions.update.enabled" = false;
"extensions.update.autoUpdateDefault" = false;
"extensions.getAddons.cache.enabled" = false;
"dom.ipc.plugins.reportCrashURL" = false;
"extensions.webservice.discoverURL" = "http://127.0.0.1";
"toolkit.telemetry.unified" = false;
"toolkit.telemetry.unifiedIsOptIn" = true;
"toolkit.telemetry.enabled" = false;
"toolkit.telemetry.server" = "";
"toolkit.telemetry.archive.enabled" = false;
"lightweightThemes.update.enabled" = false;
"startup.homepage_welcome_url" = "";
"startup.homepage_welcome_url.additional" = "";
"startup.homepage_override_url" = "";
"datareporting.healthreport.uploadEnabled" = false;
"datareporting.healthreport.documentServerURI" = "";
"datareporting.healthreport.service.enabled" = false;
"datareporting.healthreport.about.reportUrl" = "data:text/plain,";
"toolkit.telemetry.cachedClientID" = "";
"browser.selfsupport.url" = "";
"browser.selfsupport.enabled" = false;
"experiments.enabled" = false;
"experiments.supported" = false;
"experiments.activeExperiment" = false;
"experiments.manifest.uri" = "";
"network.allow-experiments" = false;
"breakpad.reportURL" = "";
"browser.tabs.crashReporting.sendReport" = false;
"browser.newtab.preload" = false;
"browser.newtabpage.directory.ping" = "data:text/plain,";
"browser.newtabpage.directory.source" = "data:text/plain,";
"browser.newtabpage.enabled" = false;
"browser.newtabpage.enhanced" = false;
"browser.newtabpage.introShown" = true;
"browser.aboutHomeSnippets.updateUrl" = "https://127.0.0.1";
"extensions.pocket.enabled" = false;
"extensions.pocket.api" = "";
"extensions.pocket.site" = "";
"extensions.pocket.oAuthConsumerKey" = "";
"social.whitelist" = "";
"social.toast-notifications.enabled" = false;
"social.shareDirectory" = "";
"social.remote-install.enabled" = false;
"social.directories" = "";
"social.share.activationPanelEnabled" = false;
"social.enabled" = false;
"dom.flyweb.enabled" = false;
"services.sync.enabled" = false;
};
};
};
};
wayland.windowManager.sway = {
enable = true;
config = {
focus = {followMouse = false;};
modifier = "Mod4";
terminal = "alacritty";
window = {border = 5;};
};
extraConfig = ''
output Unknown-1 scale 2
'';
};
services.swayidle = {enable = true;};
services.cbatticon = {
lowLevelPercent = 20;
iconType = "standard";
enable = true;
};
}

284
home-manager/home.nix Normal file
View File

@@ -0,0 +1,284 @@
{
nixpkgs,
username,
dotnet,
...
}: {
# Let Home Manager install and manage itself.
programs.home-manager.enable = true;
# Home Manager needs a bit of information about you and the
# paths it should manage.
home.username = username;
# This value determines the Home Manager release that your
# configuration is compatible with. This helps avoid breakage
# when a new Home Manager release introduces backwards
# incompatible changes.
#
# You can update Home Manager without changing this value. See
# the Home Manager release notes for a list of state version
# changes in each release.
home.stateVersion = "22.05";
fonts.fontconfig.enable = true;
programs.tmux = {
shell = "${nixpkgs.zsh}/bin/zsh";
escapeTime = 50;
mouse = false;
prefix = "C-b";
enable = true;
terminal = "screen-256color";
extraConfig = ''
set-option -sa terminal-features ',xterm-256color:RGB'
'';
};
programs.zsh = {
enable = true;
autocd = true;
enableAutosuggestions = true;
enableCompletion = true;
history = {
expireDuplicatesFirst = true;
};
sessionVariables = {
EDITOR = "vim";
LC_ALL = "en_US.UTF-8";
LC_CTYPE = "en_US.UTF-8";
RUSTFLAGS = "-L ${nixpkgs.libiconv}/lib -L ${nixpkgs.libcxxabi}/lib -L ${nixpkgs.libcxx}/lib";
RUST_BACKTRACE = "full";
};
shellAliases = {
vim = "nvim";
view = "vim -R";
grep = "${nixpkgs.ripgrep}/bin/rg";
};
sessionVariables = {
RIPGREP_CONFIG_PATH = "/Users/${username}/.config/ripgrep/config";
};
initExtra = builtins.readFile ./.zshrc;
};
programs.fzf = {
enable = true;
enableZshIntegration = true;
};
programs.git = {
package = nixpkgs.gitAndTools.gitFull;
enable = true;
userName = "Smaug123";
userEmail = "patrick+github@patrickstevens.co.uk";
aliases = {
co = "checkout";
st = "status";
};
delta = {enable = true;};
extraConfig = {
core = {
autocrlf = "input";
};
rerere = {
enabled = true;
};
push = {
default = "current";
autoSetupRemote = true;
};
pull = {
rebase = false;
};
init = {
defaultBranch = "main";
};
advice = {
addIgnoredFile = false;
};
"filter \"lfs\"" = {
clean = "${nixpkgs.git-lfs} clean -- %f";
smudge = "${nixpkgs.git-lfs}/bin/git-lfs smudge --skip -- %f";
process = "${nixpkgs.git-lfs}/bin/git-lfs filter-process";
required = true;
};
pull = {
twohead = "ort";
};
merge = {
conflictStyle = "diff3";
};
diff = {
colorMoved = "default";
};
"protocol.file" = {
allow = "always";
};
};
};
programs.vscode = {
enable = true;
enableExtensionUpdateCheck = true;
enableUpdateCheck = true;
package = nixpkgs.vscode;
extensions = import ./vscode-extensions.nix {pkgs = nixpkgs;};
userSettings = {
workbench.colorTheme = "Default";
"files.Exclude" = {
"**/.git" = true;
"**/.DS_Store" = true;
"**/Thumbs.db" = true;
"**/*.olean" = true;
"**/result" = true;
};
"git.path" = "${nixpkgs.git}/bin/git";
"update.mode" = "none";
"explorer.confirmDelete" = false;
};
};
programs.neovim = let
pythonEnv = nixpkgs.python3.withPackages (ps: [
ps.pynvim
ps.pynvim-pp
ps.pyyaml
ps.std2
]);
in {
enable = true;
plugins = [
nixpkgs.vimPlugins.molokai
nixpkgs.vimPlugins.tagbar
nixpkgs.vimPlugins.fzf-vim
{
plugin = nixpkgs.vimPlugins.Ionide-vim;
config = ''
let g:fsharp#fsautocomplete_command = ['dotnet', 'fsautocomplete', '--background-service-enabled']
let g:fsharp#show_signature_on_cursor_move = 1
if has('nvim') && exists('*nvim_open_win')
augroup FSharpGroup
autocmd!
autocmd FileType fsharp nnoremap <leader>t :call fsharp#showTooltip()<CR>
augroup END
endif
'';
}
{
plugin = nixpkgs.vimPlugins.chadtree;
config = "let g:chadtree_settings = {'xdg': v:true}";
}
{
plugin = nixpkgs.vimPlugins.coq_nvim;
config = ''let g:coq_settings = { 'auto_start': v:true, 'xdg': v:true }'';
}
{
plugin = nixpkgs.vimPlugins.rust-vim;
config = "let g:rustfmt_autosave = 1";
}
{
plugin = nixpkgs.vimPlugins.LanguageClient-neovim;
config = "let g:LanguageClient_serverCommands = { 'nix': ['rnix-lsp'] }";
}
{
plugin = nixpkgs.vimPlugins.syntastic;
config = '' let g:syntastic_rust_checkers = ['cargo']
let g:syntastic_always_populate_loc_list = 1
let g:syntastic_auto_loc_list = 1
let g:syntastic_check_on_open = 1
let g:syntastic_check_on_wq = 0'';
}
nixpkgs.vimPlugins.tagbar
];
viAlias = true;
vimAlias = true;
vimdiffAlias = true;
withPython3 = true;
extraLuaConfig = ''vim.g.python3_host_prog="${pythonEnv}/bin/python"'';
extraConfig = builtins.readFile ./init.vim;
};
programs.direnv = {
enable = true;
enableZshIntegration = true;
nix-direnv.enable = true;
};
programs.alacritty = {
enable = true;
settings = {
font = {
normal = {
family = "FiraCode Nerd Font Mono";
};
};
};
};
home.packages = [
nixpkgs.keepassxc
nixpkgs.rust-analyzer
nixpkgs.tmux
nixpkgs.wget
nixpkgs.yt-dlp
nixpkgs.cmake
nixpkgs.gnumake
nixpkgs.gcc
nixpkgs.lldb
nixpkgs.hledger
nixpkgs.hledger-web
dotnet
nixpkgs.jitsi-meet
nixpkgs.ripgrep
nixpkgs.elan
nixpkgs.coreutils-prefixed
nixpkgs.shellcheck
nixpkgs.html-tidy
nixpkgs.hugo
nixpkgs.agda
nixpkgs.pijul
nixpkgs.universal-ctags
nixpkgs.asciinema
nixpkgs.git-lfs
nixpkgs.imagemagick
nixpkgs.nixpkgs-fmt
nixpkgs.rnix-lsp
nixpkgs.grpc-tools
nixpkgs.element-desktop
nixpkgs.ihp-new
nixpkgs.direnv
nixpkgs.lnav
nixpkgs.age
nixpkgs.nodejs
nixpkgs.sqlitebrowser
nixpkgs.typst
nixpkgs.poetry
nixpkgs.woodpecker-agent
nixpkgs.alacritty
nixpkgs.lynx
nixpkgs.alejandra
nixpkgs.ffmpeg
nixpkgs.bat
nixpkgs.pandoc
(nixpkgs.nerdfonts.override {fonts = ["FiraCode" "DroidSansMono"];})
];
home.file.".mailcap".source = ./mailcap;
home.file.".ideavimrc".source = ./ideavimrc;
home.file.".config/yt-dlp/config".source = ./youtube-dl.conf;
home.file.".config/ripgrep/config".source = ./ripgrep.conf;
programs.emacs = {
enable = true;
package = nixpkgs.emacs;
extraPackages = epkgs: [];
extraConfig = ''
(load-file (let ((coding-system-for-read 'utf-8))
(shell-command-to-string "agda-mode locate")))
'';
};
home.file.".cargo/config.toml".source = ./cargo-config.toml;
}

View File

@@ -148,7 +148,7 @@ endif
set encoding=utf8
" Use Unix as the standard file type
set ffs=unix,dos,mac
set ffs=unix,mac
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
@@ -191,12 +191,6 @@ map <c-space> ?
" Disable highlight when <leader><cr> is pressed
map <silent> <leader><cr> :noh<cr>
" Smart way to move between windows
map <C-j> <C-W>j
map <C-k> <C-W>k
map <C-h> <C-W>h
map <C-l> <C-W>l
" Close the current buffer
map <leader>bd :Bclose<cr>:tabclose<cr>gT
@@ -249,19 +243,6 @@ set laststatus=2
" => Editing mappings
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Move a line of text using ALT+[jk] or Command+[jk] on mac
nmap <M-j> mz:m+<cr>`z
nmap <M-k> mz:m-2<cr>`z
vmap <M-j> :m'>+<cr>`<my`>mzgv`yo`z
vmap <M-k> :m'<-2<cr>`>my`<mzgv`yo`z
if has("mac") || has("macunix")
nmap <D-j> <M-j>
nmap <D-k> <M-k>
vmap <D-j> <M-j>
vmap <D-k> <M-k>
endif
" Delete trailing white space on save, useful for some filetypes ;)
fun! CleanExtraSpaces()
let save_cursor = getpos(".")
@@ -359,6 +340,7 @@ function! VisualSelection(direction, extra_filter) range
endfunction
nnoremap <leader>c :!cargo clippy
nnoremap <leader>j :%!python -m json.tool
set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
@@ -366,3 +348,4 @@ set statusline+=%*
" Format the status line
set statusline=\ %{HasPaste()}%F%m%r%h\ %w\ \ CWD:\ %r%{getcwd()}%h\ \ \ Line:\ %l\ \ Column:\ %c
set fileformat=unix

3
home-manager/mailcap Normal file
View File

@@ -0,0 +1,3 @@
text/html; lynx -force_html %s; needsterminal
image/png; qlmanage -p %s
image/jpeg; qlmanage -p %s

View File

@@ -1,6 +1,6 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:Boolean x:Key="/Default/Environment/Hierarchy/NuGetOptions/IncludePrerelease/@EntryValue">False</s:Boolean>
<s:String x:Key="/Default/AppBrowserSnapshotsStoreSettings/CurrentStore/@EntryValue">/Users/Patrick/Library/Preferences/Rider2019.3/resharper-host/Sessions</s:String>
<s:String x:Key="/Default/AppBrowserSnapshotsStoreSettings/CurrentStore/@EntryValue">/Users/patrick/Library/Preferences/Rider2019.3/resharper-host/Sessions</s:String>
<s:Boolean x:Key="/Default/CodeEditing/Intellisense/CodeCompletion/CacheImportCompletion/@EntryValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeInspection/Roslyn/LegacySeveritiesMigrated/@EntryValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/ExternalSources/Decompiler/DecompilerLegalNoticeAccepted/@EntryValue">True</s:Boolean>
@@ -34,7 +34,7 @@
<s:String x:Key="/Default/Profilers/Common/ConfigurationsStore/SelectedProfileConfigurationId/=NotSupported/@EntryIndexedValue">00000000-0000-0000-0000-000000000000</s:String>
<s:String x:Key="/Default/Profilers/Common/ConfigurationsStore/SelectedProfileTestsConfigurationId/=Any/@EntryIndexedValue">2704f639-7a6d-4dc0-8931-351a3f933333</s:String>
<s:Boolean x:Key="/Default/RiderDebugger/RiderRestoreDecompile/RestoreDecompileSetting/@EntryValue">False</s:Boolean>
<s:String x:Key="/Default/SnapshotsStore/CurrentStore/@EntryValue">/Users/Patrick/Library/Preferences/Rider2019.3/resharper-host/Sessions</s:String>
<s:String x:Key="/Default/SnapshotsStore/CurrentStore/@EntryValue">/Users/patrick/Library/Preferences/Rider2019.3/resharper-host/Sessions</s:String>
<s:Boolean x:Key="/Default/SymbolServers/RestoreDecompileSetting/@EntryValue">False</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Leet/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=nums/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>
<s:Boolean x:Key="/Default/UserDictionary/Words/=nums/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>

View File

@@ -0,0 +1,49 @@
{
pkgs,
config,
lib,
...
}: let
src = ./GlobalSettingsStorage.DotSettings;
in let
link = ./link.sh;
in let
riderconfig = pkgs.stdenv.mkDerivation {
name = "rider-config";
version = "2023.1";
__contentAddressed = true;
src = src;
phases = ["unpackPhase"];
unpackPhase = ''
mkdir -p "$out"
cp ${src} "$out/GlobalSettingsStorage.DotSettings"
cp ${link} "$out/link.sh"
chmod u+x "$out/link.sh"
sed -i 's_NIX-DOTNET-SDK_${config.rider.dotnet}_' "$out/GlobalSettingsStorage.DotSettings"
sed -i "s!NIX-RIDER-CONFIG!$out!" "$out/link.sh"
'';
installPhase = ''
'';
};
in {
options = {
rider.enable = lib.mkOption {default = false;};
rider.username = lib.mkOption {
type = lib.types.str;
example = "Patrick";
};
rider.dotnet = lib.mkOption {default = pkgs.dotnet-sdk;};
};
config = lib.mkIf config.rider.enable {
home.activation.jetbrains-rider-settings = lib.hm.dag.entryAfter ["writeBoundary"] ''
dest="/Users/${config.rider.username}/Library/Application Support/JetBrains"
if [ -e "$dest" ]; then
find "$dest" -maxdepth 1 -type d -name 'Rider*' -exec sh -c '${riderconfig}/link.sh "$0"' {} \;
fi
'';
};
}

View File

@@ -3,17 +3,19 @@
outfile="$1/resharper-host/GlobalSettingsStorage.DotSettings"
if [ -e "$outfile" ]; then
existing=$(readlink "$outfile")
if [ $? -eq 1 ] ; then
if [ $? -eq 1 ]; then
echo "Backing up existing settings file $outfile"
mv "$outfile" "$outfile.bak"
ln -s "NIX-RIDER-CONFIG/GlobalSettingsStorage.DotSettings" "$outfile"
else
case "$existing" in
"/nix/store/"*)
ln -fs "NIX-RIDER-CONFIG/GlobalSettingsStorage.DotSettings" "$outfile" ;;
ln -fs "NIX-RIDER-CONFIG/GlobalSettingsStorage.DotSettings" "$outfile"
;;
*)
echo "Refusing to overwrite existing symlink to $existing" && \
exit 1 ;;
echo "Refusing to overwrite existing symlink to $existing" &&
exit 1
;;
esac
fi
else

View File

@@ -0,0 +1,6 @@
# Don't let ripgrep vomit really long lines to my terminal, and show a preview.
--max-columns=150
--max-columns-preview
# Ignore contents of .git
--glob=!.git/*

View File

@@ -4,4 +4,4 @@ Host *
AddKeysToAgent yes
IgnoreUnknown UseKeychain
UseKeychain yes
IdentityFile ~/.ssh/id_rsa
IdentityFile ~/.ssh/id_ed25519

View File

@@ -0,0 +1,105 @@
{pkgs}:
with pkgs.vscode-extensions;
[
bbenoist.nix
haskell.haskell
yzhang.markdown-all-in-one
james-yu.latex-workshop
vscodevim.vim
ms-dotnettools.csharp
ms-vscode-remote.remote-ssh
justusadam.language-haskell
rust-lang.rust-analyzer
github.vscode-pull-request-github
shardulm94.trailing-spaces
nvarner.typst-lsp
arrterian.nix-env-selector
]
++ pkgs.vscode-utils.extensionsFromVscodeMarketplace [
{
name = "remote-containers";
publisher = "ms-vscode-remote";
version = "0.285.0";
sha256 = "sha256-UHp6Ewx0bUvPjgaO0A5k77SGj8ovPFLl/WvxyLcZ4y0=";
}
{
name = "vscode-hsx";
publisher = "s0kil";
version = "0.4.0";
sha256 = "sha256-/WRy+cQBqzb6QB5+AizlyIcjqNpZ86o2at885hOcroM=";
}
{
name = "vscode-docker";
publisher = "ms-azuretools";
version = "1.24.0";
sha256 = "sha256-zZ34KQrRPqVbfGdpYACuLMiMj4ZIWSnJIPac1yXD87k=";
}
{
name = "toml";
publisher = "be5invis";
version = "0.6.0";
sha256 = "yk7buEyQIw6aiUizAm+sgalWxUibIuP9crhyBaOjC2E=";
}
{
name = "ionide-fsharp";
publisher = "ionide";
version = "7.18.1";
sha256 = "sha256-6NPMQncoZhZYtx5c+qzarjuSzUXMb5HdKCzcHPCFUhU=";
}
{
name = "lean4";
publisher = "leanprover";
version = "0.0.128";
sha256 = "sha256-odRDOrlDFahweLzoQtpufY8UUwAutPFunqg7atTxnPo=";
}
{
name = "vscode-clang";
publisher = "mitaki28";
version = "0.2.4";
sha256 = "0sys2h4jvnannlk2q02lprc2ss9nkgh0f0kwa188i7viaprpnx23";
}
{
name = "dotnet-interactive-vscode";
publisher = "ms-dotnettools";
version = "1.0.4165021";
sha256 = "sha256-P5EHc5t4UyKEfxIGNTg+SyQPFlrbwaNIaprPY63iJ/k=";
}
{
name = "mono-debug";
publisher = "ms-vscode";
version = "0.16.3";
sha256 = "sha256-6IU8aP4FQVbEMZAgssGiyqM+PAbwipxou5Wk3Q2mjZg=";
}
{
name = "Theme-MarkdownKit";
publisher = "ms-vscode";
version = "0.1.4";
sha256 = "1im78k2gaj6cri2jcvy727qdy25667v0f7vv3p3hv13apzxgzl0l";
}
{
name = "debug";
publisher = "webfreak";
version = "0.26.1";
sha256 = "sha256-lLLa8SN+Sf9Tbi7HeWYWa2KhPQFJyQWrf9l3EUljwYo=";
}
]
++ [
(let
vsix = builtins.fetchurl {
name = "vadimcn-vscode-lldb.zip";
url = "https://github.com/vadimcn/codelldb/releases/download/v1.9.0/codelldb-aarch64-darwin.vsix";
sha256 = "sha256:1kxrxxlzasa9jl73lqh3n36fzpdgh2hbxpzp8fk6xyzcc5vm9zfb";
};
in
pkgs.vscode-utils.buildVscodeExtension
{
vsix = vsix;
src = vsix;
vscodeExtPublisher = "vadimcn";
vscodeExtName = "vscode-lldb";
vscodeExtUniqueId = "vadimcn-vscode-lldb";
publisher = "vadimcn";
version = "1.9.0";
name = "vadimcn-vscode-lldb-1.9.0";
})
]

209
home.nix
View File

@@ -1,209 +0,0 @@
{
nixpkgs,
...
}:
let
username = "Patrick";
in let
dotnet = nixpkgs.dotnet-sdk_6;
in {
imports = [./rider];
rider = {
enable = true;
username = username;
dotnet = dotnet;
};
# Let Home Manager install and manage itself.
programs.home-manager.enable = true;
# Home Manager needs a bit of information about you and the
# paths it should manage.
home.username = username;
# This value determines the Home Manager release that your
# configuration is compatible with. This helps avoid breakage
# when a new Home Manager release introduces backwards
# incompatible changes.
#
# You can update Home Manager without changing this value. See
# the Home Manager release notes for a list of state version
# changes in each release.
home.stateVersion = "22.05";
home.packages =
[
nixpkgs.rust-analyzer
nixpkgs.tmux
nixpkgs.wget
nixpkgs.youtube-dl
nixpkgs.cmake
nixpkgs.gnumake
nixpkgs.gcc
nixpkgs.gdb
nixpkgs.hledger
nixpkgs.hledger-web
dotnet
nixpkgs.docker
nixpkgs.jitsi-meet
#nixpkgs.handbrake
nixpkgs.ripgrep
nixpkgs.elan
nixpkgs.coreutils-prefixed
nixpkgs.shellcheck
nixpkgs.html-tidy
nixpkgs.hugo
#nixpkgs.agda
nixpkgs.pijul
nixpkgs.universal-ctags
nixpkgs.asciinema
nixpkgs.git-lfs
nixpkgs.imagemagick
nixpkgs.nixpkgs-fmt
nixpkgs.rnix-lsp
];
programs.vscode = {
enable = true;
package = nixpkgs.vscode;
extensions = import ./vscode-extensions.nix { pkgs = nixpkgs; };
userSettings = {
workbench.colorTheme = "Default High Contrast";
"files.Exclude" = {
"**/.git" = true;
"**/.DS_Store" = true;
"**/Thumbs.db" = true;
"**/*.olean" = true;
"**/result" = true;
};
"git.path" = "${nixpkgs.git}/bin/git";
"update.mode" = "none";
"docker.dockerPath" = "${nixpkgs.docker}/bin/docker";
#"lean.leanpkgPath" = "/Users/${username}/.elan/toolchains/stable/bin/leanpkg";
"lean.executablePath" = "/Users/${username}/.elan/toolchains/lean4/bin/lean";
"lean.memoryLimit" = 8092;
};
};
programs.tmux = {
shell = "\${nixpkgs.zsh}/bin/zsh";
};
programs.zsh = {
enable = true;
autocd = true;
enableAutosuggestions = true;
enableCompletion = true;
history = {
expireDuplicatesFirst = true;
};
oh-my-zsh = {
enable = true;
plugins = ["git" "macos" "dircycle" "timer"];
theme = "robbyrussell";
};
sessionVariables = {
EDITOR = "vim";
LC_ALL = "en_US.UTF-8";
LC_CTYPE = "en_US.UTF-8";
RUSTFLAGS = "-L ${nixpkgs.libiconv}/lib";
RUST_BACKTRACE = "full";
};
shellAliases = {
vim = "nvim";
view = "vim -R";
nix-upgrade = "sudo -i sh -c 'nix-channel --update && nix-env -iA nixpkgs.nix && launchctl remove org.nixos.nix-daemon && launchctl load /Library/LaunchDaemons/org.nixos.nix-daemon.plist'";
cmake = "cmake -DCMAKE_MAKE_PROGRAM=${nixpkgs.gnumake}/bin/make -DCMAKE_AR=${nixpkgs.darwin.cctools}/bin/ar -DCMAKE_RANLIB=${nixpkgs.darwin.cctools}/bin/ranlib -DGMP_INCLUDE_DIR=${nixpkgs.gmp.dev}/include/ -DGMP_LIBRARIES=${nixpkgs.gmp}/lib/libgmp.10.dylib";
ar = "${nixpkgs.darwin.cctools}/bin/ar";
};
};
programs.fzf = {
enable = true;
enableZshIntegration = true;
};
programs.git = {
package = nixpkgs.gitAndTools.gitFull;
enable = true;
userName = "Smaug123";
userEmail = "patrick+github@patrickstevens.co.uk";
aliases = {
co = "checkout";
st = "status";
};
extraConfig = {
rerere = {
enabled = true;
};
push = {
default = "current";
};
pull = {
rebase = false;
};
init = {
defaultBranch = "main";
};
advice = {
addIgnoredFile = false;
};
"filter \"lfs\"" = {
clean = "${nixpkgs.git-lfs} clean -- %f";
smudge = "${nixpkgs.git-lfs}/bin/git-lfs smudge --skip -- %f";
process = "${nixpkgs.git-lfs}/bin/git-lfs filter-process";
required = true;
};
pull = {
twohead = "ort";
};
};
};
programs.neovim.enable = true;
programs.neovim.plugins = with nixpkgs.vimPlugins; [
molokai
tagbar
{
plugin = rust-vim;
config = "let g:rustfmt_autosave = 1";
}
{
plugin = LanguageClient-neovim;
config = "let g:LanguageClient_serverCommands = { 'nix': ['rnix-lsp'] }";
}
{
plugin = syntastic;
config = '' let g:syntastic_rust_checkers = ['cargo']
let g:syntastic_always_populate_loc_list = 1
let g:syntastic_auto_loc_list = 1
let g:syntastic_check_on_open = 1
let g:syntastic_check_on_wq = 0'';
}
YouCompleteMe
tagbar
];
programs.neovim.viAlias = true;
programs.neovim.vimAlias = true;
programs.neovim.vimdiffAlias = true;
programs.neovim.withPython3 = true;
programs.neovim.extraConfig = builtins.readFile ./init.vim;
home.file.".ssh/config".source = ./ssh.config;
home.file.".ideavimrc".source = ./ideavimrc;
home.file.".config/youtube-dl/config".source = ./youtube-dl.conf;
programs.emacs = {
enable = true;
package = nixpkgs.emacsGcc;
extraPackages = (epkgs: []);
extraConfig = ''
(load-file (let ((coding-system-for-read 'utf-8))
(shell-command-to-string "agda-mode locate")))
'';
};
}

View File

@@ -1,16 +1,14 @@
{ pkgs }:
let my-python-packages = python-packages: with python-packages; [
pip
mathlibtools
];
{pkgs}: let
my-python-packages = python-packages:
with python-packages; [
pip
mathlibtools
];
in let
packageOverrides = self: super: {
# Test failures on darwin ("windows-1252"); just skip pytest
# (required for elan)
beautifulsoup4 = super.beautifulsoup4.overridePythonAttrs (old: {pytestCheckPhase = "true";});
};
in
let packageOverrides = self: super: {
# Test failures on darwin ("windows-1252"); just skip pytest
# (required for elan)
beautifulsoup4 = super.beautifulsoup4.overridePythonAttrs (old: { pytestCheckPhase = "true"; });
};
in
(pkgs.python3.override { inherit packageOverrides; }).withPackages my-python-packages
(pkgs.python3.override {inherit packageOverrides;}).withPackages my-python-packages

View File

@@ -1,44 +0,0 @@
{ pkgs, config, lib, ... }:
let src = ./GlobalSettingsStorage.DotSettings; in
let link = ./link.sh; in
let riderconfig =
pkgs.stdenv.mkDerivation {
name = "rider-config";
version = "2021.2";
src = src;
phases = [ "unpackPhase" ];
unpackPhase = ''
mkdir -p "$out"
cp ${src} "$out/GlobalSettingsStorage.DotSettings"
cp ${link} "$out/link.sh"
chmod u+x "$out/link.sh"
sed -i 's_NIX-DOTNET-SDK_${config.rider.dotnet}_' "$out/GlobalSettingsStorage.DotSettings"
sed -i "s!NIX-RIDER-CONFIG!$out!" "$out/link.sh"
'';
installPhase = ''
'';
};
in
{
options = {
rider.enable = lib.mkOption { default = false; };
rider.username = lib.mkOption { type = lib.types.str; example = "Patrick"; };
rider.dotnet = lib.mkOption { default = pkgs.dotnet-sdk; };
};
config = lib.mkIf config.rider.enable {
home.activation.jetbrains-rider-settings = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
dest="/Users/${config.rider.username}/Library/Application Support/JetBrains"
if [ -e "$dest" ]; then
find "$dest" -maxdepth 1 -type d -name 'Rider*' -exec sh -c '${riderconfig}/link.sh "$0"' {} \;
fi
'';
};
}

2
server-home.nix Normal file
View File

@@ -0,0 +1,2 @@
{nixpkgs, ...}: {
}

View File

@@ -1,115 +0,0 @@
{pkgs}:
with pkgs.vscode-extensions;
[
bbenoist.nix
haskell.haskell
yzhang.markdown-all-in-one
james-yu.latex-workshop
vscodevim.vim
# Not supported on Darwin, apparently
# ms-dotnettools.csharp
]
++ pkgs.vscode-utils.extensionsFromVscodeMarketplace [
{
name = "remote-containers";
publisher = "ms-vscode-remote";
version = "0.222.0";
sha256 = "4Li0sYfHOsJMn5FJtvDTGKoGPcRmoosD9tZ7q9H9DfQ=";
}
{
name = "remote-ssh";
publisher = "ms-vscode-remote";
version = "0.75.2022021903";
sha256 = "hTRfoUHKrIOSV8eZ/62ewaII5291huXjOZ++dRUmKoI=";
}
{
name = "vscode-docker";
publisher = "ms-azuretools";
version = "1.19.0";
sha256 = "UPUfTOc5xJhI5ACm2oyWqtZ4zNxZjy16D6Mf30eHFEI=";
}
{
name = "code-gnu-global";
publisher = "austin";
version = "0.2.2";
sha256 = "1fz89m6ja25aif6wszg9h2fh5vajk6bj3lp1mh0l2b04nw2mzhd5";
}
{
name = "rust-analyzer";
publisher = "matklad";
version = "0.3.939";
sha256 = "t5CCUdFCiSYrMsBHG5eOfg3sXMacFWiR0hmVa7S1i8Y=";
}
{
name = "vscode-lldb";
publisher = "vadimcn";
version = "1.6.10";
sha256 = "CGVVs//jIZM8uX7Wc9gM4aQGwECi88eIpfPqU2hKbeA=";
}
{
name = "toml";
publisher = "be5invis";
version = "0.6.0";
sha256 = "yk7buEyQIw6aiUizAm+sgalWxUibIuP9crhyBaOjC2E=";
}
{
name = "Ionide-Paket";
publisher = "Ionide";
version = "2.0.0";
sha256 = "1455zx5p0d30b1agdi1zw22hj0d3zqqglw98ga8lj1l1d757gv6v";
}
{
name = "lean";
publisher = "jroesch";
version = "0.16.46";
sha256 = "hjflz5JHVr1YWq6QI9DpdNPY1uL7lAuQTMAdwCtLEfY=";
}
{
name = "language-haskell";
publisher = "justusadam";
version = "3.4.0";
sha256 = "0ab7m5jzxakjxaiwmg0jcck53vnn183589bbxh3iiylkpicrv67y";
}
{
name = "vscode-clang";
publisher = "mitaki28";
version = "0.2.4";
sha256 = "0sys2h4jvnannlk2q02lprc2ss9nkgh0f0kwa188i7viaprpnx23";
}
{
name = "dotnet-interactive-vscode";
publisher = "ms-dotnettools";
version = "1.0.3103011";
sha256 = "a3u9NKsqHZKhZkKqJqo+LgJFTL2yhehBepTOFOXE+jY=";
}
{
name = "python";
publisher = "ms-python";
version = "2022.0.1814523869";
sha256 = "hXTVZ7gbu234zyAg0ZrZPUo6oULB98apxe79U2yQHD4=";
}
{
name = "mono-debug";
publisher = "ms-vscode";
version = "0.16.2";
sha256 = "10hixqkw5r3cg52xkbky395lv72sb9d9wrngdvmrwx62hkbk5465";
}
{
name = "Theme-MarkdownKit";
publisher = "ms-vscode";
version = "0.1.4";
sha256 = "1im78k2gaj6cri2jcvy727qdy25667v0f7vv3p3hv13apzxgzl0l";
}
{
name = "trailing-spaces";
publisher = "shardulm94";
version = "0.3.1";
sha256 = "0h30zmg5rq7cv7kjdr5yzqkkc1bs20d72yz9rjqag32gwf46s8b8";
}
{
name = "debug";
publisher = "webfreak";
version = "0.25.1";
sha256 = "1l01sv6kwh8dlv3kygkkd0z9m37hahflzd5bx1wwij5p61jg7np9";
}
]