alejandra fmt and some cleanup

try-kitty
htran 2023-06-18 02:51:33 -07:00
parent e62e724c4d
commit 024e8530d0
13 changed files with 358 additions and 403 deletions

View File

@ -48,9 +48,9 @@
},
"crane": {
"inputs": {
"flake-compat": "flake-compat_4",
"flake-compat": "flake-compat_3",
"flake-utils": "flake-utils_3",
"nixpkgs": "nixpkgs_3",
"nixpkgs": "nixpkgs_2",
"rust-overlay": "rust-overlay"
},
"locked": {
@ -69,7 +69,7 @@
},
"crane_2": {
"inputs": {
"flake-compat": "flake-compat_6",
"flake-compat": "flake-compat_5",
"flake-utils": "flake-utils_7",
"nixpkgs": [
"nix-boost",
@ -95,7 +95,7 @@
},
"crane_3": {
"inputs": {
"flake-compat": "flake-compat_7",
"flake-compat": "flake-compat_6",
"flake-utils": "flake-utils_9",
"nixpkgs": [
"std",
@ -118,26 +118,6 @@
"type": "github"
}
},
"deploy-rs": {
"inputs": {
"flake-compat": "flake-compat",
"nixpkgs": "nixpkgs",
"utils": "utils"
},
"locked": {
"lastModified": 1686747123,
"narHash": "sha256-XUQK9kwHpTeilHoad7L4LjMCCyY13Oq383CoFADecRE=",
"owner": "serokell",
"repo": "deploy-rs",
"rev": "724463b5a94daa810abfc64a4f87faef4e00f984",
"type": "github"
},
"original": {
"owner": "serokell",
"repo": "deploy-rs",
"type": "github"
}
},
"devshell": {
"inputs": {
"nixpkgs": [
@ -250,7 +230,7 @@
},
"fenix": {
"inputs": {
"nixpkgs": "nixpkgs_9",
"nixpkgs": "nixpkgs_8",
"rust-analyzer-src": "rust-analyzer-src"
},
"locked": {
@ -269,7 +249,7 @@
},
"fenix_2": {
"inputs": {
"nixpkgs": "nixpkgs_13",
"nixpkgs": "nixpkgs_12",
"rust-analyzer-src": "rust-analyzer-src_2"
},
"locked": {
@ -289,11 +269,11 @@
"flake-compat": {
"flake": false,
"locked": {
"lastModified": 1668681692,
"narHash": "sha256-Ht91NGdewz8IQLtWZ9LCeNXMSXHUss+9COoqu6JLmXU=",
"lastModified": 1673956053,
"narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "009399224d5e398d03b22badca40a37ac85412a1",
"rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9",
"type": "github"
},
"original": {
@ -382,22 +362,6 @@
"type": "github"
}
},
"flake-compat_7": {
"flake": false,
"locked": {
"lastModified": 1673956053,
"narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-parts": {
"inputs": {
"nixpkgs-lib": [
@ -645,8 +609,8 @@
},
"gomod2nix": {
"inputs": {
"nixpkgs": "nixpkgs_4",
"utils": "utils_2"
"nixpkgs": "nixpkgs_3",
"utils": "utils"
},
"locked": {
"lastModified": 1677459247,
@ -680,7 +644,7 @@
},
"haumea": {
"inputs": {
"nixpkgs": "nixpkgs_7"
"nixpkgs": "nixpkgs_6"
},
"locked": {
"lastModified": 1685133229,
@ -699,7 +663,7 @@
},
"haumea_2": {
"inputs": {
"nixpkgs": "nixpkgs_11"
"nixpkgs": "nixpkgs_10"
},
"locked": {
"lastModified": 1685133229,
@ -721,7 +685,7 @@
"flake-parts": "flake-parts_3",
"haskell-flake": "haskell-flake",
"nix-darwin": "nix-darwin",
"nixpkgs": "nixpkgs_2",
"nixpkgs": "nixpkgs",
"pre-commit-hooks-nix": "pre-commit-hooks-nix"
},
"locked": {
@ -919,7 +883,7 @@
},
"neovim-nightly-overlay": {
"inputs": {
"flake-compat": "flake-compat_2",
"flake-compat": "flake-compat",
"flake-parts": "flake-parts",
"hercules-ci-effects": "hercules-ci-effects",
"neovim-flake": "neovim-flake",
@ -946,10 +910,10 @@
"inputs": {
"cargo-leptos": "cargo-leptos",
"crane": "crane",
"flake-compat": "flake-compat_5",
"flake-compat": "flake-compat_4",
"gnmic": "gnmic",
"gomod2nix": "gomod2nix",
"nixpkgs": "nixpkgs_5",
"nixpkgs": "nixpkgs_4",
"poetry2nix": "poetry2nix",
"rust-overlay": "rust-overlay_2",
"std": "std"
@ -1075,27 +1039,27 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1671417167,
"narHash": "sha256-JkHam6WQOwZN1t2C2sbp1TqMv3TVRjzrdoejqfefwrM=",
"lastModified": 1678293141,
"narHash": "sha256-lLlQHaR0y+q6nd6kfpydPTGHhl1rS9nU9OQmztzKOYs=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "bb31220cca6d044baa6dc2715b07497a2a7c4bc7",
"rev": "c90c4025bb6e0c4eaf438128a3b2640314b1c58d",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-latest": {
"locked": {
"lastModified": 1687069865,
"narHash": "sha256-+JcVIxijVccnSnbGl8INEKkRo3GzHZ7iBm4EZ2MC1O8=",
"lastModified": 1687079694,
"narHash": "sha256-x3YujFqPUWj9TvuFEZthr++xzzOmMYPaoSDSuzqUDnc=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "5630d719e9e90f66f9eaa4a2d00b303dbee9f4c3",
"rev": "30c0a2f73819cc71ff5ff270f6ae4aaafaf954ea",
"type": "github"
},
"original": {
@ -1139,22 +1103,6 @@
}
},
"nixpkgs_10": {
"locked": {
"lastModified": 1686960236,
"narHash": "sha256-AYCC9rXNLpUWzD9hm+askOfpliLEC9kwAo7ITJc4HIw=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "04af42f3b31dba0ef742d254456dc4c14eedac86",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_11": {
"locked": {
"lastModified": 1681001314,
"narHash": "sha256-5sDnCLdrKZqxLPK4KA8+f4A3YKO/u6ElpMILvX0g72c=",
@ -1169,7 +1117,7 @@
"type": "github"
}
},
"nixpkgs_12": {
"nixpkgs_11": {
"locked": {
"lastModified": 1675940568,
"narHash": "sha256-epG6pOT9V0kS+FUqd7R6/CWkgnZx2DMT5Veqo+y6G3c=",
@ -1185,7 +1133,7 @@
"type": "github"
}
},
"nixpkgs_13": {
"nixpkgs_12": {
"locked": {
"lastModified": 1677063315,
"narHash": "sha256-qiB4ajTeAOVnVSAwCNEEkoybrAlA+cpeiBxLobHndE8=",
@ -1202,22 +1150,6 @@
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1678293141,
"narHash": "sha256-lLlQHaR0y+q6nd6kfpydPTGHhl1rS9nU9OQmztzKOYs=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "c90c4025bb6e0c4eaf438128a3b2640314b1c58d",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_3": {
"locked": {
"lastModified": 1685714850,
"narHash": "sha256-OcvbIJq4CGwwFr9m7M/SQcDPZ64hhR4t77oZgEeh7ZY=",
@ -1233,7 +1165,7 @@
"type": "github"
}
},
"nixpkgs_4": {
"nixpkgs_3": {
"locked": {
"lastModified": 1658285632,
"narHash": "sha256-zRS5S/hoeDGUbO+L95wXG9vJNwsSYcl93XiD0HQBXLk=",
@ -1249,7 +1181,7 @@
"type": "github"
}
},
"nixpkgs_5": {
"nixpkgs_4": {
"locked": {
"lastModified": 1686960236,
"narHash": "sha256-AYCC9rXNLpUWzD9hm+askOfpliLEC9kwAo7ITJc4HIw=",
@ -1265,7 +1197,7 @@
"type": "github"
}
},
"nixpkgs_6": {
"nixpkgs_5": {
"locked": {
"lastModified": 1681358109,
"narHash": "sha256-eKyxW4OohHQx9Urxi7TQlFBTDWII+F+x2hklDOQPB50=",
@ -1281,7 +1213,7 @@
"type": "github"
}
},
"nixpkgs_7": {
"nixpkgs_6": {
"locked": {
"lastModified": 1681001314,
"narHash": "sha256-5sDnCLdrKZqxLPK4KA8+f4A3YKO/u6ElpMILvX0g72c=",
@ -1296,7 +1228,7 @@
"type": "github"
}
},
"nixpkgs_8": {
"nixpkgs_7": {
"locked": {
"lastModified": 1675940568,
"narHash": "sha256-epG6pOT9V0kS+FUqd7R6/CWkgnZx2DMT5Veqo+y6G3c=",
@ -1312,7 +1244,7 @@
"type": "github"
}
},
"nixpkgs_9": {
"nixpkgs_8": {
"locked": {
"lastModified": 1677063315,
"narHash": "sha256-qiB4ajTeAOVnVSAwCNEEkoybrAlA+cpeiBxLobHndE8=",
@ -1328,6 +1260,22 @@
"type": "github"
}
},
"nixpkgs_9": {
"locked": {
"lastModified": 1686960236,
"narHash": "sha256-AYCC9rXNLpUWzD9hm+askOfpliLEC9kwAo7ITJc4HIw=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "04af42f3b31dba0ef742d254456dc4c14eedac86",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nosys": {
"locked": {
"lastModified": 1668010795,
@ -1591,7 +1539,7 @@
},
"pre-commit-hooks-nix": {
"inputs": {
"flake-compat": "flake-compat_3",
"flake-compat": "flake-compat_2",
"flake-utils": "flake-utils",
"gitignore": "gitignore",
"nixpkgs": [
@ -1618,13 +1566,12 @@
},
"root": {
"inputs": {
"deploy-rs": "deploy-rs",
"home-manager": "home-manager",
"kpcli-py": "kpcli-py",
"neovim-nightly-overlay": "neovim-nightly-overlay",
"nix-boost": "nix-boost",
"nix-index-database": "nix-index-database",
"nixpkgs": "nixpkgs_10",
"nixpkgs": "nixpkgs_9",
"nixpkgs-latest": "nixpkgs-latest",
"std": "std_2"
}
@ -1693,7 +1640,7 @@
"rust-overlay_2": {
"inputs": {
"flake-utils": "flake-utils_5",
"nixpkgs": "nixpkgs_6"
"nixpkgs": "nixpkgs_5"
},
"locked": {
"lastModified": 1687055571,
@ -1794,7 +1741,7 @@
],
"n2c": "n2c",
"nixago": "nixago",
"nixpkgs": "nixpkgs_8",
"nixpkgs": "nixpkgs_7",
"paisano": "paisano",
"paisano-mdbook-preprocessor": "paisano-mdbook-preprocessor",
"paisano-tui": "paisano-tui",
@ -1836,7 +1783,7 @@
],
"n2c": "n2c_2",
"nixago": "nixago_2",
"nixpkgs": "nixpkgs_12",
"nixpkgs": "nixpkgs_11",
"paisano": "paisano_2",
"paisano-mdbook-preprocessor": "paisano-mdbook-preprocessor_2",
"paisano-tui": "paisano-tui_2",
@ -1932,21 +1879,6 @@
}
},
"utils": {
"locked": {
"lastModified": 1667395993,
"narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"utils_2": {
"locked": {
"lastModified": 1653893745,
"narHash": "sha256-0jntwV3Z8//YwuOjzhV2sgJJPt+HY6KhU7VZUL0fKZQ=",

View File

@ -8,7 +8,7 @@
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
nixpkgs-latest.url = "github:nixos/nixpkgs";
deploy-rs.url = "github:serokell/deploy-rs";
# deploy-rs.url = "github:serokell/deploy-rs";
std.url = "github:divnix/std";
home-manager = {
url = "github:nix-community/home-manager";
@ -33,7 +33,11 @@
};
};
outputs = {self, std, ...} @ inputs:
outputs = {
self,
std,
...
} @ inputs:
std.growOn
{
# boilerplate

View File

@ -1,4 +1,5 @@
# TODO: vim-plug and Mason supports laziness. Probably worth it to explore incremental dependencies based on the project TODO: just install these things, then symlink to mason's bin directory
# TODO: vim-plug and Mason supports laziness. Probably worth it to explore incremental dependencies based on the project
# TODO: just install these things, then symlink to mason's bin directory
#
# One thing to consider, though, /nix/store of `nix-shell` or `nix-develop`
# might be different from `home-manager`'s (~/.nix_profile/bin/jq)
@ -15,14 +16,6 @@
# see: :/--suffix.*PATH
# there should be mentions of additional packages
my_neovim = pkgs.neovim-unwrapped;
rust_pkgs =
pkgs.rust-bin.selectLatestNightlyWith
(
toolchain:
toolchain.default.override {
extensions = ["rust-src" "rust-analyzer" "rust-docs" "rustfmt" "clippy" "miri"];
}
);
nvim_pkgs =
[
# pkgs.gccStdenv

View File

@ -20,5 +20,4 @@ in {
});
});
};
}

View File

@ -8,8 +8,13 @@
pkgs = inputs.nixpkgs;
# hm is derivation that is compatible with homeConfigurations
home-config = {supported_systems, hm, tested_systems ? []}:
hm // {
home-config = {
supported_systems,
hm,
tested_systems ? [],
}:
hm
// {
_supported_systems = supported_systems;
_tested_systems = tested_systems;
};
@ -19,7 +24,7 @@
# home-profiles.git
home-profiles.ssh
home-profiles.shells
({config.programs.home-manager.enable = true;})
{config.programs.home-manager.enable = true;}
home-profiles.nix-index
home-profiles.neovim
];
@ -29,18 +34,20 @@ in {
tested_systems = ["aarch64-darwin"];
hm = home-manager.lib.homeManagerConfiguration {
inherit pkgs;
modules = base-modules ++ [
modules =
base-modules
++ [
home-profiles.nerd_font_module
home-profiles.git-htran
home-profiles.dev-packages
home-profiles.zk
home-modules.darwin-spotlight
({
{
home.username = "htran";
home.homeDirectory = "/Users/htran";
home.stateVersion = "23.11";
})
}
];
};
};

View File

@ -1,14 +1,18 @@
# This is an interface for home-profiles and should not contain opinionated
# configurations. It should provide alternative configurations, aggregates
# or new configurations
_imports@{ inputs, cell }:
let
_imports @ {
inputs,
cell,
}: let
namespace = "repo";
imports = _imports // {inherit namespace;};
in
{
git = { config, lib, ... }:
let
in {
git = {
config,
lib,
...
}: let
cfg = config."${namespace}".git;
baseAliases = {
a = "add";
@ -23,8 +27,7 @@ in
};
default-user = "Pegasust";
default-email = "pegasucksgg@gmail.com";
in
{
in {
options."${namespace}".git = {
aliases = lib.mkOption {
type = lib.types.attrs;
@ -91,12 +94,14 @@ in
};
};
alacritty = { config, lib, ... }:
let
alacritty = {
config,
lib,
...
}: let
inherit (inputs.cells.repo.lib) fromYAML;
cfg = config."${namespace}".alacritty;
in
{
in {
options."${namespace}".alacritty = {
font.family = lib.mkOption {
type = lib.types.nullOr lib.types.singleLineStr;
@ -131,10 +136,11 @@ in
};
config.programs.alacritty = {
enable = cfg.enable;
settings =
let
settings = let
actualConfig =
if cfg.config-path != null then fromYAML (builtins.readFile cfg.config-path) else { };
if cfg.config-path != null
then fromYAML (builtins.readFile cfg.config-path)
else {};
in
lib.recursiveUpdate actualConfig {
font.normal.family = lib.mkIf (cfg.font.family != null) cfg.font.family;
@ -144,11 +150,14 @@ in
};
# TODO: chromium is not really supported on darwin
private_chromium = { config, pkgs, lib, ... }:
let
private_chromium = {
config,
pkgs,
lib,
...
}: let
cfg = config."${namespace}".private_chromium;
in
{
in {
options."${namespace}".private_chromium = {
enable = lib.mkOption {
type = lib.types.bool;
@ -164,26 +173,29 @@ in
programs.chromium = {
enable = true;
package = pkgs.ungoogled-chromium;
extensions =
let
extensions = let
# TODO: how about a chrome extension registry?
mkChromiumExtForVersion = browserVersion: { id, sha256, extVersion, ... }:
{
mkChromiumExtForVersion = browserVersion: {
id,
sha256,
extVersion,
...
}: {
inherit id;
crxPath = builtins.fetchurl {
url = "https://clients2.google.com/service/update2/crx" +
"?response=redirect" +
"&acceptformat=crx2,crx3" +
"&prodversion=${browserVersion}" +
"&x=id%3D${id}%26installsource%3Dondemand%26uc";
url =
"https://clients2.google.com/service/update2/crx"
+ "?response=redirect"
+ "&acceptformat=crx2,crx3"
+ "&prodversion=${browserVersion}"
+ "&x=id%3D${id}%26installsource%3Dondemand%26uc";
name = "${id}.crx";
inherit sha256;
};
version = extVersion;
};
mkChromiumExt = mkChromiumExtForVersion (lib.versions.major pkgs.ungoogled-chromium.version);
in
[
in [
# vimium
(mkChromiumExt {
id = "dbepggeogbaibhgnhhndojpepiihcmeb";
@ -195,7 +207,12 @@ in
};
};
darwin-spotlight = { lib, pkgs, config, ... }: {
darwin-spotlight = {
lib,
pkgs,
config,
...
}: {
# This patch exists since Darwin's search bar requires solid apps and not
# symlinked
# TODO: QA
@ -207,8 +224,8 @@ in
# Copy GUI apps to "~/Applications/Home Manager Apps"
# Based on this comment: https://github.com/nix-community/home-manager/issues/1341#issuecomment-778820334
home.activation.patch-spotlight =
if pkgs.stdenv.isDarwin then
let
if pkgs.stdenv.isDarwin
then let
apps = pkgs.buildEnv {
name = "home-manager-applications";
paths = config.home.packages;
@ -229,12 +246,12 @@ in
$DRY_RUN_CMD cp --archive -H --dereference ${apps}/Applications/* "$HM_APPS"
$DRY_RUN_CMD chmod +w -R "$HM_APPS"
''
else
"";
else "";
# We need this in case upstream home-manager changes the behavior of linking
# applications
home.activation.remove-patch-spotlight =
if pkgs.stdenv.isDarwin then
if pkgs.stdenv.isDarwin
then
lib.hm.dag.entryBefore ["checkLinkTargets"] ''
HM_APPS="$HOME/Applications/Home Manager Apps"
# Reset current state
@ -242,9 +259,6 @@ in
$DRY_RUN_CMD mv "$HM_APPS" "$HM_APPS.$(date +%Y%m%d%H%M%S)"
fi
''
else
"";
else "";
};
}

View File

@ -163,7 +163,9 @@ in {
};
};
dev-packages = let pkgs = inputs.nixpkgs; in {
dev-packages = let
pkgs = inputs.nixpkgs;
in {
programs.jq.enable = true;
home.packages = [
pkgs.htop

View File

@ -1,16 +1,20 @@
{ inputs, cell }:
let
{
inputs,
cell,
}: let
namespace = "repo"; # ignore: unused
yamlToJsonDrv = pkgs: yamlContent: outputPath: (pkgs.runCommand
outputPath
{ inherit yamlContent; nativeBuildInputs = [ pkgs.yq ]; }
{
inherit yamlContent;
nativeBuildInputs = [pkgs.yq];
}
# run yq which outputs '.' (no filter) on file at yamlPath
# note that $out is passed onto the bash/sh script for execution
''
echo "$yamlContent" | yq >$out
'');
in
{
in {
fromYAML = yamlContent: builtins.fromJSON (builtins.readFile (yamlToJsonDrv inputs.nixpkgs yamlContent "fromYaml.json"));
}

View File

@ -1 +0,0 @@

View File

@ -15,7 +15,8 @@
flake-utils,
nixpkgs,
}:
with flake-utils; lib.eachSystem lib.defaultSystems (sys: let
with flake-utils;
lib.eachSystem lib.defaultSystems (sys: let
overlays = [turbo.overlay];
# pkgs is our tweaked nixpkgs
pkgs = import nixpkgs {