2023-06-13 13:41:50 +00:00
|
|
|
{ pkgs, specialArgs, lib, dotfiles, ... }:
|
2023-06-09 11:31:06 +00:00
|
|
|
|
2023-06-13 13:41:50 +00:00
|
|
|
with lib;
|
2023-06-09 11:31:06 +00:00
|
|
|
let
|
2023-06-12 10:21:31 +00:00
|
|
|
textEditor = "nvim";
|
|
|
|
|
2023-06-09 11:31:06 +00:00
|
|
|
packageSets = with pkgs; rec {
|
2023-06-09 14:25:55 +00:00
|
|
|
system = [
|
|
|
|
gnutls
|
|
|
|
gsasl
|
|
|
|
libtool
|
|
|
|
patchelf
|
|
|
|
pcre
|
|
|
|
pkg-config
|
|
|
|
];
|
|
|
|
|
2023-06-09 11:31:06 +00:00
|
|
|
base = [
|
2023-06-09 14:25:55 +00:00
|
|
|
act
|
|
|
|
bat
|
|
|
|
bitwarden-cli
|
|
|
|
cloudflared
|
|
|
|
delta
|
|
|
|
exa
|
|
|
|
ffmpeg
|
|
|
|
fzf
|
|
|
|
gh
|
|
|
|
git-crypt
|
|
|
|
gitui
|
|
|
|
gnupg
|
2023-06-09 11:31:06 +00:00
|
|
|
jq
|
2023-06-09 14:25:55 +00:00
|
|
|
kubectl
|
|
|
|
kubelogin-oidc
|
|
|
|
mosh
|
|
|
|
nixpkgs-fmt
|
2023-06-12 10:00:05 +00:00
|
|
|
pandoc
|
2023-06-09 11:31:06 +00:00
|
|
|
ripgrep
|
2023-06-09 14:25:55 +00:00
|
|
|
sops
|
2023-06-12 10:00:05 +00:00
|
|
|
texlive.combined.scheme-small
|
2023-06-09 14:25:55 +00:00
|
|
|
vim
|
|
|
|
wget
|
2023-06-14 21:47:55 +00:00
|
|
|
|
|
|
|
# Fyra
|
|
|
|
glib-networking
|
|
|
|
meson
|
|
|
|
ninja
|
|
|
|
vala
|
|
|
|
desktop-file-utils
|
2023-06-09 14:25:55 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
languages = [
|
|
|
|
crystal
|
|
|
|
deno
|
|
|
|
dotnet-sdk
|
|
|
|
go
|
|
|
|
jdk
|
|
|
|
nil
|
|
|
|
nodejs_20
|
|
|
|
ruby_3_1
|
|
|
|
sbcl
|
|
|
|
shards
|
|
|
|
zig
|
2023-06-09 11:31:06 +00:00
|
|
|
];
|
|
|
|
|
2023-06-09 14:25:55 +00:00
|
|
|
programs = [
|
|
|
|
rectangle
|
|
|
|
slack
|
|
|
|
tailscale
|
|
|
|
];
|
|
|
|
|
|
|
|
multimedia = [
|
|
|
|
ffmpeg
|
|
|
|
];
|
|
|
|
|
2023-06-13 07:47:02 +00:00
|
|
|
fonts = [
|
|
|
|
nerdfonts
|
|
|
|
];
|
|
|
|
|
|
|
|
everything = system ++ base ++ languages ++ programs ++ multimedia ++ fonts;
|
2023-06-09 11:31:06 +00:00
|
|
|
};
|
|
|
|
|
2023-06-13 13:41:50 +00:00
|
|
|
# Old solution kept for posterity {{{
|
2023-06-12 10:00:23 +00:00
|
|
|
# We've got a small issue here. I tested this in a repl, and what I've
|
|
|
|
# observed is that listFilesRecursive spits out [ /full/path/to/default.nix ],
|
|
|
|
# while builtins.readDir spits out { "default.nix" = "regular"; }
|
|
|
|
# In theory, this shouldn't be much of an issue, however, when using readDir
|
|
|
|
# I would be able to do `map (n: "${./.}/${n}"), while when using
|
|
|
|
# listFilesRecursive I have to use `map (n: "${n}").
|
|
|
|
# The difference here is that when using listFilesRecursive, `n` becomes
|
|
|
|
# `/nix/store/<ID>-default.nix`, meaning it can be used as-is, but when using
|
|
|
|
# `readDir` it becomes `default.nix`, meaning the string used in the map
|
|
|
|
# callback must be `"${./.}/${n}"` to get a path to the current derivation
|
|
|
|
# where the nix file lives in.
|
|
|
|
# Currently, I am unsure of the implications of having all files separately.
|
|
|
|
# To do it "the right way" I'd obviously prefer the nix files to be children
|
|
|
|
# of the alymac derivation, but it seems that if I want my map of imports to
|
|
|
|
# be generated from the entire directory listing, it isn't going to work out.
|
|
|
|
# The solution was slightly modified from this Reddit answer:
|
|
|
|
# <https://www.reddit.com/r/NixOS/comments/j5pa9o/comment/g81dvop/>
|
|
|
|
# importMap = map
|
2023-06-13 13:41:50 +00:00
|
|
|
# (n: "${n}")
|
|
|
|
# (lib.filesystem.listFilesRecursive ./.);
|
|
|
|
# importsFiltered =
|
|
|
|
# builtins.filter
|
|
|
|
# (x: !lib.strings.hasInfix "default" x)
|
|
|
|
# importMap;
|
|
|
|
# }}}
|
|
|
|
|
|
|
|
getDir = dir: mapAttrs
|
|
|
|
(file: type:
|
|
|
|
if type == "directory" then getDir "${dir}/${file}" else type
|
|
|
|
)
|
|
|
|
(builtins.readDir dir);
|
|
|
|
|
|
|
|
files = dir: collect isString (mapAttrsRecursive
|
|
|
|
(path: type: concatStringsSep "/" path)
|
|
|
|
(getDir dir));
|
|
|
|
|
|
|
|
validFiles = dir: map
|
|
|
|
(file: ./. + "/${file}")
|
|
|
|
(filter
|
|
|
|
(file: hasSuffix ".nix" file && file != "default.nix")
|
|
|
|
(files dir));
|
2023-06-12 10:00:23 +00:00
|
|
|
|
2023-06-09 11:31:06 +00:00
|
|
|
in
|
2023-06-09 09:19:42 +00:00
|
|
|
{
|
2023-06-14 21:47:40 +00:00
|
|
|
|
|
|
|
nix = {
|
|
|
|
package = pkgs.nix;
|
|
|
|
settings = {
|
|
|
|
experimental-features = [ "nix-command" "flakes" ];
|
|
|
|
build-users-group = "nixbld";
|
|
|
|
};
|
|
|
|
gc = {
|
|
|
|
automatic = true;
|
|
|
|
options = "--delete-older-than 8d";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2023-06-09 14:25:55 +00:00
|
|
|
# Absolutely proprietary.
|
|
|
|
nixpkgs.config.allowUnfree = true;
|
2023-06-09 11:31:06 +00:00
|
|
|
|
2023-06-09 09:19:42 +00:00
|
|
|
# Make sure the nix daemon always runs
|
|
|
|
services.nix-daemon.enable = true;
|
2023-06-09 11:31:06 +00:00
|
|
|
|
|
|
|
# enable the gpg agent by default
|
|
|
|
programs.gnupg.agent.enable = true;
|
2023-06-09 10:47:29 +00:00
|
|
|
|
2023-06-09 11:30:06 +00:00
|
|
|
# if you use zsh (the default on new macOS installations),
|
|
|
|
# you'll need to enable this so nix-darwin creates a zshrc sourcing needed environment changes
|
|
|
|
programs.zsh.enable = true;
|
|
|
|
|
2023-06-09 11:31:06 +00:00
|
|
|
# Make sure to set the correct values, or everything will break! (in reality,
|
|
|
|
# it will just not build)
|
2023-06-09 10:44:49 +00:00
|
|
|
users.users.alyxia = {
|
|
|
|
name = "alyxia";
|
|
|
|
home = "/Users/alyxia";
|
|
|
|
};
|
2023-06-09 09:19:42 +00:00
|
|
|
|
2023-06-09 10:47:04 +00:00
|
|
|
home-manager = {
|
|
|
|
useGlobalPkgs = true;
|
|
|
|
useUserPackages = true;
|
2023-06-12 10:00:23 +00:00
|
|
|
extraSpecialArgs = { inherit dotfiles; };
|
2023-06-09 10:47:04 +00:00
|
|
|
users.alyxia = { pkgs, ... }: {
|
2023-06-13 13:41:50 +00:00
|
|
|
# Defined further above, generates a list of files to import.
|
|
|
|
imports = validFiles ./.;
|
2023-06-09 16:25:33 +00:00
|
|
|
|
2023-06-09 11:31:06 +00:00
|
|
|
home = {
|
|
|
|
packages = packageSets.everything;
|
2023-06-12 10:21:31 +00:00
|
|
|
sessionVariables = {
|
|
|
|
EDITOR = textEditor;
|
|
|
|
};
|
2023-06-09 21:04:58 +00:00
|
|
|
|
|
|
|
file.".npmrc".text = ''
|
|
|
|
prefix = ''${HOME}/.npm-packages
|
|
|
|
'';
|
2023-06-09 11:31:06 +00:00
|
|
|
};
|
|
|
|
|
2023-06-09 10:47:04 +00:00
|
|
|
# DO NOT CHANGE UNLESS YOU ARE ABSOLUTELY SURE ALL STATE AFFECTED BY THIS
|
|
|
|
# OPTION IS APPROPRIATELY MIGRATED!!!
|
|
|
|
home.stateVersion = "23.05"; # did you read the comment?
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2023-06-09 09:19:42 +00:00
|
|
|
homebrew = {
|
|
|
|
enable = true;
|
|
|
|
onActivation = {
|
|
|
|
autoUpdate = true;
|
2023-06-09 14:25:55 +00:00
|
|
|
cleanup = "zap";
|
2023-06-09 09:19:42 +00:00
|
|
|
upgrade = true;
|
|
|
|
};
|
2023-06-09 14:25:55 +00:00
|
|
|
|
|
|
|
taps = [
|
|
|
|
"drud/ddev"
|
|
|
|
"homebrew/cask"
|
|
|
|
"homebrew/cask-versions"
|
|
|
|
];
|
|
|
|
|
|
|
|
# Please do not the brew.
|
|
|
|
brews = [
|
|
|
|
"composer"
|
|
|
|
"croc"
|
|
|
|
"ddev"
|
|
|
|
"mkcert"
|
2023-06-09 14:46:44 +00:00
|
|
|
"pinentry-mac"
|
2023-06-09 14:25:55 +00:00
|
|
|
"pkg-config"
|
|
|
|
"sdl2"
|
2023-06-14 21:47:55 +00:00
|
|
|
|
|
|
|
# Fyra crap, but from Homebrew because someone doesn't know how to
|
|
|
|
# package libraries in nixpkgs
|
|
|
|
"appstream-glib"
|
|
|
|
"glib"
|
|
|
|
"gobject-introspection"
|
|
|
|
"gsettings-desktop-schemas"
|
|
|
|
"gtk4"
|
|
|
|
"gtksourceview5"
|
|
|
|
"libgee"
|
2023-06-09 14:25:55 +00:00
|
|
|
];
|
|
|
|
|
2023-06-09 09:19:42 +00:00
|
|
|
casks = [
|
2023-06-09 14:25:55 +00:00
|
|
|
"1password"
|
|
|
|
"1password-cli"
|
|
|
|
"alt-tab"
|
|
|
|
"android-studio"
|
|
|
|
"audacity"
|
|
|
|
"background-music"
|
|
|
|
"db-browser-for-sqlite"
|
2023-06-09 09:19:42 +00:00
|
|
|
"discord"
|
2023-06-09 14:25:55 +00:00
|
|
|
"discord-ptb"
|
|
|
|
"docker"
|
|
|
|
"firefox"
|
2023-06-15 08:14:27 +00:00
|
|
|
"goland"
|
2023-06-09 14:25:55 +00:00
|
|
|
"google-chrome"
|
2023-06-15 08:14:27 +00:00
|
|
|
"intellij-idea"
|
2023-06-09 14:25:55 +00:00
|
|
|
"itch"
|
|
|
|
"iterm2"
|
|
|
|
"obs"
|
2023-06-15 08:14:27 +00:00
|
|
|
"phpstorm"
|
2023-06-13 13:41:50 +00:00
|
|
|
"plexamp"
|
2023-06-09 14:25:55 +00:00
|
|
|
"raycast"
|
2023-06-15 08:14:27 +00:00
|
|
|
"rider"
|
2023-06-09 14:25:55 +00:00
|
|
|
"sequel-ace"
|
|
|
|
"shottr"
|
|
|
|
"spotify"
|
|
|
|
"thunderbird"
|
|
|
|
"visual-studio-code"
|
2023-06-09 09:19:42 +00:00
|
|
|
];
|
|
|
|
};
|
|
|
|
}
|