mirror of
https://github.com/ryan4yin/nix-config.git
synced 2026-04-25 02:08:29 +02:00
feat: format via 'ls **/*.nix | each { |it| nixfmt $it.name }'
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
{lib, ...}: {
|
||||
{ lib, ... }:
|
||||
{
|
||||
boot.loader.systemd-boot = {
|
||||
# we use Git for version control, so we don't need to keep too many generations.
|
||||
configurationLimit = lib.mkDefault 10;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
{mylib, ...}: {
|
||||
{ mylib, ... }:
|
||||
{
|
||||
imports = mylib.scanPaths ./.;
|
||||
}
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
}:
|
||||
{
|
||||
# to install chrome, you need to enable unfree packages
|
||||
nixpkgs.config.allowUnfree = lib.mkForce true;
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
{pkgs, ...}: {
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
# List packages installed in system profile. To search, run:
|
||||
# $ nix search wget
|
||||
environment.systemPackages = with pkgs; [
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
{myvars, ...}: {
|
||||
{ myvars, ... }:
|
||||
{
|
||||
####################################################################
|
||||
#
|
||||
# NixOS's Configuration for Remote Building / Distributed Building
|
||||
@@ -13,57 +14,59 @@
|
||||
# set local's max-job to 0 to force remote building(disable local building)
|
||||
# nix.settings.max-jobs = 0;
|
||||
nix.distributedBuilds = true;
|
||||
nix.buildMachines = let
|
||||
sshUser = myvars.username;
|
||||
# ssh key's path on local machine
|
||||
sshKey = "/etc/agenix/ssh-key-romantic";
|
||||
systems = [
|
||||
# native arch
|
||||
"x86_64-linux"
|
||||
nix.buildMachines =
|
||||
let
|
||||
sshUser = myvars.username;
|
||||
# ssh key's path on local machine
|
||||
sshKey = "/etc/agenix/ssh-key-romantic";
|
||||
systems = [
|
||||
# native arch
|
||||
"x86_64-linux"
|
||||
|
||||
# emulated arch using binfmt_misc and qemu-user
|
||||
"aarch64-linux"
|
||||
"riscv64-linux"
|
||||
# emulated arch using binfmt_misc and qemu-user
|
||||
"aarch64-linux"
|
||||
"riscv64-linux"
|
||||
];
|
||||
# all available system features are poorly documentd here:
|
||||
# https://github.com/NixOS/nix/blob/e503ead/src/libstore/globals.hh#L673-L687
|
||||
supportedFeatures = [
|
||||
"benchmark"
|
||||
"big-parallel"
|
||||
"kvm"
|
||||
];
|
||||
in
|
||||
[
|
||||
# Nix seems always try to build on the machine remotely
|
||||
# to make use of the local machine's high-performance CPU, do not set remote builder's maxJobs too high.
|
||||
# {
|
||||
# # some of my remote builders are running NixOS
|
||||
# # and has the same sshUser, sshKey, systems, etc.
|
||||
# inherit sshUser sshKey systems supportedFeatures;
|
||||
#
|
||||
# # the hostName should be:
|
||||
# # 1. a hostname that can be resolved by DNS
|
||||
# # 2. the ip address of the remote builder
|
||||
# # 3. a host alias defined globally in /etc/ssh/ssh_config
|
||||
# hostName = "aquamarine";
|
||||
# # remote builder's max-job
|
||||
# maxJobs = 3;
|
||||
# # speedFactor's a signed integer
|
||||
# # https://github.com/ryan4yin/nix-config/issues/70
|
||||
# speedFactor = 1;
|
||||
# }
|
||||
# {
|
||||
# inherit sshUser sshKey systems supportedFeatures;
|
||||
# hostName = "ruby";
|
||||
# maxJobs = 2;
|
||||
# speedFactor = 1;
|
||||
# }
|
||||
# {
|
||||
# inherit sshUser sshKey systems supportedFeatures;
|
||||
# hostName = "kana";
|
||||
# maxJobs = 2;
|
||||
# speedFactor = 1;
|
||||
# }
|
||||
];
|
||||
# all available system features are poorly documentd here:
|
||||
# https://github.com/NixOS/nix/blob/e503ead/src/libstore/globals.hh#L673-L687
|
||||
supportedFeatures = [
|
||||
"benchmark"
|
||||
"big-parallel"
|
||||
"kvm"
|
||||
];
|
||||
in [
|
||||
# Nix seems always try to build on the machine remotely
|
||||
# to make use of the local machine's high-performance CPU, do not set remote builder's maxJobs too high.
|
||||
# {
|
||||
# # some of my remote builders are running NixOS
|
||||
# # and has the same sshUser, sshKey, systems, etc.
|
||||
# inherit sshUser sshKey systems supportedFeatures;
|
||||
#
|
||||
# # the hostName should be:
|
||||
# # 1. a hostname that can be resolved by DNS
|
||||
# # 2. the ip address of the remote builder
|
||||
# # 3. a host alias defined globally in /etc/ssh/ssh_config
|
||||
# hostName = "aquamarine";
|
||||
# # remote builder's max-job
|
||||
# maxJobs = 3;
|
||||
# # speedFactor's a signed integer
|
||||
# # https://github.com/ryan4yin/nix-config/issues/70
|
||||
# speedFactor = 1;
|
||||
# }
|
||||
# {
|
||||
# inherit sshUser sshKey systems supportedFeatures;
|
||||
# hostName = "ruby";
|
||||
# maxJobs = 2;
|
||||
# speedFactor = 1;
|
||||
# }
|
||||
# {
|
||||
# inherit sshUser sshKey systems supportedFeatures;
|
||||
# hostName = "kana";
|
||||
# maxJobs = 2;
|
||||
# speedFactor = 1;
|
||||
# }
|
||||
];
|
||||
# optional, useful when the builder has a faster internet connection than yours
|
||||
nix.extraOptions = ''
|
||||
builders-use-substitutes = true
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
{lib, ...}: {
|
||||
{ lib, ... }:
|
||||
{
|
||||
# Or disable the firewall altogether.
|
||||
networking.firewall.enable = lib.mkDefault false;
|
||||
# Enable the OpenSSH daemon.
|
||||
|
||||
@@ -2,21 +2,22 @@
|
||||
myvars,
|
||||
config,
|
||||
...
|
||||
}: {
|
||||
}:
|
||||
{
|
||||
# Don't allow mutation of users outside the config.
|
||||
users.mutableUsers = false;
|
||||
|
||||
users.groups = {
|
||||
"${myvars.username}" = {};
|
||||
podman = {};
|
||||
wireshark = {};
|
||||
"${myvars.username}" = { };
|
||||
podman = { };
|
||||
wireshark = { };
|
||||
# for android platform tools's udev rules
|
||||
adbusers = {};
|
||||
dialout = {};
|
||||
adbusers = { };
|
||||
dialout = { };
|
||||
# for openocd (embedded system development)
|
||||
plugdev = {};
|
||||
plugdev = { };
|
||||
# misc
|
||||
uinput = {};
|
||||
uinput = { };
|
||||
};
|
||||
|
||||
users.users."${myvars.username}" = {
|
||||
|
||||
Reference in New Issue
Block a user