1
0
Fork 0
mirror of https://github.com/ryanccn/flake.git synced 2025-12-06 08:10:43 +01:00

treewide: refactor, nix, overlays -> packages

This commit is contained in:
Ryan Cao 2024-11-12 13:56:54 +08:00
parent d6238e12af
commit eb6b664802
Signed by: ryanccn
GPG key ID: 48C96B2057D71CB1
23 changed files with 240 additions and 308 deletions

165
flake.lock generated
View file

@ -10,11 +10,11 @@
]
},
"locked": {
"lastModified": 1726126496,
"narHash": "sha256-HJiUol162f37QXVVRLdkleT79K0UXKzXjZdc/WRKJHs=",
"lastModified": 1731138670,
"narHash": "sha256-jZ+ZkjdCCQv9t31q31ZYx3X7VxynYUPltF9gmMigaB4=",
"owner": "ryanccn",
"repo": "am",
"rev": "9ae1b880aa0a67503bc34aebbd908e718acd1ca3",
"rev": "1d086d84e8dc0e133e275fe4b5dd84a8001fb66b",
"type": "github"
},
"original": {
@ -25,11 +25,11 @@
},
"catppuccin": {
"locked": {
"lastModified": 1725509983,
"narHash": "sha256-NHCgHVqumPraFJnLrkanoLDuhOoUHUvRhvp/RIHJR+A=",
"lastModified": 1731232837,
"narHash": "sha256-0aIwr/RC/oe7rYkfJb47xjdEQDSNcqpFGsEa+EPlDEs=",
"owner": "catppuccin",
"repo": "nix",
"rev": "45745fe5960acaefef2b60f3455bcac6a0ca6bc9",
"rev": "32359bf226fe874d3b7a0a5753d291a4da9616fe",
"type": "github"
},
"original": {
@ -53,39 +53,6 @@
"type": "github"
}
},
"flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1710146030,
"narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flakey-profile": {
"locked": {
"lastModified": 1712898590,
"narHash": "sha256-FhGIEU93VHAChKEXx905TSiPZKga69bWl1VB37FK//I=",
"owner": "lf-",
"repo": "flakey-profile",
"rev": "243c903fd8eadc0f63d205665a92d4df91d42d9d",
"type": "github"
},
"original": {
"owner": "lf-",
"repo": "flakey-profile",
"type": "github"
}
},
"home-manager": {
"inputs": {
"nixpkgs": [
@ -93,11 +60,11 @@
]
},
"locked": {
"lastModified": 1726785354,
"narHash": "sha256-SLorVhoorZwjM1aS04bBX4fufEXIfkMdAGkj9bu2QAQ=",
"lastModified": 1731235328,
"narHash": "sha256-NjavpgE9/bMe/ABvZpyHIUeYF1mqR5lhaep3wB79ucs=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "1786e2afdbc48e9038f7cff585069736e1d0ed44",
"rev": "60bb110917844d354f3c18e05450606a435d2d10",
"type": "github"
},
"original": {
@ -106,41 +73,6 @@
"type": "github"
}
},
"lix": {
"flake": false,
"locked": {
"lastModified": 1723503926,
"narHash": "sha256-Rosl9iA9MybF5Bud4BTAQ9adbY81aGmPfV8dDBGl34s=",
"rev": "bcaeb6388b8916ac6d1736e3aa2b13313e6a6bd2",
"type": "tarball",
"url": "https://git.lix.systems/api/v1/repos/lix-project/lix/archive/bcaeb6388b8916ac6d1736e3aa2b13313e6a6bd2.tar.gz?rev=bcaeb6388b8916ac6d1736e3aa2b13313e6a6bd2"
},
"original": {
"type": "tarball",
"url": "https://git.lix.systems/lix-project/lix/archive/2.91.0.tar.gz"
}
},
"lix-module": {
"inputs": {
"flake-utils": "flake-utils",
"flakey-profile": "flakey-profile",
"lix": "lix",
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1723510904,
"narHash": "sha256-zNW/rqNJwhq2lYmQf19wJerRuNimjhxHKmzrWWFJYts=",
"rev": "622a2253a071a1fb97a4d3c8103a91114acc1140",
"type": "tarball",
"url": "https://git.lix.systems/api/v1/repos/lix-project/nixos-module/archive/622a2253a071a1fb97a4d3c8103a91114acc1140.tar.gz?rev=622a2253a071a1fb97a4d3c8103a91114acc1140"
},
"original": {
"type": "tarball",
"url": "https://git.lix.systems/lix-project/nixos-module/archive/2.91.0.tar.gz"
}
},
"morlana": {
"inputs": {
"nix-filter": [
@ -151,11 +83,11 @@
]
},
"locked": {
"lastModified": 1726541181,
"narHash": "sha256-JnEtDtMj3hajOfmWbcXyiKbkorFIFRMsYvWnPNj3y58=",
"lastModified": 1731144068,
"narHash": "sha256-3unl0edCutqvxQ5Wf00oiI/DgX/qJily5hBIgPnNWoY=",
"owner": "ryanccn",
"repo": "morlana",
"rev": "6b508d33b4b72a0fb0d2ec09af4cf3094e20d070",
"rev": "c3370463b96850d28db6103f756f1e242d796cc8",
"type": "github"
},
"original": {
@ -171,11 +103,11 @@
]
},
"locked": {
"lastModified": 1726742753,
"narHash": "sha256-QclpWrIFIg/yvWRiOUaMp1WR+TGUE9tb7RE31xHlxWc=",
"lastModified": 1731153869,
"narHash": "sha256-3Ftf9oqOypcEyyrWJ0baVkRpvQqroK/SVBFLvU3nPuc=",
"owner": "LnL7",
"repo": "nix-darwin",
"rev": "c03f85fa42d68d1056ca1740f3113b04f3addff2",
"rev": "5c74ab862c8070cbf6400128a1b56abb213656da",
"type": "github"
},
"original": {
@ -186,11 +118,11 @@
},
"nix-filter": {
"locked": {
"lastModified": 1710156097,
"narHash": "sha256-1Wvk8UP7PXdf8bCCaEoMnOT1qe5/Duqgj+rL8sRQsSM=",
"lastModified": 1730207686,
"narHash": "sha256-SCHiL+1f7q9TAnxpasriP6fMarWE5H43t25F5/9e28I=",
"owner": "numtide",
"repo": "nix-filter",
"rev": "3342559a24e85fc164b295c3444e8a139924675b",
"rev": "776e68c1d014c3adde193a18db9d738458cd2ba4",
"type": "github"
},
"original": {
@ -206,11 +138,11 @@
]
},
"locked": {
"lastModified": 1726449931,
"narHash": "sha256-1AX7MyYzP7sNgZiGF8jwehCCI75y2kBGwACeryJs+yE=",
"lastModified": 1731209121,
"narHash": "sha256-BF7FBh1hIYPDihdUlImHGsQzaJZVLLfYqfDx41wjuF0=",
"owner": "nix-community",
"repo": "nix-index-database",
"rev": "c1b0fa0bec5478185eae2fd3f39b9e906fc83995",
"rev": "896019f04b22ce5db4c0ee4f89978694f44345c3",
"type": "github"
},
"original": {
@ -221,11 +153,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1726583932,
"narHash": "sha256-zACxiQx8knB3F8+Ze+1BpiYrI+CbhxyWpcSID9kVhkQ=",
"lastModified": 1730958623,
"narHash": "sha256-JwQZIGSYnRNOgDDoIgqKITrPVil+RMWHsZH1eE1VGN0=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "658e7223191d2598641d50ee4e898126768fe847",
"rev": "85f7e662eda4fa3a995556527c87b2524b691933",
"type": "github"
},
"original": {
@ -245,11 +177,11 @@
]
},
"locked": {
"lastModified": 1726542944,
"narHash": "sha256-nciuxw8aWKEJV/bI6FE0sfWBcrzrqDKKjXUrYcvBPOA=",
"lastModified": 1731251221,
"narHash": "sha256-eGPJzmVALvAUi73l7n+oZXEJl8eOK4Xnp3RK4LTZvk8=",
"owner": "ryanccn",
"repo": "nrr",
"rev": "a30318ebcd6cd74ee1e87edc3c92772db83dd1d4",
"rev": "6858072eb9bef36ebd558883b102d1e9252bb299",
"type": "github"
},
"original": {
@ -260,16 +192,19 @@
},
"nyoom": {
"inputs": {
"nix-filter": [
"nix-filter"
],
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1725406938,
"narHash": "sha256-jOUqvLEO0SxUhBiGNq0J1lrLdkqfrngIpsiXZUM8R/c=",
"lastModified": 1731123626,
"narHash": "sha256-AoNxSBEEP/JsApHr91HhO8fUczNbbSDsSzvyeAdYQak=",
"owner": "ryanccn",
"repo": "nyoom",
"rev": "63e9c00ebc4d838303d6398970c3dc1407c1fc28",
"rev": "c902d9c2a3a8bc343f068bd914fee716a3ccb5b9",
"type": "github"
},
"original": {
@ -281,11 +216,11 @@
"ohmyzsh": {
"flake": false,
"locked": {
"lastModified": 1726739091,
"narHash": "sha256-F/SvOTDxfNI4ekdjXCmMlwiJyy8lzQH6Q27oApfHQe4=",
"lastModified": 1730644558,
"narHash": "sha256-rduWnGus/kiRk4qDnR9ifwZb+PnPPCs+aWHhT+M55WQ=",
"owner": "ohmyzsh",
"repo": "ohmyzsh",
"rev": "1514145a09140425b914e9cd98fc1d638a8c4003",
"rev": "7ed475cb589c9e82211f71b3a5d7083b69cea93c",
"type": "github"
},
"original": {
@ -300,7 +235,6 @@
"catppuccin": "catppuccin",
"darwin-custom-icons": "darwin-custom-icons",
"home-manager": "home-manager",
"lix-module": "lix-module",
"morlana": "morlana",
"nix-darwin": "nix-darwin",
"nix-filter": "nix-filter",
@ -321,11 +255,11 @@
]
},
"locked": {
"lastModified": 1726799228,
"narHash": "sha256-wn1leQyMAc/TrLRKcPc0GX6YtoziKQpc/MtZjPNiJ2Q=",
"lastModified": 1731378398,
"narHash": "sha256-a0QWaiX8+AJ9/XBLGMDy6c90GD7HzpxKVdlFwCke5Pw=",
"owner": "oxalica",
"repo": "rust-overlay",
"rev": "ab150c7412db7bea5879ce2776718f53fba37aa2",
"rev": "0ae9fc2f2fe5361837d59c0bdebbda176427111e",
"type": "github"
},
"original": {
@ -344,11 +278,11 @@
]
},
"locked": {
"lastModified": 1726313584,
"narHash": "sha256-R0DjdtepVaXVnEudrfGADjUzugxGeqxorF1LFjBb98U=",
"lastModified": 1730974437,
"narHash": "sha256-qRE1YPO1vmvEnt8Re+9Fhj/wLzum27dqnuYDRKnUErc=",
"owner": "ryanccn",
"repo": "spdx-gen",
"rev": "c890f777c211a8fbe30777f8f4ab6434b6106cac",
"rev": "85245f610b7c7341dde620db2608e5b21f9438b7",
"type": "github"
},
"original": {
@ -357,21 +291,6 @@
"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"
}
},
"vivid-zsh": {
"flake": false,
"locked": {

View file

@ -16,11 +16,6 @@
inputs.nixpkgs.follows = "nixpkgs";
};
lix-module = {
url = "https://git.lix.systems/lix-project/nixos-module/archive/2.91.0.tar.gz";
inputs.nixpkgs.follows = "nixpkgs";
};
catppuccin = {
url = "github:catppuccin/nix";
};
@ -45,6 +40,7 @@
nyoom = {
url = "github:ryanccn/nyoom";
inputs.nixpkgs.follows = "nixpkgs";
inputs.nix-filter.follows = "nix-filter";
};
morlana = {
@ -86,28 +82,43 @@
outputs =
{
self,
nixpkgs,
nix-darwin,
lix-module,
home-manager,
nix-index-database,
darwin-custom-icons,
...
}@inputs:
{
darwinConfigurations.Ryans-MacBook-Pro = nix-darwin.lib.darwinSystem {
modules = [
lix-module.nixosModules.default
home-manager.darwinModules.home-manager
nix-index-database.darwinModules.nix-index
darwin-custom-icons.darwinModules.default
./system.nix
];
let
inherit (nixpkgs) lib;
systems = [
"x86_64-linux"
"aarch64-linux"
"x86_64-darwin"
"aarch64-darwin"
];
specialArgs = {
inherit self inputs;
forAllSystems = lib.genAttrs systems;
in
{
darwinConfigurations = {
Ryans-MacBook-Pro = nix-darwin.lib.darwinSystem {
modules = [
./modules/_module.nix
home-manager.darwinModules.home-manager
nix-index-database.darwinModules.nix-index
darwin-custom-icons.darwinModules.default
./system.nix
];
specialArgs = {
inherit self inputs;
};
};
};
overlays = import ./overlays;
packages = forAllSystems (system: (import ./packages) nixpkgs.legacyPackages.${system});
};
}

View file

@ -2,16 +2,17 @@ theme = catppuccin-frappe
window-colorspace = display-p3
font-family = "Ryan Term"
font-size = 13
font-size = 14
font-feature = -calt
font-feature = -dlig
adjust-cell-height = 50%
adjust-cell-height = 25%
adjust-underline-position = 5
command = /run/current-system/sw/bin/fish -l
macos-option-as-alt = true
macos-secure-input-indication = false
window-step-resize = true
window-padding-x = 15

View file

@ -1,14 +1,12 @@
{
pkgs,
lib,
self,
# self,
config,
...
}:
let
extensions = [
# "antfu.icons-carbon"
"antfu.unocss"
"astro-build.astro-vscode"
"bierner.lit-html"
"bmalehorn.vscode-fish"
@ -29,20 +27,17 @@ let
"graphql.vscode-graphql-syntax"
"golang.go"
"griimick.vhs"
"leonardssh.vscord"
# "leonardssh.vscord"
# "jdinhlife.gruvbox"
"jnoortheen.nix-ide"
# "miguelsolorio.symbols"
"ms-python.isort"
"ms-python.vscode-pylance"
"ms-python.python"
# "mvllow.rose-pine"
"myriad-dreamin.tinymist"
"naumovs.color-highlight"
"nvarner.typst-lsp"
"prisma.prisma"
"ronnidc.nunjucks"
"rust-lang.rust-analyzer"
"sastan.twind-intellisense"
"skellock.just"
"svelte.svelte-vscode"
"tamasfe.even-better-toml"
@ -51,7 +46,6 @@ let
"usernamehw.errorlens"
"vue.volar"
"waderyan.gitblame"
# "xaver.clang-format"
"yoavbls.pretty-ts-errors"
];
in
@ -80,7 +74,7 @@ in
"catppuccin.accentColor" = config.catppuccin.accent;
"catppuccin.boldKeywords" = false;
"catppuccin.italicKeywords" = true;
"catppuccin.italicKeywords" = false;
"catppuccin.workbenchMode" = "flat";
"catppuccin.customUIColors" = {
"all" = {
@ -99,14 +93,13 @@ in
"git.suggestSmartCommit" = false;
"diffEditor.renderSideBySide" = false;
"diffEditor.ignoreTrimWhitespace" = false;
"gitlens.showWelcomeOnInstall" = false;
# "gitlens.showWelcomeOnInstall" = false;
"gitblame.inlineMessageEnabled" = true;
"gitblame.inlineMessageFormat" = "\${author.name} · \${time.ago} · \${commit.summary,120}";
"editor.fontFamily" = "\"RyanMono Nerd Font\", \"Apple Color Emoji\", monospace";
# "editor.fontLigatures" = true;
"editor.fontLigatures" = "'calt', 'ss01'";
"editor.fontFamily" = ''"Ryan Mono", "Symbols Nerd Font", monospace'';
"editor.fontLigatures" = true;
"editor.fontSize" = 16;
"editor.lineHeight" = 1.5;
"editor.cursorSmoothCaretAnimation" = "on";
@ -114,13 +107,14 @@ in
"editor.cursorBlinking" = "phase";
"workbench.editor.highlightModifiedTabs" = true;
"workbench.editor.empty.hint" = "hidden";
"chat.commandCenter.enabled" = false;
"editor.inlineSuggest.enabled" = true;
"editor.tabSize" = 2;
"editor.insertSpaces" = true;
"editor.formatOnSave" = true;
"terminal.integrated.fontFamily" = "\"RyanTerm Nerd Font\", \"Apple Color Emoji\", monospace";
"terminal.integrated.fontFamily" = ''"Ryan Term", "Symbols Nerd Font Mono", monospace'';
"terminal.integrated.fontSize" = 14;
"terminal.integrated.lineHeight" = 1.5;
"terminal.integrated.cursorBlinking" = true;
@ -149,11 +143,11 @@ in
"extensions.ignoreRecommendations" = true;
"editor.accessibilitySupport" = "off";
"vscord.status.details.text.editing" = "In {workspace}";
"vscord.status.details.text.viewing" = "In {workspace}";
"vscord.status.problems.enabled" = false;
"vscord.status.state.text.editing" = "Working on {file_name}{file_extension}";
"vscord.status.buttons.button1.enabled" = false;
# "vscord.status.details.text.editing" = "In {workspace}";
# "vscord.status.details.text.viewing" = "In {workspace}";
# "vscord.status.problems.enabled" = false;
# "vscord.status.state.text.editing" = "Working on {file_name}{file_extension}";
# "vscord.status.buttons.button1.enabled" = false;
# "gitlens.defaultTimeFormat" = "HH=mm";
# "gitlens.defaultDateShortFormat" = "YYYY/MM/DD";
@ -198,17 +192,15 @@ in
"[nix]"."editor.defaultFormatter" = "jnoortheen.nix-ide";
"nix.enableLanguageServer" = true;
"nix.serverPath" = lib.getExe pkgs.nixd;
"nix.serverPath" = lib.getExe pkgs.nil;
"nix.serverSettings" = {
nixd = {
nil = {
formatting.command = [ (lib.getExe pkgs.nixfmt-rfc-style) ];
nixpkgs.expr = "(builtins.getFlake \"${self}\").pkgs";
# nixpkgs.expr = "(builtins.getFlake \"${self}\").pkgs";
};
};
"typst-lsp.exportPdf" = "never";
"typst-lsp.experimentalFormatterMode" = "on";
"[typst]"."editor.defaultFormatter" = "nvarner.typst-lsp";
"[typst]"."editor.defaultFormatter" = "myriad-dreamin.tinymist";
};
};

View file

@ -38,5 +38,5 @@
catppuccin.flavor = "frappe";
catppuccin.accent = "sapphire";
home.stateVersion = "23.05";
home.stateVersion = "24.11";
}

View file

@ -1,11 +1,11 @@
{ pkgs, ... }:
{ pkgs, flake', ... }:
{
home.packages = with pkgs; [
inter
public-sans
ibm-plex
ryan-mono-bin
flake'.packages.ibm-plex-compat
flake'.packages.ryan-mono-bin
# Install the variable fonts for Cascadia Code (which
# are recommended) instead of the static fonts
@ -17,6 +17,8 @@
'';
})
(nerdfonts.override { fonts = [ "NerdFontsSymbolsOnly" ]; })
(nerdfonts.override {
fonts = [ "NerdFontsSymbolsOnly" ];
})
];
}

View file

@ -1,7 +1,7 @@
_: {
programs.eza = {
enable = true;
icons = true;
icons = "auto";
extraOptions = [ "--all" ];
};
}

View file

@ -1,11 +1,12 @@
{ lib, ... }:
let
aliases = import ./aliases.nix;
shellAbbrs = builtins.mapAttrs (_: a: a.command) (
lib.filterAttrs (_: b: !(b.fishAlias or false)) aliases
shellAbbrs = builtins.mapAttrs (lib.const (builtins.getAttr "command")) (
lib.filterAttrs (_: a: !(lib.maybeAttr "fishAlias" false a)) aliases
);
shellAliases = builtins.mapAttrs (_: a: a.command) (
lib.filterAttrs (_: b: builtins.hasAttr "fishAlias" b && b.fishAlias) aliases
shellAliases = builtins.mapAttrs (lib.const (builtins.getAttr "command")) (
lib.filterAttrs (_: a: lib.maybeAttr "fishAlias" false a) aliases
);
in
{

View file

@ -29,8 +29,6 @@ _: {
fetch.fsckObjects = true;
receive.fsckObjects = true;
blame.ignoreRevsFile = ".git-blame-ignore-revs";
fetch.prune = true;
fetch.pruneTags = true;

View file

@ -1,11 +1,13 @@
{
pkgs,
inputs,
lib,
config,
...
}:
let
toml = pkgs.formats.toml { };
rust-bin = inputs.rust-overlay.lib.mkRustBin { } pkgs;
in
{
home.file."${config.xdg.dataHome}/cargo/config.toml".source = toml.generate "config.toml" {

View file

@ -1,6 +1,11 @@
{ config, inputs, ... }:
{
config,
inputs,
lib,
...
}:
let
shellAliases = builtins.mapAttrs (_: alias: alias.command) (import ./aliases.nix);
shellAliases = builtins.mapAttrs (lib.const (builtins.getAttr "command")) (import ./aliases.nix);
in
{
programs.zsh = {

View file

@ -1,5 +1,8 @@
switch *args:
morlana switch {{args}}
switch:
morlana switch
build:
morlana build
wipe-history:
sudo -H nix profile wipe-history --profile "/nix/var/nix/profiles/default"

16
modules/_module.nix Normal file
View file

@ -0,0 +1,16 @@
{
pkgs,
lib,
inputs,
inputs',
...
}:
{
_module.args = {
inputs' = lib.mapAttrs (lib.const (
lib.mapAttrs (lib.const (value: value.${pkgs.system} or value))
)) inputs;
flake' = inputs'.self;
};
}

View file

@ -1,22 +0,0 @@
{ lib, ... }:
{
# https://github.com/LnL7/nix-darwin/issues/122#issuecomment-2272570087
programs.fish.loginShellInit =
let
dquote = str: "\"" + str + "\"";
profiles = [
"/etc/profiles/per-user/$USER" # home-manager profile
"$HOME/.nix-profile" # non-XDG home profile
"$(set -q XDG_STATE_HOME; and echo \"$XDG_STATE_HOME\"; or echo \"$HOME/.local/state\")/nix/profile" # XDG home profile
"/run/current-system/sw" # nix-darwin system profile
"/nix/var/nix/profiles/default" # system profile
];
makeBinSearchPath = lib.concatMapStringsSep " " (path: (dquote "${path}/bin"));
in
''
fish_add_path --move --prepend --path ${makeBinSearchPath profiles}
set fish_user_paths $fish_user_paths
'';
}

View file

@ -7,7 +7,11 @@ _: {
homebrew = {
enable = true;
caskArgs.require_sha = true;
caskArgs = {
require_sha = true;
};
onActivation = {
autoUpdate = true;
cleanup = "uninstall";

View file

@ -1,19 +1,20 @@
{
self,
pkgs,
inputs,
config,
...
}:
{
nix.package = pkgs.nixVersions.latest;
services.nix-daemon.enable = true;
# nix.package = pkgs.nixVersions.latest;
nix.registry = {
n.flake = inputs.nixpkgs;
};
nix.nixPath = [ "nixpkgs=${inputs.nixpkgs.outPath}" ];
nix.nixPath = [
"nixpkgs=${inputs.nixpkgs.outPath}"
];
nix.settings = {
experimental-features = [
@ -40,20 +41,12 @@
nix-path = config.nix.nixPath;
};
environment.profiles = [
"\${XDG_STATE_HOME}/nix/profile"
"$HOME/.local/state/nix/profile"
];
nixpkgs = {
overlays = [
inputs.rust-overlay.overlays.default
inputs.nrr.overlays.default
inputs.am.overlays.default
inputs.nyoom.overlays.default
inputs.morlana.overlays.default
inputs.spdx-gen.overlays.default
self.overlays.ryan-mono-bin
self.overlays.ibm-plex
];
config.allowUnfree = true;
hostPlatform = "aarch64-darwin";
};

View file

@ -1,4 +1,4 @@
{ pkgs, ... }:
{ pkgs, inputs', ... }:
{
environment.systemPackages = with pkgs; [
nixfmt-rfc-style
@ -40,6 +40,7 @@
jq
just
nerdfix
reuse
ripgrep
tokei
vhs
@ -52,10 +53,10 @@
# spicetify-cli
exiftool
nrr
am
nyoom
morlana
spdx-gen
inputs'.nrr.packages.default
inputs'.am.packages.default
inputs'.nyoom.packages.default
inputs'.morlana.packages.default
inputs'.spdx-gen.packages.default
];
}

View file

@ -1,4 +0,0 @@
{
ibm-plex = import ./ibm-plex.nix;
ryan-mono-bin = import ./ryan-mono-bin.nix;
}

View file

@ -1,43 +0,0 @@
(_: prev: {
ibm-plex = prev.ibm-plex.overrideAttrs (_: {
postInstall = ''
set -eo pipefail
PATH="${prev.fd}/bin:${prev.python311Packages.fonttools}/bin:$PATH"
cd "$out/share/fonts/opentype"
ansi_dim="\033[2m"
ansi_blue="\033[34m"
ansi_green="\033[32m"
ansi_reset="\033[0m"
medium_fonts=$(fd --extension=otf Medium)
for medium_font in $medium_fonts; do
echo -e "''${ansi_blue}Patching''${ansi_reset} $medium_font (Medm -> Medium)"
ttx_path="''${medium_font%.*}.ttx"
ttx "$medium_font"
sed -i 's/Medm/Medium/g' "$ttx_path"
ttx -f "$ttx_path"
rm "$ttx_path"
done
semibold_fonts=$(fd --extension=otf SemiBold)
for semibold_font in $semibold_fonts; do
echo -e "''${ansi_blue}Patching''${ansi_reset} $semibold_font (SmBld -> Semibold)"
ttx_path="''${semibold_font%.*}.ttx"
ttx "$semibold_font"
sed -i 's/SmBld/Semibold/g' "$ttx_path"
ttx -f "$ttx_path"
rm "$ttx_path"
done
echo -e "''${ansi_green}Done!''${ansi_reset}"
'';
});
})

4
packages/default.nix Normal file
View file

@ -0,0 +1,4 @@
pkgs: {
ibm-plex-compat = pkgs.callPackage ./ibm-plex-compat.nix { };
ryan-mono-bin = pkgs.callPackage ./ryan-mono-bin.nix { };
}

View file

@ -0,0 +1,46 @@
{
ibm-plex,
fd,
python312Packages,
}:
ibm-plex.overrideAttrs (_: {
pname = "ibm-plex-compat";
postInstall = ''
set -eo pipefail
PATH="${fd}/bin:${python312Packages.fonttools}/bin:$PATH"
cd "$out/share/fonts/opentype"
ansi_green="\033[32m"
ansi_reset="\033[0m"
medium_fonts=$(fd --extension=otf Medium)
for medium_font in $medium_fonts; do
echo -e "''${ansi_green}Patching''${ansi_reset} $medium_font (Medm -> Medium)"
ttx_path="''${medium_font%.*}.ttx"
ttx "$medium_font"
substituteInPlace "$ttx_path" --replace-fail 'Medm' 'Medium'
ttx -f "$ttx_path"
rm "$ttx_path"
done
semibold_fonts=$(fd --extension=otf SemiBold)
for semibold_font in $semibold_fonts; do
echo -e "''${ansi_green}Patching''${ansi_reset} $semibold_font (SmBld -> Semibold)"
ttx_path="''${semibold_font%.*}.ttx"
ttx "$semibold_font"
substituteInPlace "$ttx_path" --replace-fail 'SmBld' 'Semibold'
ttx -f "$ttx_path"
rm "$ttx_path"
done
echo -e "''${ansi_green}Done!''${ansi_reset}"
'';
})

View file

@ -1,10 +1,13 @@
_: prev:
{
callPackage,
symlinkJoin,
}:
let
version = "2024.05.26";
mkFontVariant =
{ variant, hash }:
prev.callPackage (
callPackage (
{
lib,
fetchzip,
@ -33,30 +36,28 @@ let
}
) { };
in
{
ryan-mono-bin = prev.symlinkJoin {
name = "ryan-mono-bin-${version}";
symlinkJoin {
name = "ryan-mono-bin-${version}";
paths = [
(mkFontVariant {
variant = "RyanMono";
hash = "sha256-smlvBfpwVoD0qfmmHcJjsLdiblXjy5eevZfK4qDc9x8=";
})
paths = [
(mkFontVariant {
variant = "RyanMono";
hash = "sha256-smlvBfpwVoD0qfmmHcJjsLdiblXjy5eevZfK4qDc9x8=";
})
(mkFontVariant {
variant = "RyanTerm";
hash = "sha256-12xaJqgR5R6SZnZ7vJeD5zg2TZbWEiUrdyK+ljekMvc=";
})
(mkFontVariant {
variant = "RyanTerm";
hash = "sha256-12xaJqgR5R6SZnZ7vJeD5zg2TZbWEiUrdyK+ljekMvc=";
})
(mkFontVariant {
variant = "RyanMonoNerdFont";
hash = "sha256-n2d9K1rJuWCF2NgkRLQQCNCAxYfiBVv/jpn+BzqBvAI=";
})
(mkFontVariant {
variant = "RyanMonoNerdFont";
hash = "sha256-n2d9K1rJuWCF2NgkRLQQCNCAxYfiBVv/jpn+BzqBvAI=";
})
(mkFontVariant {
variant = "RyanTermNerdFont";
hash = "sha256-yrzgNRD560FhHLSK1neHVSnB+ZiHP2bmKzD1pGTu9Ro=";
})
];
};
(mkFontVariant {
variant = "RyanTermNerdFont";
hash = "sha256-yrzgNRD560FhHLSK1neHVSnB+ZiHP2bmKzD1pGTu9Ro=";
})
];
}

View file

@ -1,5 +1,7 @@
{
inputs,
inputs',
flake',
self,
...
}:
@ -8,7 +10,6 @@
./modules/nix.nix
./modules/packages.nix
./modules/homebrew.nix
./modules/fish.nix
];
security.pam.enableSudoTouchIdAuth = true;
@ -20,10 +21,6 @@
path = "/Applications/Notion.app";
icon = ./icons/notion.icns;
}
{
path = "/Applications/Things.app";
icon = ./icons/things.icns;
}
{
path = "/Applications/Obsidian.app";
icon = ./icons/obsidian.icns;
@ -40,7 +37,12 @@
useUserPackages = true;
extraSpecialArgs = {
inherit self inputs;
inherit
self
flake'
inputs
inputs'
;
};
users.ryanccn = import ./home;
@ -50,5 +52,5 @@
home = "/Users/ryanccn";
};
system.stateVersion = 4;
system.stateVersion = 5;
}