This commit is contained in:
Alex Davies 2024-05-14 18:33:50 -03:00
commit 274e4e5627
6 changed files with 82 additions and 3 deletions

View File

@ -98,6 +98,19 @@
./nixos/zerotier.nix
];
};
gwen = nixpkgs.lib.nixosSystem {
specialArgs = {
inherit inputs outputs;
hostname = "gwen";
mainUser = "gwen";
};
modules = [
./nixos/configuration.nix
./nixos/kde-desktop.nix
./nixos/family.nix
./nixos/zerotier.nix
];
};
};
# Standalone home-manager configuration entrypoint

View File

@ -1,6 +1,6 @@
# This is your system's configuration file.
# Use this to configure your system environment (it replaces /etc/nixos/configuration.nix)
{ inputs, outputs, lib, config, pkgs, hostname, specialArgs, ... }: {
{ inputs, outputs, lib, config, pkgs, hostname, specialArgs, options, ... }: {
# You can import other NixOS modules here
imports = [
# If you want to use modules your own flake exports (from modules/nixos):
@ -45,6 +45,12 @@
networking.hostName = hostname; # Define your hostname.
networking.networkmanager.enable = true;
virtualisation.vmVariant = {
# following configuration is added only when building VM with build-vm
virtualisation.cores = 4;
virtualisation.memorySize = 4096;
};
# This will add each flake input as a registry
# To make nix3 commands consistent with your flake
nix.registry = (lib.mapAttrs (_: flake: {inherit flake;})) ((lib.filterAttrs (_: lib.isType "flake")) inputs);
@ -114,6 +120,7 @@
PermitRootLogin = "no";
# Use keys only. Remove if you want to SSH using password (not recommended)
PasswordAuthentication = true;
AllowUsers = [ "traverseda" ];
};
};

17
nixos/family.nix Normal file
View File

@ -0,0 +1,17 @@
{ inputs, outputs, lib, config, pkgs, hostname, specialArgs, ... }: {
services.displayManager = {
autoLogin.enable = true;
autoLogin.user = "${specialArgs.mainUser}";
};
users.users = {
gwen = {
# You can set an initial password for your user.
# If you do, you can skip setting a root password by passing '--no-root-passwd' to nixos-install.
# Be sure to change it (using passwd) after rebooting!
isNormalUser = true;
extraGroups = [ "networkManager" ];
};
};
}

40
nixos/hardware/gwen.nix Normal file
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" "nvme" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/91d9a91c-9c69-4d82-85dc-42598b9ceaec";
fsType = "ext4";
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/BED6-71B3";
fsType = "vfat";
};
swapDevices =
[ { device = "/dev/disk/by-uuid/693adc19-c9d6-43a2-8e80-044f93a73af9"; }
];
# 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.wlp0s20f3.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

View File

@ -35,6 +35,7 @@
pkgs.inkscape
pkgs.gimp
pkgs.krita
pkgs.nextcloud-client
];
programs.firefox = {

View File

@ -1,3 +1,5 @@
{ config, pkgs, lib, options, ... }:
let
privateZeroTierInterfaces = [ "zt_aura" ]; # ZT NET INTERFACE
in {
@ -31,6 +33,5 @@ in {
services.zerotierone.enable = true;
#Don't join zerotier if I'm testing in a VM
#if !(options.virtualisation ? qemu) then
services.zerotierone.joinNetworks = [ "e04fa485ed2a4dc4" ];
services.zerotierone.joinNetworks = lib.optionals (!options.virtualisation ? qemu) [ "e04fa485ed2a4dc4" ];
}