Compare commits

...

5 commits

Author SHA1 Message Date
373afff21c pixnix: enable libvirtd 2023-09-23 21:16:50 -05:00
3a9be32cbe pixnix: add sshd 2023-09-23 21:08:45 -05:00
a75028bfdc misc cleanup 2023-09-23 20:46:36 -05:00
ff27e74690 flakerize nixos config 2023-09-23 19:14:49 -05:00
76034965c8 initial import of nixos config 2023-09-23 18:03:35 -05:00
17 changed files with 211 additions and 1 deletions

View file

@ -36,6 +36,7 @@ in
ssh = "TERM=xterm command ssh $argv";
# Rebuild home-manager
switch-home = "home-manager switch -b backup --flake ${config.home.homeDirectory}/.dotfiles#$USER@$(hostname -s)";
switch-nix = "sudo nixos-rebuild switch --flake ${config.home.homeDirectory}/.dotfiles";
};
interactiveShellInit =

View file

@ -7,7 +7,6 @@
# packages
home.packages = with pkgs; [
libvirt
vagrant
];
}

View file

@ -0,0 +1,37 @@
{ inputs, outputs,... }: {
imports = [
inputs.home-manager.nixosModules.home-manager
./fish.nix
./tailscale.nix
] ++ (builtins.attrValues outputs.nixosModules);
home-manager.extraSpecialArgs = { inherit inputs outputs; };
nixpkgs = {
overlays = builtins.attrValues outputs.overlays;
config = {
allowUnfree = true;
};
};
environment.enableAllTerminfo = true;
hardware.enableRedistributableFirmware = true;
networking.domain = "vim.wtf";
i18n = {
defaultLocale = "en_US.UTF-8";
extraLocaleSettings = {
LC_ADDRESS = "en_US.UTF-8";
LC_IDENTIFICATION = "en_US.UTF-8";
LC_MEASUREMENT = "en_US.UTF-8";
LC_MONETARY = "en_US.UTF-8";
LC_NAME = "en_US.UTF-8";
LC_NUMERIC = "en_US.UTF-8";
LC_PAPER = "en_US.UTF-8";
LC_TELEPHONE = "en_US.UTF-8";
LC_TIME = "en_US.UTF-8";
};
};
}

View file

@ -0,0 +1,10 @@
{
programs.fish = {
enable = true;
vendor = {
completions.enable = true;
config.enable = true;
functions.enable = true;
};
};
}

View file

@ -0,0 +1,7 @@
{ lib, ... }:
{
services.tailscale = {
enable = true;
useRoutingFeatures = lib.mkDefault "client";
};
}

View file

@ -0,0 +1,5 @@
{
virtualisation.docker = {
enable = true;
};
}

View file

@ -0,0 +1,5 @@
{
virtualisation.libvirtd = {
enable = true;
};
}

View file

@ -0,0 +1,3 @@
{
services.sshd.enable = true;
}

View file

@ -0,0 +1,6 @@
{
imports = [ ../global/tailscale.nix ];
services.tailscale = {
useRoutingFeatures = "both";
};
}

View file

@ -0,0 +1,5 @@
{
programs.wireshark = {
enable = true;
};
}

View file

@ -0,0 +1,27 @@
{ pkgs, config, ... }:
let ifTheyExist = groups: builtins.filter (group: builtins.hasAttr group config.users.groups) groups;
in
{
users.users.john = {
isNormalUser = true;
shell = pkgs.fish;
extraGroups = [
"audio"
"video"
"wheel"
] ++ ifTheyExist [
"docker"
"libvirtd"
"mysql"
"network"
"networkmanager"
"podman"
"wireshark"
];
packages = [ pkgs.home-manager ];
};
home-manager.users.john = import ../../../../home/${config.networking.hostName}.nix;
}

33
hosts/pixnix/default.nix Normal file
View file

@ -0,0 +1,33 @@
{ pkgs, inputs, ... }: {
imports = [
inputs.hardware.nixosModules.common-cpu-intel
inputs.hardware.nixosModules.common-pc-ssd
./hardware-configuration.nix
./services
../common/global
../common/users/john
../common/optional/docker.nix
../common/optional/libvirtd.nix
../common/optional/sshd.nix
];
boot = {
loader = {
systemd-boot.enable = true;
efi.canTouchEfiVariables = true;
};
};
networking = {
hostName = "pixnix";
networkmanager.enable = true;
};
time.timeZone = "America/Chicago";
system.stateVersion = "23.05";
}

View file

@ -0,0 +1,40 @@
# 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" "usb_storage" "sd_mod" "sdhci_pci" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/b2c7656b-2292-4dc9-94f2-a66690a14969";
fsType = "ext4";
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/495A-C854";
fsType = "vfat";
};
swapDevices =
[ { device = "/dev/disk/by-uuid/9cd48b44-07e5-4d0f-aaf0-7ca07e7b7945"; }
];
# 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.wlp1s0.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

View file

@ -0,0 +1,7 @@
{
imports = [
./pipewire.nix
./printing.nix
./xserver.nix
];
}

View file

@ -0,0 +1,11 @@
{
sound.enable = true;
hardware.pulseaudio.enable = false;
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
};
}

View file

@ -0,0 +1,5 @@
{
services.printing = {
enable = true;
};
}

View file

@ -0,0 +1,9 @@
{
services.xserver = {
enable = true;
displayManager.gdm.enable = true;
desktopManager.gnome.enable = true;
layout = "us";
xkbVariant = "";
};
}