initialization

This commit is contained in:
biscuit
2025-05-19 17:53:19 -05:00
commit c1e4ef47f3
30 changed files with 451 additions and 0 deletions
+11
View File
@@ -0,0 +1,11 @@
# NixOS configuration
## Getting Started
### System rebuild
1. (Optional) On ./system/users.nix, replace `biscuit` on `users.users.biscuit` with your own username. If you are creating a new user (by replacing `biscuit`), or ignoring the file, the default password is `very-insecure-password`. Make sure to replace it!
2. Replace `hardware-configuration.conf`(each located at `nixos` folder) with your own. You can generate a config via `nixos-generate-config --dir ./nixos/`.
3. While in this folder, rebuild your system using this command: `sudo nixos-rebuild switch --flake ./#${YOUR_CHOICE}`. For example, if you chose `biscuit` config, you type the following: `sudo nixos-rebuild switch --flake ./#biscuit`.
### Home rebuild
+25
View File
@@ -0,0 +1,25 @@
{
inputs,
outputs,
lib,
config,
pkgs,
...
}: {
imports = [
../../modules/biscuit/editor.nix
../../modules/biscuit/gui.nix
];
programs.home-manager.enable = true;
home = {
username = "biscuit";
homeDirectory = "/home/biscuit";
packages = [];
sessionVariables = {};
};
systemd.user.startServices = "sd-switch";
home.stateVersion = "23.05";
}
Generated
+48
View File
@@ -0,0 +1,48 @@
{
"nodes": {
"home-manager": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1747688838,
"narHash": "sha256-FZq4/3OtGV/cti9Vccsy2tGSUrxTO4hkDF9oeGRTen4=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "45c2985644b60ab64de2a2d93a4d132ecb87cf66",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "home-manager",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1747542820,
"narHash": "sha256-GaOZntlJ6gPPbbkTLjbd8BMWaDYafhuuYRNrxCGnPJw=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "292fa7d4f6519c074f0a50394dbbe69859bb6043",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"home-manager": "home-manager",
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}
+40
View File
@@ -0,0 +1,40 @@
{
description = "A very basic flake";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
home-manager.url = "github:nix-community/home-manager";
home-manager.inputs.nixpkgs.follows = "nixpkgs"; # `follows` ensure it follows nixpkgs version
};
outputs = {
self,
nixpkgs,
home-manager,
...
} @ inputs: let
lib = nixpkgs.lib;
system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages.${system};
in {
nixosConfigurations = {
biscuit = lib.nixosSystem {
specialArgs = {inherit inputs system;};
inherit system;
modules = [
./nixos/biscuit/configuration.nix
];
};
};
homeConfigurations = {
biscuit = home-manager.lib.homeManagerConfiguration {
pkgs = import nixpkgs {
inherit system;
overlays = [];
};
extraSpecialArgs = {inherit inputs system;};
modules = [./dotfiles/biscuit/home.nix];
};
};
};
}
+9
View File
@@ -0,0 +1,9 @@
{...}: {
imports = [
../../pkgs/fastfetch/biscuit.nix
../../pkgs/git/biscuit.nix
../../pkgs/kitty/biscuit.nix
../../pkgs/neovim/biscuit.nix
../../pkgs/zsh/biscuit.nix
];
}
+5
View File
@@ -0,0 +1,5 @@
{...}: {
imports = [
../../pkgs/hyprland/biscuit.nix
];
}
+18
View File
@@ -0,0 +1,18 @@
{ ... }: {
imports = [
../system/bootloader.nix
../system/browser.nix
../system/firewall.nix
../system/locale.nix
../system/networking.nix
../system/print.nix
../system/term.nix
# ../system/proxy.nix
# ../system/recovery.nix # only supports non-flake conf
../system/sound.nix
../system/ssh.nix
../system/timezone.nix
# ../system/touchpad.nix
../system/users.nix
];
}
+20
View File
@@ -0,0 +1,20 @@
{
config,
lib,
pkgs,
...
}: {
imports = [
# Include the results of the hardware scan.
./hardware-configuration.nix
../../modules/system.nix
];
environment.systemPackages = with pkgs; [
vim
wget
];
nix.settings.experimental-features = ["nix-command" "flakes"];
system.stateVersion = "25.05";
}
+41
View File
@@ -0,0 +1,41 @@
# 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" "usbhid" "sd_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/8552e23a-af9f-4af8-947f-9ea6ff1e7195";
fsType = "ext4";
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/00BB-80E9";
fsType = "vfat";
options = [ "fmask=0077" "dmask=0077" ];
};
swapDevices =
[ { device = "/dev/disk/by-uuid/2a916b88-8039-481b-9c30-4edd0f329eb3"; }
];
# 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.eno1.useDHCP = lib.mkDefault true;
# networking.interfaces.wlp1s0.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}
+3
View File
@@ -0,0 +1,3 @@
{...}: {
programs.fastfetch.enable = true;
}
+3
View File
@@ -0,0 +1,3 @@
{ ... }: {
programs.git.enable = true;
}
+3
View File
@@ -0,0 +1,3 @@
{...}: {
wayland.windowManager.hyprland.enable = true;
}
+8
View File
@@ -0,0 +1,8 @@
{pkgs, ...}: {
programs.kitty.enable = true;
programs.kitty.settings = {
confirm_os_window_close = 0;
window_padding_width = 10;
font_size = 12.0;
};
}
+21
View File
@@ -0,0 +1,21 @@
{pkgs, ...}: let
nvimSource = pkgs.fetchFromGitea {
domain = "git.sakamoto.dev";
owner = "kenji";
repo = "nvim";
rev = "30449ae49cae92ec42356a49a3d2a3b4b7db0119";
sha256 = "sha256-YbP814fKOFuCWBRwlccd4nx/h8sdMgiJQu54thRLsK8=";
};
in {
programs.neovim.enable = true;
home.packages = with pkgs; [
lazygit
ripgrep
];
home.file.".config/nvim" = {
# source = /home/biscuit/Nixos/packages/nvim/nvchad;
source = nvimSource;
recursive = true;
force = true;
};
}
+64
View File
@@ -0,0 +1,64 @@
{pkgs, ...}: {
home.packages = with pkgs; [
zoxide
oh-my-posh
];
programs.zsh.enable = true;
programs.zoxide.enable = true;
programs.oh-my-posh.enable = true;
home.file.".config/oh-my-posh/config.omp.json" = {
source = ./custom/config.omp.json;
force = true;
};
programs.zsh = {
plugins = [
{
name = "vi-mode";
src = pkgs.zsh-vi-mode;
file = "share/zsh-vi-mode/zsh-vi-mode.plugin.zsh";
}
{
name = "autosuggestion";
src = pkgs.zsh-autosuggestions;
file = "share/zsh-autosuggestions/zsh-autosuggestions.zsh";
}
];
enableCompletion = true;
syntaxHighlighting.enable = true;
shellAliases = {
ll = "ls -l";
upd = "sudo nixos-rebuild switch --flake ~/Nixos/#biscuit";
hupd = "home-manager switch --flake ~/Nixos/#biscuit --impure";
agu = "pkill gjs & ags run ~/Nixos/packages/ags/custom/app.ts &";
};
history.size = 10000;
oh-my-zsh = {
plugins = [];
enable = true;
theme = "robbyrussell";
extraConfig = ''
zstyle ':completion:*' completer _expand _complete _ignored _approximate _expand_alias
zstyle ':autocomplete:*' default-context curcontext
zstyle ':autocomplete:*' min-input 0
setopt HIST_FIND_NO_DUPS
autoload -Uz compinit
compinit
# setopt autocd # cd without writing 'cd'
setopt globdots # show dotfiles in autocomplete list
'';
};
initContent = ''
# Oh-My-Posh initialization for Zsh
eval "$(oh-my-posh init zsh --config ~/.config/oh-my-posh/config.omp.json)"
# zsh-autocomplete
bindkey -M menuselect '^M' .accept-line # run code when selected completion
'';
};
}
+55
View File
@@ -0,0 +1,55 @@
{
"$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
"blocks": [
{
"alignment": "left",
"segments": [
{
"foreground": "#ffdd86",
"style": "plain",
"template": "{{ .UserName }}@{{ .HostName }} ",
"type": "session"
},
{
"foreground": "#42a9ff",
"style": "plain",
"properties": {
"style": "full"
},
"template": "{{ .Path }} ",
"type": "path"
},
{
"properties": {
"branch_icon": "",
"fetch_status": true
},
"style": "plain",
"template": "git:{{ if or (.Working.Changed) (.Staging.Changed) (gt .StashCount 0) }}<#ffdd86>{{ .HEAD }}</>{{ else }}{{ .HEAD }}{{ end }}{{ if .Staging.Changed }} <#98c379>{{ .Staging.String }}</>{{ end }}{{ if .Working.Changed }} <#d16971>{{ .Working.String }}</>{{ end }}",
"type": "git"
}
],
"type": "prompt"
},
{
"alignment": "left",
"newline": true,
"segments": [
{
"foreground": "#ffdd86",
"foreground_templates": [
"{{ if gt .Code 0 }}#42a9ff{{ end }}"
],
"properties": {
"always_enabled": true
},
"style": "plain",
"template": "> ",
"type": "status"
}
],
"type": "prompt"
}
],
"version": 3
}
+4
View File
@@ -0,0 +1,4 @@
{ ... }: {
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
}
+3
View File
@@ -0,0 +1,3 @@
{ ... }: {
programs.firefox.enable = true;
}
+7
View File
@@ -0,0 +1,7 @@
{ ... }: {
# Open ports in the firewall.
# networking.firewall.allowedTCPPorts = [ ... ];
# networking.firewall.allowedUDPPorts = [ ... ];
# Or disable the firewall altogether.
# networking.firewall.enable = false;
}
+9
View File
@@ -0,0 +1,9 @@
{ ... }: {
i18n.defaultLocale = "en_US.UTF-8";
console = {
font = "Lat2-Terminus16";
# keyMap = "us";
useXkbConfig = true; # use xkb.options in tty.
};
}
+6
View File
@@ -0,0 +1,6 @@
{ ... }: {
networking.hostName = "nixos";
# Pick only one of the below networking options.
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
networking.networkmanager.enable = true; # Easiest to use and most distros use this by default.
}
+5
View File
@@ -0,0 +1,5 @@
{ ... }: {
services = {
printing.enable = true;
};
}
+5
View File
@@ -0,0 +1,5 @@
{ ... }: {
# Configure network proxy if necessary
# networking.proxy.default = "http://user:password@proxy:port/";
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
}
+6
View File
@@ -0,0 +1,6 @@
{ ... }: {
# Copy the NixOS configuration file and link it from the resulting system
# (/run/current-system/configuration.nix). This is useful in case you
# accidentally delete configuration.nix.
system.copySystemConfiguration = true;
}
+9
View File
@@ -0,0 +1,9 @@
{ ... }: {
# Enable sound.
# services.pulseaudio.enable = true;
# OR
services.pipewire = {
enable = true;
pulse.enable = true;
};
}
+3
View File
@@ -0,0 +1,3 @@
{ ... }: {
services.openssh.enable = true;
}
+3
View File
@@ -0,0 +1,3 @@
{...}: {
programs.zsh.enable = true;
}
+3
View File
@@ -0,0 +1,3 @@
{ ... }: {
time.timeZone = "America/Chicago";
}
+4
View File
@@ -0,0 +1,4 @@
{ ... }: {
# Enable touchpad support (enabled default in most desktopManager).
services.libinput.enable = true;
}
+10
View File
@@ -0,0 +1,10 @@
{ pkgs, ... }: {
users.users.biscuit = {
isNormalUser = true;
extraGroups = [ "wheel" "networkmanager" ];
initialHashedPassword = "$6$Qab6SSvEJM2YRtVA$7Oyl7E3pp/FKtCC.2Tb2tyzp3yp7BFHFAKngUYJssQJ.v1Q2mqsgW9m7njpaKNcka2vyCwrnmw1R.YPlFqR0p1";
shell = pkgs.zsh;
packages = with pkgs; [
];
};
}