-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(profile): add mars server configuration (#86)
* feat(profile): add mars server configuration * ci(justfile): add git add recipe * patch(profile): remove console font settings * patch(profile): add user packages
- Loading branch information
Showing
6 changed files
with
169 additions
and
1 deletion.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
# Edit this configuration file to define what should be installed on | ||
# your system. Help is available in the configuration.nix(5) man page, on | ||
# https://search.nixos.org/options and in the NixOS manual (`nixos-help`). | ||
|
||
{ config, lib, pkgs, ... }: | ||
|
||
{ | ||
imports = | ||
[ # Include the results of the hardware scan. | ||
./hardware-configuration.nix | ||
]; | ||
|
||
boot.loader.systemd-boot.enable = true; | ||
boot.loader.efi.canTouchEfiVariables = true; | ||
boot.loader.systemd-boot.configurationLimit = lib.mkDefault 10; | ||
|
||
networking.networkmanager.enable = true; | ||
networking.hostName = "nixos-mars"; | ||
|
||
time.timeZone = "Asia/Shanghai"; | ||
i18n.defaultLocale = "en_US.UTF-8"; | ||
|
||
environment.systemPackages = with pkgs; [ | ||
git | ||
vim | ||
neofetch | ||
ripgrep | ||
curl | ||
wget | ||
just | ||
]; | ||
|
||
users.users = { | ||
kev = { | ||
isNormalUser = true; | ||
extraGroups = [ "wheel" "networkmanager" "docker"]; | ||
shell = pkgs.fish; | ||
packages = with pkgs; [ fish ]; | ||
}; | ||
|
||
root = { | ||
shell = pkgs.bash; | ||
}; | ||
}; | ||
users.extraGroups.docker.members = [ "kev" ]; | ||
|
||
programs.fish.enable = true; | ||
|
||
services.openssh = { | ||
enable = true; | ||
settings = { | ||
PermitRootLogin = "no"; # disable root login | ||
PasswordAuthentication = true; # disable password login | ||
}; | ||
}; | ||
|
||
zramSwap.enable = true; | ||
|
||
networking.firewall.allowedTCPPorts = [ 22 ]; | ||
|
||
environment.variables.EDITOR = "vim"; | ||
|
||
virtualisation.docker = { | ||
enable = true; | ||
enableOnBoot = true; | ||
}; | ||
|
||
nix = { | ||
settings = { | ||
max-jobs = lib.mkDefault 8; | ||
auto-optimise-store = true; | ||
experimental-features = [ "nix-command" "flakes" ]; | ||
|
||
}; | ||
gc = { | ||
automatic = lib.mkDefault true; | ||
dates = lib.mkDefault "weekly"; | ||
options = lib.mkDefault "--delete-older-than 1w"; | ||
}; | ||
}; | ||
|
||
system.stateVersion = "24.11"; | ||
|
||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
# Do not modify this file! It was generated by ‘nixos-generate-config’ | ||
# and may be overwritten by future invocations. Please make changes | ||
# to /etc/nixos/configuration.nix instead. | ||
{ config, lib, pkgs, modulesPath, ... }: | ||
|
||
{ | ||
imports = | ||
[ (modulesPath + "/profiles/qemu-guest.nix") ]; | ||
|
||
boot.kernelPackages = pkgs.linuxPackages_latest; | ||
boot.supportedFilesystems = [ "btrfs" ]; | ||
boot.initrd.availableKernelModules = [ "ata_piix" "uhci_hcd" "virtio_pci" "virtio_scsi" "sd_mod" "sr_mod" ]; | ||
boot.initrd.kernelModules = [ ]; | ||
boot.kernelModules = [ "kvm-amd" ]; | ||
boot.extraModulePackages = [ ]; | ||
|
||
fileSystems."/" = | ||
{ device = "/dev/disk/by-uuid/031752e4-b7af-4942-a62a-74650501fdb3"; | ||
fsType = "btrfs"; | ||
options = [ "noatime" "space_cache=v2" "compress=zstd" "ssd" "discard=async" "subvol=@" ]; | ||
}; | ||
|
||
fileSystems."/home" = | ||
{ device = "/dev/disk/by-uuid/031752e4-b7af-4942-a62a-74650501fdb3"; | ||
fsType = "btrfs"; | ||
options = [ "noatime" "space_cache=v2" "compress=zstd" "ssd" "discard=async" "subvol=@home" ]; | ||
}; | ||
|
||
fileSystems."/nix" = | ||
{ device = "/dev/disk/by-uuid/031752e4-b7af-4942-a62a-74650501fdb3"; | ||
fsType = "btrfs"; | ||
options = [ "noatime" "space_cache=v2" "compress=zstd" "ssd" "discard=async" "subvol=@nix" ]; | ||
}; | ||
|
||
fileSystems."/snapshots" = | ||
{ device = "/dev/disk/by-uuid/031752e4-b7af-4942-a62a-74650501fdb3"; | ||
fsType = "btrfs"; | ||
options = [ "noatime" "space_cache=v2" "compress=zstd" "ssd" "discard=async" "subvol=@snapshots" ]; | ||
}; | ||
|
||
fileSystems."/boot" = | ||
{ device = "/dev/disk/by-uuid/1E7C-94C1"; | ||
fsType = "vfat"; | ||
}; | ||
|
||
swapDevices = [ ]; | ||
|
||
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking | ||
# (the default) this is the recommended approach. When using systemd-networkd it's | ||
# still possible to use this option, but it's recommended to use it in conjunction | ||
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`. | ||
networking.useDHCP = lib.mkDefault true; | ||
# networking.interfaces.ens18.useDHCP = lib.mkDefault true; | ||
|
||
hardware = { | ||
# CPU | ||
cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ pkgs, ... }: | ||
|
||
{ | ||
imports = [ | ||
# default home modules | ||
../../shared/home.nix | ||
|
||
# host specific modules | ||
|
||
# shared modules | ||
]; | ||
|
||
home.packages = with pkgs; [ | ||
bat | ||
delta | ||
jq | ||
lazygit | ||
]; | ||
} |