This commit is contained in:
2025-07-17 19:28:12 +09:00
commit ecb8bc951f
23 changed files with 709 additions and 0 deletions

111
configuration.nix Normal file
View File

@@ -0,0 +1,111 @@
# 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, inputs, ... }:
{
imports = [
./hardware-configuration.nix
./services/virtual.nix
./services/x.nix
./services/sound.nix
];
nixpkgs.config.allowUnfree = true;
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
boot.loader.grub.device = "/dev/nvme1n1p1";
networking.hostName = "haskell"; # Define your hostname.
programs.steam.enable = true;
programs.fish.enable = true;
programs.nix-ld = {
enable = true;
libraries = import ./modules/ld.nix;
};
time.timeZone = "Asia/Seoul";
i18n.defaultLocale = "en_US.UTF-8";
i18n.inputMethod = {
type = "fcitx5";
enable = true;
fcitx5.addons = with pkgs; [ fcitx5-gtk fcitx5-hangul ];
};
# console = {
# font = "Lat2-Terminus16";
# keyMap = "us";
# useXkbConfig = true; # use xkb.options in tty.
# };
services.udev.packages = [ pkgs.libwacom ];
services.usbmuxd = {
enable = false;
package = pkgs.usbmuxd2;
};
fonts.packages = with pkgs; [ nerd-fonts.monaspace ];
# Enable touchpad support (enabled default in most desktopManager).
# services.libinput.enable = true;
# Define a user account. Don't forget to set a password with passwd.
users.users.allen = {
isNormalUser = true;
extraGroups = [ "wheel" ]; # Enable sudo for the user.
shell = pkgs.fish;
home = "/home/allen";
packages = with pkgs; [ tree ];
};
users.groups.libvirtd.members = [ "allen" ];
programs.firefox.enable = true;
# List packages installed in system profile.
# You can use https://search.nixos.org/ to find more packages (and options).
environment.systemPackages = with pkgs; [
vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
pkg-config
wget
openssl
gnome-tweaks
xf86_input_wacom
glfw
wacomtablet
libimobiledevice
ifuse
git
bash
libopus
xmousepasteblock
libglvnd
libGL
openal
inputs.helix.packages."${pkgs.system}".helix
];
nix.settings.experimental-features = [ "nix-command" "flakes" ];
environment.sessionVariables = {
LD_LIBRARY_PATH = lib.makeLibraryPath [
pkgs.libglvnd
pkgs.libGL
pkgs.glfw
pkgs.pulseaudio
];
};
environment.variables.EDITOR = "vim";
services.openssh.enable = true;
networking.firewall.enable = false;
system.stateVersion = "25.05"; # Did you read the comment?
}

107
flake.lock generated Normal file
View File

@@ -0,0 +1,107 @@
{
"nodes": {
"helix": {
"inputs": {
"nixpkgs": "nixpkgs",
"rust-overlay": "rust-overlay"
},
"locked": {
"lastModified": 1748906842,
"narHash": "sha256-KWpXXXciUDJp2DitQWT8MNzhECBuHA2SRPz51t0bZG0=",
"owner": "helix-editor",
"repo": "helix",
"rev": "1ea9050a5e12a1bc3eeb4b81022f427688c5ffa9",
"type": "github"
},
"original": {
"owner": "helix-editor",
"ref": "master",
"repo": "helix",
"type": "github"
}
},
"home-manager": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1748665073,
"narHash": "sha256-RMhjnPKWtCoIIHiuR9QKD7xfsKb3agxzMfJY8V9MOew=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "282e1e029cb6ab4811114fc85110613d72771dea",
"type": "github"
},
"original": {
"owner": "nix-community",
"ref": "release-25.05",
"repo": "home-manager",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1740560979,
"narHash": "sha256-Vr3Qi346M+8CjedtbyUevIGDZW8LcA1fTG0ugPY/Hic=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "5135c59491985879812717f4c9fea69604e7f26f",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1748889542,
"narHash": "sha256-Hb4iMhIbjX45GcrgOp3b8xnyli+ysRPqAgZ/LZgyT5k=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "10d7f8d34e5eb9c0f9a0485186c1ca691d2c5922",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-25.05",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"helix": "helix",
"home-manager": "home-manager",
"nixpkgs": "nixpkgs_2"
}
},
"rust-overlay": {
"inputs": {
"nixpkgs": [
"helix",
"nixpkgs"
]
},
"locked": {
"lastModified": 1740623427,
"narHash": "sha256-3SdPQrZoa4odlScFDUHd4CUPQ/R1gtH4Mq9u8CBiK8M=",
"owner": "oxalica",
"repo": "rust-overlay",
"rev": "d342e8b5fd88421ff982f383c853f0fc78a847ab",
"type": "github"
},
"original": {
"owner": "oxalica",
"repo": "rust-overlay",
"type": "github"
}
}
},
"root": "root",
"version": 7
}

29
flake.nix Normal file
View File

@@ -0,0 +1,29 @@
{
description = "A simple NixOS flake";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.05";
helix.url = "github:helix-editor/helix/master";
home-manager = {
url = "github:nix-community/home-manager/release-25.05";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, nixpkgs, home-manager, ... }@inputs: {
nixosConfigurations.haskell = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = { inherit inputs; };
modules = [
./configuration.nix
home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.allen = import ./home.nix;
}
];
};
};
}

View File

@@ -0,0 +1,62 @@
# 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 + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "uas" "sd_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelParams = [ "intel_iommu=on" ];
boot.kernelModules = [ "kvm-intel" "vfio_pci" ];
boot.extraModulePackages = [ ];
boot.extraModprobeConfig = ''
options vfio-pci ids=10de:1c81,10de:0fb9
'';
fileSystems."/" =
{ device = "/dev/disk/by-uuid/4e08142c-1b09-4265-a497-822e4a83d4c8";
fsType = "btrfs";
options = [ "subvol=root" ];
};
fileSystems."/home" =
{ device = "/dev/disk/by-uuid/4e08142c-1b09-4265-a497-822e4a83d4c8";
fsType = "btrfs";
options = [ "subvol=home" ];
};
fileSystems."/nix" =
{ device = "/dev/disk/by-uuid/4e08142c-1b09-4265-a497-822e4a83d4c8";
fsType = "btrfs";
options = [ "subvol=nix" ];
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/E808-5876";
fsType = "vfat";
options = [ "fmask=0022" "dmask=0022" ];
};
fileSystems."/mnt/hdd1" =
{ device = "/dev/disk/by-uuid/EC40940C4093DC20";
fsType = "ntfs-3g";
options = [ "rw" "uid=1000" "umask=0022" ];
};
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.enp5s0.useDHCP = lib.mkDefault true;
# networking.interfaces.eth0.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

36
home.nix Normal file
View File

@@ -0,0 +1,36 @@
{ config, pkgs, ... }:
{
imports = [
./modules/home/git.nix
./modules/home/neovim.nix
./modules/home/obs.nix
./modules/home/fish.nix
./modules/home/starship.nix
./modules/home/alacritty.nix
./modules/home/bash.nix
];
home.username = "allen";
home.homeDirectory = "/home/allen";
xresources.properties = {
"Xcursor.size" = 16;
"Xft.dpi" = 172;
};
home.packages = let
fonts = import ./pkgs/fonts.nix;
minecraft = import ./pkgs/minecraft.nix;
misc = import ./pkgs/misc.nix;
network = import ./pkgs/network.nix;
programming = import ./pkgs/programming.nix;
tools = import ./pkgs/tools.nix;
util = import ./pkgs/util.nix;
in fonts ++ minecraft ++ misc ++ network ++ programming ++ tools ++ util;
programs.direnv.enable = true;
programs.direnv.nix-direnv.enable = true;
home.stateVersion = "25.05";
}

View File

@@ -0,0 +1,17 @@
{ ... }: {
programs.alacritty = {
enable = true;
# custom settings
settings = {
env.TERM = "alacritty";
font = { size = 18; };
window = {
opacity = 1.0;
padding.x = 50;
padding.y = 50;
};
scrolling.multiplier = 5;
selection.save_to_clipboard = true;
};
};
}

6
modules/home/bash.nix Normal file
View File

@@ -0,0 +1,6 @@
{ ... }: {
programs.bash = {
enable = true;
enableCompletion = true;
};
}

32
modules/home/fish.nix Normal file
View File

@@ -0,0 +1,32 @@
{ pkgs, ... }: {
programs.fish = {
enable = true;
shellInit = ''
set -gx PNPM_HOME $HOME/.local/share/pnpm
fish_add_path $PNPM_HOME
set -gx OPENSSL_DIR ${pkgs.openssl.dev};
set -gx KUBECONFIG $HOME/.kube/config;
set -gx OPENSSL_LIB_DIR ${pkgs.openssl.out}/lib;
set -gx OPENSSL_INCLUDE_DIR ${pkgs.openssl.dev}/include;
set -gx PKG_CONFIG_PATH ${pkgs.openssl.dev}/lib/pkgconfig;
alias vi="nvim"
'';
plugins = [
# Enable a plugin (here grc for colorized command output) from nixpkgs
{
name = "grc";
src = pkgs.fishPlugins.grc.src;
}
# Manually packaging and enable a plugin
{
name = "z";
src = pkgs.fetchFromGitHub {
owner = "jethrokuan";
repo = "z";
rev = "e0e1b9dfdba362f8ab1ae8c1afc7ccf62b89f7eb";
sha256 = "0dbnir6jbwjpjalz14snzd3cgdysgcs3raznsijd6savad3qhijc";
};
}
];
};
}

15
modules/home/git.nix Normal file
View File

@@ -0,0 +1,15 @@
{ ... }:
{
programs.git = {
enable = true;
userName = "minco";
userEmail = "mail@drchi.co.kr";
extraConfig = {
credential.helper = "store";
credential.credentialStore = "store";
init.defaultBranch = "main";
core.editor = "nvim";
};
};
}

6
modules/home/neovim.nix Normal file
View File

@@ -0,0 +1,6 @@
{ ... }: {
programs.neovim = {
enable = true;
extraConfig = "";
};
}

10
modules/home/obs.nix Normal file
View File

@@ -0,0 +1,10 @@
{ pkgs, ... }: {
programs.obs-studio = {
enable = true;
plugins = with pkgs.obs-studio-plugins; [
wlrobs
obs-backgroundremoval
obs-pipewire-audio-capture
];
};
}

12
modules/home/starship.nix Normal file
View File

@@ -0,0 +1,12 @@
{ ... }: {
programs.starship = {
enable = true;
# custom settings
settings = {
add_newline = false;
aws.disabled = true;
gcloud.disabled = true;
line_break.disabled = true;
};
};
}

62
modules/ld.nix Normal file
View File

@@ -0,0 +1,62 @@
{ pkgs }:
with pkgs; [
alsa-lib
at-spi2-atk
at-spi2-core
libz
atk
cairo
cups
curl
dbus
expat
fontconfig
freetype
fuse3
zlib.dev
gdk-pixbuf
glib
gtk3
icu
wayland
libGL
libGLU
glfw
glew
libappindicator-gtk3
libopus
libdrm
libglvnd
libnotify
libpulseaudio
libunwind
libusb1
libuuid
libxkbcommon
libxml2
mesa
nspr
nss
openssl
pango
pipewire
stdenv.cc.cc
systemd
vulkan-loader
xorg.libX11
xorg.libXScrnSaver
xorg.libXcomposite
xorg.libXcursor
xorg.libXdamage
xorg.libXext
xorg.libXfixes
xorg.libXi
xorg.libXrandr
xorg.libXrender
xorg.libXtst
xorg.libxcb
xorg.libxkbfile
xorg.libxshmfence
zlib
]

6
pkgs/fonts.nix Normal file
View File

@@ -0,0 +1,6 @@
# font as an art
{ pkgs, ... }:
with pkgs;
[ nanum ]

8
pkgs/minecraft.nix Normal file
View File

@@ -0,0 +1,8 @@
# execute as @e[type=minecraft:cow] at @s summon minecraft:cow run summon minecraft:cow
{ pkgs, ... }:
with pkgs; [
prismlauncher
craftos-pc
]

17
pkgs/misc.nix Normal file
View File

@@ -0,0 +1,17 @@
# some misc packages
{ pkgs, ... }:
with pkgs; [
cowsay
file
which
htop
tree
gnused
gnutar
pango
libsoup_3
gawk
zstd
gnupg
]

22
pkgs/network.nix Normal file
View File

@@ -0,0 +1,22 @@
# network tools. maybe with some basic hacking tools.
{ pkgs, ... }:
with pkgs; [
mtr
iperf3
dnsutils
ldns
aria2
socat
nmap
ipcalc
wireshark
subfinder
termshark
tcpdump
whois
inetutils
asn
metasploit
]

33
pkgs/programming.nix Normal file
View File

@@ -0,0 +1,33 @@
# abstraction is beautiful.
{ pkgs, ... }:
with pkgs; [
radare2
python311Full
uv
unityhub
nodejs
go
binwalk
dotnet-sdk_9
csharp-ls
gcc
cmake
gnumake
ninja
graalvmPackages.graalvm-ce
pnpm
rustup
go-task
dive
podman-tui
k3s
kind
podman-compose
ghc
haskellPackages.stack
haskellPackages.hpack
haskellPackages.cabal-install
haskellPackages.haskell-language-server
]

22
pkgs/tools.nix Normal file
View File

@@ -0,0 +1,22 @@
# out-of-the-box cli tools
{ pkgs, ... }:
with pkgs; [
vesktop
youtube-music
thunderbird
yt-dlp
stellarium
blender
blockbench
jetbrains.idea-ultimate
krita
barrier
obsidian
audacity
bitwarden
texlive.combined.scheme-full
hugo
glow
]

50
pkgs/util.nix Normal file
View File

@@ -0,0 +1,50 @@
# various linux cli util
{ pkgs, ... }:
with pkgs; [
neofetch
nnn # terminal file manager
# archives
zip
xz
zlib
unzip
p7zip
# utils
xclip
openssl
ffmpeg
cloc
piper-tts
pavucontrol
ripgrep
jq
yq-go
git-credential-oauth
git-credential-manager
git-filter-repo
eza
sox
fzf
nix-output-monitor
nix-index
btop
iotop
iftop
strace
ltrace
lsof
sysstat
lm_sensors
ethtool
pciutils
usbutils
gpick
]

10
services/sound.nix Normal file
View File

@@ -0,0 +1,10 @@
# sing
{ ... }: {
services.pipewire = {
enable = true;
pulse.enable = true;
alsa.enable = true;
alsa.support32Bit = true;
};
}

23
services/virtual.nix Normal file
View File

@@ -0,0 +1,23 @@
# container and vm config
{ ... }: {
virtualisation = {
containers.enable = true;
podman = {
enable = true;
dockerCompat = true;
defaultNetwork.settings.dns_enabled = true;
};
libvirtd.enable = true;
spiceUSBRedirection.enable = true;
};
programs.virt-manager.enable = true;
services.k3s = {
enable = true;
clusterInit = true;
extraFlags =
"--cluster-cidr=10.42.0.0/16,2a10:3781:25ac:2::/64 --service-cidr=10.43.0.0/16,2a10:3781:25ac:3::/112 --flannel-iface enp5s0";
};
}

13
services/x.nix Normal file
View File

@@ -0,0 +1,13 @@
# X display system config
{ ... }: {
hardware.graphics.enable = true;
services.xserver.enable = true;
services.xserver.wacom.enable = true;
services.xserver.videoDrivers = [ "nvidia" ];
hardware.nvidia.open = false;
services.xserver.displayManager.gdm.enable = true;
services.xserver.desktopManager.gnome.enable = true;
services.xserver.xkb.layout = "us";
}