feat: add nixos configuration
This commit is contained in:
parent
f0ed8873f6
commit
52b53c8069
14 changed files with 272 additions and 2 deletions
|
|
@ -8,8 +8,8 @@ if ! shopt -oq posix; then
|
|||
fi
|
||||
|
||||
# ble.sh
|
||||
[[ -r "$HOME/.local/share/blesh/out/ble.sh" ]] &&
|
||||
source "$HOME/.local/share/blesh/out/ble.sh"
|
||||
[[ -r "/etc/blesh/ble.sh" ]] &&
|
||||
source /etc/blesh/ble.sh
|
||||
|
||||
# NVM
|
||||
export NVM_DIR="$HOME/.nvm"
|
||||
|
|
|
|||
44
flake.lock
generated
Normal file
44
flake.lock
generated
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
{
|
||||
"nodes": {
|
||||
"codex-nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1790985011,
|
||||
"narHash": "sha256-VgqQfUblvgQomOUkyTCy5YE1mjRn8VBS8g984p9Ft4s=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "4379d026b3ff838d5a8655451280c4fdf2e3e96a",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NixOS",
|
||||
"ref": "master",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1790920529,
|
||||
"narHash": "sha256-nQyFkMR78WP6PiXKkDW2SjqzLf/spQqjRuxRGSbcV8k=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "774debe7a0d1b496e35677ad955a1011c6ff74f3",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NixOS",
|
||||
"ref": "nixos-26.05",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"codex-nixpkgs": "codex-nixpkgs",
|
||||
"nixpkgs": "nixpkgs"
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": "root",
|
||||
"version": 7
|
||||
}
|
||||
18
flake.nix
Normal file
18
flake.nix
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
{
|
||||
description = "NixOS system and personal dotfiles";
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-26.05";
|
||||
codex-nixpkgs.url = "github:NixOS/nixpkgs/master";
|
||||
};
|
||||
|
||||
outputs = { nixpkgs, codex-nixpkgs, ... }: {
|
||||
nixosConfigurations.nixos = nixpkgs.lib.nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
modules = [ ./nixos/hosts/nixos ];
|
||||
specialArgs = {
|
||||
codexPkgs = codex-nixpkgs.legacyPackages.x86_64-linux;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
17
nixos/hosts/nixos/default.nix
Normal file
17
nixos/hosts/nixos/default.nix
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
{ ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
./hardware-configuration.nix
|
||||
../../modules/desktop.nix
|
||||
../../modules/hardware.nix
|
||||
../../modules/packages
|
||||
../../modules/system.nix
|
||||
../../modules/users.nix
|
||||
];
|
||||
|
||||
networking.hostName = "nixos";
|
||||
|
||||
# Keep this at the version used during the initial installation.
|
||||
system.stateVersion = "26.05";
|
||||
}
|
||||
37
nixos/hosts/nixos/hardware-configuration.nix
Normal file
37
nixos/hosts/nixos/hardware-configuration.nix
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
# Generated by nixos-generate-config. Keep machine-specific settings here.
|
||||
{ config, lib, modulesPath, ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
(modulesPath + "/installer/scan/not-detected.nix")
|
||||
];
|
||||
|
||||
boot.initrd.availableKernelModules = [
|
||||
"ahci"
|
||||
"nvme"
|
||||
"xhci_pci"
|
||||
"usb_storage"
|
||||
"usbhid"
|
||||
"sd_mod"
|
||||
];
|
||||
boot.initrd.kernelModules = [ ];
|
||||
boot.kernelModules = [ "kvm-amd" ];
|
||||
boot.extraModulePackages = [ ];
|
||||
|
||||
fileSystems."/" = {
|
||||
device = "/dev/disk/by-uuid/bc9b799b-3c14-419b-b3f5-88ff212bb1f4";
|
||||
fsType = "ext4";
|
||||
};
|
||||
|
||||
fileSystems."/boot" = {
|
||||
device = "/dev/disk/by-uuid/D846-0839";
|
||||
fsType = "vfat";
|
||||
options = [ "fmask=0022" "dmask=0022" ];
|
||||
};
|
||||
|
||||
swapDevices = [ ];
|
||||
|
||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||
hardware.cpu.amd.updateMicrocode =
|
||||
lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||
}
|
||||
18
nixos/modules/desktop.nix
Normal file
18
nixos/modules/desktop.nix
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
programs.hyprland = {
|
||||
enable = true;
|
||||
xwayland.enable = true;
|
||||
};
|
||||
|
||||
services.displayManager.sddm = {
|
||||
enable = true;
|
||||
wayland.enable = true;
|
||||
};
|
||||
|
||||
services.displayManager.sessionPackages = [ pkgs.hyprland ];
|
||||
|
||||
programs.throne.enable = true;
|
||||
programs.throne.tunMode.enable = true;
|
||||
}
|
||||
23
nixos/modules/hardware.nix
Normal file
23
nixos/modules/hardware.nix
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
{ ... }:
|
||||
|
||||
{
|
||||
services.xserver.videoDrivers = [ "nvidia" ];
|
||||
|
||||
hardware.nvidia = {
|
||||
modesetting.enable = true;
|
||||
open = true;
|
||||
nvidiaSettings = true;
|
||||
};
|
||||
|
||||
hardware.graphics = {
|
||||
enable = true;
|
||||
enable32Bit = true;
|
||||
};
|
||||
|
||||
services.pipewire = {
|
||||
enable = true;
|
||||
pulse.enable = true;
|
||||
alsa.enable = true;
|
||||
alsa.support32Bit = true;
|
||||
};
|
||||
}
|
||||
10
nixos/modules/packages/default.nix
Normal file
10
nixos/modules/packages/default.nix
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
{ ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
./desktop.nix
|
||||
./development.nix
|
||||
./shell.nix
|
||||
./utilities.nix
|
||||
];
|
||||
}
|
||||
16
nixos/modules/packages/desktop.nix
Normal file
16
nixos/modules/packages/desktop.nix
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
environment.systemPackages = with pkgs; [
|
||||
adwaita-icon-theme
|
||||
firefox
|
||||
grim
|
||||
hyprpaper
|
||||
kitty
|
||||
mako
|
||||
slurp
|
||||
waybar
|
||||
wl-clipboard
|
||||
wofi
|
||||
];
|
||||
}
|
||||
29
nixos/modules/packages/development.nix
Normal file
29
nixos/modules/packages/development.nix
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
{ codexPkgs, pkgs, ... }:
|
||||
|
||||
{
|
||||
environment.systemPackages = with pkgs; [
|
||||
clang
|
||||
cmake
|
||||
codexPkgs.codex
|
||||
gcc
|
||||
git
|
||||
gitui
|
||||
meson
|
||||
neovim
|
||||
ninja
|
||||
tree-sitter
|
||||
vim
|
||||
];
|
||||
|
||||
systemd.user.services.codex-background-server = {
|
||||
description = "Codex background app server";
|
||||
wantedBy = [ "default.target" ];
|
||||
unitConfig.ConditionUser = "hhhh";
|
||||
serviceConfig = {
|
||||
ExecStart = "/run/current-system/sw/bin/codex app-server --listen unix://";
|
||||
WorkingDirectory = "%h";
|
||||
Restart = "on-failure";
|
||||
RestartSec = 3;
|
||||
};
|
||||
};
|
||||
}
|
||||
17
nixos/modules/packages/shell.nix
Normal file
17
nixos/modules/packages/shell.nix
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
environment.systemPackages = with pkgs; [
|
||||
atuin
|
||||
blesh
|
||||
direnv
|
||||
eza
|
||||
fd
|
||||
fzf
|
||||
ripgrep
|
||||
starship
|
||||
zoxide
|
||||
];
|
||||
|
||||
environment.etc."blesh/ble.sh".source = "${pkgs.blesh}/share/blesh/ble.sh";
|
||||
}
|
||||
11
nixos/modules/packages/utilities.nix
Normal file
11
nixos/modules/packages/utilities.nix
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
environment.systemPackages = with pkgs; [
|
||||
curl
|
||||
tree
|
||||
unzip
|
||||
wget
|
||||
zip
|
||||
];
|
||||
}
|
||||
18
nixos/modules/system.nix
Normal file
18
nixos/modules/system.nix
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
{ ... }:
|
||||
|
||||
{
|
||||
nix.settings.experimental-features = [
|
||||
"nix-command"
|
||||
"flakes"
|
||||
];
|
||||
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
|
||||
boot.loader.systemd-boot.enable = true;
|
||||
boot.loader.efi.canTouchEfiVariables = true;
|
||||
|
||||
networking.networkmanager.enable = true;
|
||||
|
||||
security.polkit.enable = true;
|
||||
services.openssh.enable = true;
|
||||
}
|
||||
12
nixos/modules/users.nix
Normal file
12
nixos/modules/users.nix
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
{ ... }:
|
||||
|
||||
{
|
||||
users.users.hhhh = {
|
||||
isNormalUser = true;
|
||||
description = "main";
|
||||
extraGroups = [
|
||||
"networkmanager"
|
||||
"wheel"
|
||||
];
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue