mirror of
https://github.com/ryan4yin/nix-config.git
synced 2026-03-26 11:21:34 +01:00
feat: refactor flake.nix
This commit is contained in:
@@ -1,7 +1,4 @@
|
||||
{
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
{pkgs, ...}: {
|
||||
###################################################################################
|
||||
#
|
||||
# Core configuration for nix-darwin
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
}:
|
||||
{
|
||||
###################################################################################
|
||||
#
|
||||
# NixOS's core configuration suitable for all my machines
|
||||
|
||||
@@ -14,4 +14,6 @@
|
||||
};
|
||||
openFirewall = true;
|
||||
};
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{username, ...}: {
|
||||
{username, config, ...}: {
|
||||
# Don't allow mutation of users outside the config.
|
||||
users.mutableUsers = false;
|
||||
|
||||
@@ -37,10 +37,10 @@
|
||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAII7PTkP3ixXTZlrJNSHnXgkmHNT+QslFi9wNYXOpVwGB ryan@harmonica"
|
||||
];
|
||||
};
|
||||
users.users.root.initialHashedPassword = "$7$CU..../....X6uvZYnFD.i1CqqFFNl4./$4vgqzIPyw5XBr0aCDFbY/UIRRJr7h5SMGoQ/ZvX3FP2";
|
||||
|
||||
# fix for `sudo xxx` in kitty/wezterm and other modern terminal emulators
|
||||
security.sudo.keepTerminfo = true;
|
||||
users.users.root = {
|
||||
initialHashedPassword = "$7$CU..../....X6uvZYnFD.i1CqqFFNl4./$4vgqzIPyw5XBr0aCDFbY/UIRRJr7h5SMGoQ/ZvX3FP2";
|
||||
openssh.authorizedKeys.keys = config.users.users."${username}".openssh.authorizedKeys.keys;
|
||||
};
|
||||
|
||||
# DO NOT promote the specified user to input password for `nix-store` and `nix-copy-closure`
|
||||
security.sudo.extraRules = [
|
||||
|
||||
@@ -12,6 +12,9 @@
|
||||
# set user's default shell system-wide
|
||||
users.defaultUserShell = pkgs.nushell;
|
||||
|
||||
# fix for `sudo xxx` in kitty/wezterm and other modern terminal emulators
|
||||
security.sudo.keepTerminfo = true;
|
||||
|
||||
environment.variables = {
|
||||
# fix https://github.com/NixOS/nixpkgs/issues/238025
|
||||
TZ = "${config.time.timeZone}";
|
||||
|
||||
@@ -3,20 +3,13 @@
|
||||
# Base NixOS Configuration
|
||||
# =========================================================================
|
||||
|
||||
# Set your time zone.
|
||||
time.timeZone = "Asia/Shanghai";
|
||||
imports = [
|
||||
./base/i18n.nix
|
||||
./base/misc.nix
|
||||
./base/user-group.nix
|
||||
|
||||
# Select internationalisation properties.
|
||||
i18n.defaultLocale = "en_US.UTF-8";
|
||||
|
||||
nix.settings = {
|
||||
# Manual optimise storage: nix-store --optimise
|
||||
# https://nixos.org/manual/nix/stable/command-ref/conf-file.html#conf-auto-optimise-store
|
||||
auto-optimise-store = true;
|
||||
builders-use-substitutes = true;
|
||||
# enable flakes globally
|
||||
experimental-features = ["nix-command" "flakes"];
|
||||
};
|
||||
../base.nix
|
||||
];
|
||||
|
||||
# List packages installed in system profile. To search, run:
|
||||
# $ nix search wget
|
||||
@@ -51,9 +44,6 @@
|
||||
docker-compose
|
||||
];
|
||||
|
||||
# replace default editor with neovim
|
||||
environment.variables.EDITOR = "nvim";
|
||||
|
||||
virtualisation.docker = {
|
||||
enable = true;
|
||||
# start dockerd on boot.
|
||||
|
||||
Reference in New Issue
Block a user