mirror of
https://github.com/ryanccn/flake.git
synced 2026-01-27 04:06:28 +01:00
style: switch to nixfmt-rfc-style
This commit is contained in:
parent
3404601a4a
commit
02e3e3a7ac
17 changed files with 117 additions and 112 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
|
@ -1,3 +1,6 @@
|
||||||
.DS_Store
|
.DS_Store
|
||||||
|
|
||||||
result*
|
result*
|
||||||
|
|
||||||
|
.vscode/
|
||||||
|
.idea/
|
||||||
|
|
|
||||||
|
|
@ -84,13 +84,15 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = {
|
outputs =
|
||||||
|
{
|
||||||
self,
|
self,
|
||||||
nix-darwin,
|
nix-darwin,
|
||||||
home-manager,
|
home-manager,
|
||||||
darwin-custom-icons,
|
darwin-custom-icons,
|
||||||
...
|
...
|
||||||
} @ inputs: {
|
}@inputs:
|
||||||
|
{
|
||||||
darwinConfigurations.Ryans-MacBook-Pro = nix-darwin.lib.darwinSystem {
|
darwinConfigurations.Ryans-MacBook-Pro = nix-darwin.lib.darwinSystem {
|
||||||
modules = [
|
modules = [
|
||||||
home-manager.darwinModules.home-manager
|
home-manager.darwinModules.home-manager
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
{config, ...}: {
|
{ config, ... }:
|
||||||
|
{
|
||||||
home.file."${config.xdg.configHome}/ghostty/config".source = ./ghostty.conf;
|
home.file."${config.xdg.configHome}/ghostty/config".source = ./ghostty.conf;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,8 @@
|
||||||
lib,
|
lib,
|
||||||
self,
|
self,
|
||||||
...
|
...
|
||||||
}: let
|
}:
|
||||||
|
let
|
||||||
extensions = [
|
extensions = [
|
||||||
# "antfu.icons-carbon"
|
# "antfu.icons-carbon"
|
||||||
"antfu.unocss"
|
"antfu.unocss"
|
||||||
|
|
@ -52,7 +53,8 @@
|
||||||
# "xaver.clang-format"
|
# "xaver.clang-format"
|
||||||
"yoavbls.pretty-ts-errors"
|
"yoavbls.pretty-ts-errors"
|
||||||
];
|
];
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
programs.vscode = {
|
programs.vscode = {
|
||||||
enable = true;
|
enable = true;
|
||||||
package = pkgs.stdenvNoCC.mkDerivation {
|
package = pkgs.stdenvNoCC.mkDerivation {
|
||||||
|
|
@ -222,18 +224,14 @@ in {
|
||||||
currentExtensions["$extension"]=1;
|
currentExtensions["$extension"]=1;
|
||||||
done
|
done
|
||||||
|
|
||||||
${builtins.concatStringsSep
|
${builtins.concatStringsSep "\n" (
|
||||||
"\n"
|
builtins.map (ext: ''
|
||||||
(
|
|
||||||
builtins.map
|
|
||||||
(ext: ''
|
|
||||||
if [[ -z "''${currentExtensions[${ext}]+unset}" ]]; then
|
if [[ -z "''${currentExtensions[${ext}]+unset}" ]]; then
|
||||||
echo "installing ${ext}"
|
echo "installing ${ext}"
|
||||||
$DRY_RUN_CMD "$code_bin" --install-extension ${ext} &> /dev/null
|
$DRY_RUN_CMD "$code_bin" --install-extension ${ext} &> /dev/null
|
||||||
fi
|
fi
|
||||||
unset 'currentExtensions[${ext}]'
|
unset 'currentExtensions[${ext}]'
|
||||||
'')
|
'') extensions
|
||||||
extensions
|
|
||||||
)}
|
)}
|
||||||
|
|
||||||
for ext in "''${!currentExtensions[@]}"; do
|
for ext in "''${!currentExtensions[@]}"; do
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,5 @@
|
||||||
|
{ config, inputs, ... }:
|
||||||
{
|
{
|
||||||
config,
|
|
||||||
inputs,
|
|
||||||
...
|
|
||||||
}: {
|
|
||||||
programs.home-manager.enable = true;
|
programs.home-manager.enable = true;
|
||||||
|
|
||||||
imports = [
|
imports = [
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
{pkgs, ...}: {
|
{ pkgs, ... }:
|
||||||
|
{
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
inter
|
inter
|
||||||
public-sans
|
public-sans
|
||||||
|
|
@ -16,8 +17,6 @@
|
||||||
'';
|
'';
|
||||||
})
|
})
|
||||||
|
|
||||||
(nerdfonts.override {
|
(nerdfonts.override { fonts = [ "NerdFontsSymbolsOnly" ]; })
|
||||||
fonts = ["NerdFontsSymbolsOnly"];
|
|
||||||
})
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,14 @@
|
||||||
{lib, ...}: let
|
{ lib, ... }:
|
||||||
|
let
|
||||||
aliases = import ./aliases.nix;
|
aliases = import ./aliases.nix;
|
||||||
shellAbbrs = builtins.mapAttrs (_: a: a.command) (lib.filterAttrs (_: b: !(b.fishAlias or false)) aliases);
|
shellAbbrs = builtins.mapAttrs (_: a: a.command) (
|
||||||
shellAliases = builtins.mapAttrs (_: a: a.command) (lib.filterAttrs (_: b: builtins.hasAttr "fishAlias" b && b.fishAlias) aliases);
|
lib.filterAttrs (_: b: !(b.fishAlias or false)) aliases
|
||||||
in {
|
);
|
||||||
|
shellAliases = builtins.mapAttrs (_: a: a.command) (
|
||||||
|
lib.filterAttrs (_: b: builtins.hasAttr "fishAlias" b && b.fishAlias) aliases
|
||||||
|
);
|
||||||
|
in
|
||||||
|
{
|
||||||
programs.fish = {
|
programs.fish = {
|
||||||
enable = true;
|
enable = true;
|
||||||
catppuccin.enable = true;
|
catppuccin.enable = true;
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1 @@
|
||||||
_: {
|
_: { programs.glamour.catppuccin.enable = true; }
|
||||||
programs.glamour.catppuccin.enable = true;
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -3,18 +3,21 @@
|
||||||
lib,
|
lib,
|
||||||
config,
|
config,
|
||||||
...
|
...
|
||||||
}: let
|
}:
|
||||||
|
let
|
||||||
toml = pkgs.formats.toml { };
|
toml = pkgs.formats.toml { };
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
home.file."${config.xdg.dataHome}/cargo/config.toml".source = toml.generate "config.toml" {
|
home.file."${config.xdg.dataHome}/cargo/config.toml".source = toml.generate "config.toml" {
|
||||||
linker = "${lib.getExe pkgs.clang}";
|
linker = "${lib.getExe pkgs.clang}";
|
||||||
rustflags = ["-C" "link-arg=-fuse-ld=${lib.getExe pkgs.mold}"];
|
rustflags = [
|
||||||
|
"-C"
|
||||||
|
"link-arg=-fuse-ld=${lib.getExe pkgs.mold}"
|
||||||
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
(rust-bin.stable.latest.default.override {
|
(rust-bin.stable.latest.default.override { extensions = [ "llvm-tools-preview" ]; })
|
||||||
extensions = ["llvm-tools-preview"];
|
|
||||||
})
|
|
||||||
|
|
||||||
cargo-bloat
|
cargo-bloat
|
||||||
cargo-cache
|
cargo-cache
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,8 @@
|
||||||
{
|
{ config, inputs, ... }:
|
||||||
config,
|
let
|
||||||
inputs,
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
shellAliases = builtins.mapAttrs (_: alias: alias.command) (import ./aliases.nix);
|
shellAliases = builtins.mapAttrs (_: alias: alias.command) (import ./aliases.nix);
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
programs.zsh = {
|
programs.zsh = {
|
||||||
enable = true;
|
enable = true;
|
||||||
dotDir = ".config/zsh";
|
dotDir = ".config/zsh";
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
{config, ...}: {
|
{ config, ... }:
|
||||||
|
{
|
||||||
home.sessionVariables = {
|
home.sessionVariables = {
|
||||||
NEXT_TELEMETRY_DISABLED = "1";
|
NEXT_TELEMETRY_DISABLED = "1";
|
||||||
NUXT_TELEMETRY_DISABLED = "1";
|
NUXT_TELEMETRY_DISABLED = "1";
|
||||||
|
|
|
||||||
|
|
@ -20,22 +20,22 @@ _: {
|
||||||
"ttfautohint"
|
"ttfautohint"
|
||||||
];
|
];
|
||||||
|
|
||||||
casks = let
|
casks =
|
||||||
|
let
|
||||||
noQuarantine = name: {
|
noQuarantine = name: {
|
||||||
inherit name;
|
inherit name;
|
||||||
args = {
|
args = {
|
||||||
no_quarantine = true;
|
no_quarantine = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
in [
|
in
|
||||||
|
[
|
||||||
"blackhole-16ch"
|
"blackhole-16ch"
|
||||||
(noQuarantine "eloston-chromium")
|
(noQuarantine "eloston-chromium")
|
||||||
"sf-symbols"
|
"sf-symbols"
|
||||||
"1password/tap/1password-cli"
|
"1password/tap/1password-cli"
|
||||||
];
|
];
|
||||||
|
|
||||||
taps = [
|
taps = [ "1password/tap" ];
|
||||||
"1password/tap"
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,8 @@
|
||||||
inputs,
|
inputs,
|
||||||
config,
|
config,
|
||||||
...
|
...
|
||||||
}: {
|
}:
|
||||||
|
{
|
||||||
services.nix-daemon.enable = true;
|
services.nix-daemon.enable = true;
|
||||||
nix.package = pkgs.nixVersions.latest;
|
nix.package = pkgs.nixVersions.latest;
|
||||||
|
|
||||||
|
|
@ -12,27 +13,24 @@
|
||||||
n.flake = inputs.nixpkgs;
|
n.flake = inputs.nixpkgs;
|
||||||
};
|
};
|
||||||
|
|
||||||
nix.nixPath = [
|
nix.nixPath = [ "nixpkgs=${inputs.nixpkgs.outPath}" ];
|
||||||
"nixpkgs=${inputs.nixpkgs.outPath}"
|
|
||||||
];
|
|
||||||
|
|
||||||
nix.settings = {
|
nix.settings = {
|
||||||
experimental-features = "nix-command flakes";
|
experimental-features = "nix-command flakes";
|
||||||
auto-optimise-store = true;
|
auto-optimise-store = true;
|
||||||
extra-platforms = ["x86_64-darwin" "aarch64-darwin"];
|
extra-platforms = [
|
||||||
|
"x86_64-darwin"
|
||||||
|
"aarch64-darwin"
|
||||||
|
];
|
||||||
|
|
||||||
build-users-group = "nixbld";
|
build-users-group = "nixbld";
|
||||||
trusted-users = [ "ryanccn" ];
|
trusted-users = [ "ryanccn" ];
|
||||||
sandbox = true;
|
sandbox = true;
|
||||||
use-xdg-base-directories = true;
|
use-xdg-base-directories = true;
|
||||||
|
|
||||||
extra-substituters = [
|
extra-substituters = [ "https://cache.lix.systems" ];
|
||||||
"https://cache.lix.systems"
|
|
||||||
];
|
|
||||||
|
|
||||||
extra-trusted-public-keys = [
|
extra-trusted-public-keys = [ "cache.lix.systems:aBnZUw8zA7H35Cz2RyKFVs3H4PlGTLawyY5KRbvJR8o=" ];
|
||||||
"cache.lix.systems:aBnZUw8zA7H35Cz2RyKFVs3H4PlGTLawyY5KRbvJR8o="
|
|
||||||
];
|
|
||||||
|
|
||||||
nix-path = config.nix.nixPath;
|
nix-path = config.nix.nixPath;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,11 @@
|
||||||
|
{ pkgs, inputs, ... }:
|
||||||
{
|
{
|
||||||
pkgs,
|
|
||||||
inputs,
|
|
||||||
...
|
|
||||||
}: {
|
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
inputs.home-manager.packages.${pkgs.system}.home-manager
|
inputs.home-manager.packages.${pkgs.system}.home-manager
|
||||||
|
|
||||||
alejandra
|
alejandra
|
||||||
nixpkgs-fmt
|
nixpkgs-fmt
|
||||||
|
nixfmt-rfc-style
|
||||||
statix
|
statix
|
||||||
deadnix
|
deadnix
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,11 @@
|
||||||
_: prev: let
|
_: prev:
|
||||||
|
let
|
||||||
version = "2024.05.26";
|
version = "2024.05.26";
|
||||||
|
|
||||||
mkFontVariant = {
|
mkFontVariant =
|
||||||
variant,
|
{ variant, hash }:
|
||||||
hash,
|
prev.callPackage (
|
||||||
}:
|
{
|
||||||
prev.callPackage ({
|
|
||||||
lib,
|
lib,
|
||||||
fetchzip,
|
fetchzip,
|
||||||
stdenvNoCC,
|
stdenvNoCC,
|
||||||
|
|
@ -30,8 +30,10 @@ _: prev: let
|
||||||
platforms = platforms.all;
|
platforms = platforms.all;
|
||||||
license = licenses.ofl;
|
license = licenses.ofl;
|
||||||
};
|
};
|
||||||
}) {};
|
}
|
||||||
in {
|
) { };
|
||||||
|
in
|
||||||
|
{
|
||||||
ryan-mono-bin = prev.symlinkJoin {
|
ryan-mono-bin = prev.symlinkJoin {
|
||||||
name = "ryan-mono-bin-${version}";
|
name = "ryan-mono-bin-${version}";
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,8 @@
|
||||||
inputs,
|
inputs,
|
||||||
self,
|
self,
|
||||||
...
|
...
|
||||||
}: {
|
}:
|
||||||
|
{
|
||||||
imports = [
|
imports = [
|
||||||
./modules/nix.nix
|
./modules/nix.nix
|
||||||
./modules/packages.nix
|
./modules/packages.nix
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue