Merge pull request 'dev' (#1) from dev into master

Reviewed-on: TheWanderingCrow/NixOS#1
This commit is contained in:
TheWanderingCrow 2024-09-16 19:35:06 +00:00
commit f695a2d539
12 changed files with 295 additions and 0 deletions

48
flake.lock generated Normal file
View file

@ -0,0 +1,48 @@
{
"nodes": {
"home-manager": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1726222338,
"narHash": "sha256-KuA8ciNR8qCF3dQaCaeh0JWyQUgEwkwDHr/f49Q5/e8=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "503af483e1b328691ea3a434d331995595fb2e3d",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "home-manager",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1726062873,
"narHash": "sha256-IiA3jfbR7K/B5+9byVi9BZGWTD4VSbWe8VLpp9B/iYk=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "4f807e8940284ad7925ebd0a0993d2a1791acb2f",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"home-manager": "home-manager",
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}

26
flake.nix Normal file
View file

@ -0,0 +1,26 @@
{
description = "Entry point for NixOS";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
home-manager.url = "github:nix-community/home-manager";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = inputs: let
system = "x86_64-linux";
inherit (inputs.nixpkgs) lib;
pkgs = import inputs.nixpkgs {
inherit system;
config.allowUnfree = true;
};
ns = host: (lib.nixosSystem {
specialArgs = {inherit pkgs inputs;};
modules = [
(./hosts + "/${host}")
];
});
in {nixosConfigurations = lib.attrsets.genAttrs [ "Parzival-Mobile" ] ns;};
}

View file

@ -0,0 +1,14 @@
{ pkgs,
...
}:{
imports = [
./hardware-configuration.nix
../../modules
];
networking.hostName = "Parzival-Mobile";
environment.systemPackages = [
pkgs.git
pkgs.vim
pkgs.wget
];
}

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" "usb_storage" "sd_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/0e8c3f30-2abb-4687-b541-3f6dfdb2fa72";
fsType = "ext4";
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/E6CB-9DA5";
fsType = "vfat";
options = [ "fmask=0022" "dmask=0022" ];
};
swapDevices =
[ { device = "/dev/disk/by-uuid/928718de-b495-4a7c-b9d4-eb491b6c8253"; }
];
# 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.enp0s31f6.useDHCP = lib.mkDefault true;
# networking.interfaces.wlp2s0.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

8
modules/boot.nix Normal file
View file

@ -0,0 +1,8 @@
{
boot.loader = {
systemd-boot.enable = true;
efi = {
canTouchEfiVariables = true;
};
};
}

31
modules/core.nix Normal file
View file

@ -0,0 +1,31 @@
{
config,
lib,
pkgs,
...
}: {
options.packages = {
enable = lib.mkEnableOption "enables packages";
core.enable = lib.mkEnableOption "enables required packages";
gui.enable = lib.mkEnableOption "enables gui+DE packages";
programming.enable = lib.mkEnableOption "enables programming packages";
hacking.enable = lib.mkEnableOption "enables hacking packages";
mudding.enable = lib.mkEnableOption "enables mudding packages";
gaming.enable = lib.mkEnableOption "enables gaming packages";
};
config = {
system.stateVersion = "24.05";
time.timeZone = "America/New_York";
packages = {
enable = lib.mkDefault true;
core.enable = lib.mkDefault true;
gui.enable = lib.mkDefault true;
programming.enable = lib.mkDefault true;
hacking.enable = lib.mkDefault false;
mudding.enable = lib.mkDefault false;
gaming.enable = lib.mkDefault false;
};
};
}

9
modules/default.nix Normal file
View file

@ -0,0 +1,9 @@
{ lib, config, ...}: {
imports = [
./core.nix
./boot.nix
./networking.nix
./programs.nix
./users
];
}

4
modules/networking.nix Normal file
View file

@ -0,0 +1,4 @@
{
networking.networkmanager.enable = true;
networking.firewall.enable = false;
}

96
modules/programs.nix Normal file
View file

@ -0,0 +1,96 @@
{ inputs, pkgs, lib, config, ...}: {
environment.systemPackages = with pkgs;
(
# Core packages
if config.packages.core.enable
then [
vim
wget
git
screen
curl
foot
tmux
] else []
)
++ (
if config.packages.gui.enable
then [
# Note taking
logseq
# Communication
mattermost-desktop
slack
zoom-us
vesktop
signal-desktop
teamspeak_client
# Browsing
firefox
tor-browser
# Music
spotify
strawberry-qt6
# Utilities
grim
hyfetch
wofi
waybar
swaynotificationcenter
udiskie
swayidle
hyprlock
pulseaudio
gimp
] else []
)
++ (
if config.packages.programming.enable
then [
neovim
lua
libgcc
php
python3
serverless
jwt-cli
jq
ddev
cloc
ansible
] else []
)
++ (
if config.packages.hacking.enable
then [
metasploit
exploitdb
ghidra
wireshark
nmap
hashcat
dirstalk
] else []
)
++ (
if config.packages.mudding.enable
then [
mudlet
] else []
)
++ (
if config.packages.gaming.enable
then [
steam
protonup-qt
prismlauncher
mudlet
widelands
wesnoth
] else []
);
}

7
modules/users/crow.nix Normal file
View file

@ -0,0 +1,7 @@
{ lib, config, pkgs, ...}: {
users.users.crow = {
isNormalUser = true;
initialPassword = "changeme";
extraGroups = [ "wheel" "networkmanager" ];
};
}

View file

@ -0,0 +1,5 @@
{
imports = [
./crow.nix
];
}

6
shell.nix Normal file
View file

@ -0,0 +1,6 @@
{pkgs ? import <nixpkgs> {}, ...}: {
default = pkgs.mkShell {
NIX_CONFIG = "extra-experimental-features = nix-command flakes";
nativeBuildInputs = with pkgs; [git neovim nix];
};
}