Skip to content

Instantly share code, notes, and snippets.

View yunfachi's full-sized avatar
🏴‍☠️

yunfachi

🏴‍☠️
View GitHub Profile
@cofob
cofob / install_nixos.sh
Created March 18, 2024 14:30
Aeza install NixOS
#!/usr/bin/env bash
curl https://raw.githubusercontent.com/elitak/nixos-infect/master/nixos-infect | NIX_CHANNEL=nixos-23.11 doNetConf=y bash -x
@yunfachi
yunfachi / default.nix
Last active November 22, 2024 13:27
Nix / NixOS : Import all files from current directory
{...}: {
# imports by full path without copying to /nix/store
imports = builtins.map (n: toString ./. + "/${n}") (builtins.attrNames (builtins.removeAttrs (builtins.readDir ./.) [(builtins.unsafeGetAttrPos "_" {_ = null;}).file]));
# copies all files from the current directory to /nix/store and imports from /nix/store
# imports = builtins.map (n: "${./.}/${n}") (builtins.attrNames (builtins.removeAttrs (builtins.readDir ./.) [(builtins.unsafeGetAttrPos "_" {_ = null;}).file]));
}
@yurifrl
yurifrl / test.sh
Last active October 26, 2023 15:58
Testing build nix derivations, passing arguments to nix-buld
# https://nix-dev.science.uu.narkive.com/gkWG24xs/error-cannot-auto-call-a-function-that-has-an-argument-without-a-default-value-stdenv
nix-build --no-out-link -E 'with import <nixpkgs> {}; callPackage ./default.nix {}'
# the --no-out-link will no create the @result link