1
0
Fork 0
mirror of https://github.com/ryanccn/flake.git synced 2026-01-26 19:56:29 +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

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
];
}