Merge branch 'flake' into 'main'

Move to flakes

See merge request ahoneybun/nix-configs!5
This commit is contained in:
Aaron Honeycutt 2024-01-30 17:41:13 +00:00
commit f394d292e9
15 changed files with 218 additions and 296 deletions

View file

@ -6,9 +6,14 @@ This holds my .nix files for NixOS
These files are for the configuration, software that I use and unstable software that I use, note that some systems like the Pinebook Pro will use a custom configuration file.
- `configuration.nix` : This is the main file for the base system including some applications that I use
- `programs.nix` : This file adds applications like Slack, Discord and virt-manager including turning on the services
- `unstable.nix` : This file has the applications that need to be from unstable to work like ProtonVPN software
- `flake.nix` : This is the main flake for system selection then that includes configuration, hardware-configuration (created during installation of NixOS), home-manager and Disko
- `configuration.nix` : This is the main file for the base system
## Partition Nix files: (nix-configs/partitions/)
These files are for the partition layouts that I use.
- `luks-btrfs-subvolumes.nix` : This is the main layout that I use for pretty much every system that I install NixOS on
## Desktop Nix files: (nix-configs/desktops/)
@ -23,10 +28,13 @@ These files are for the desktops (DE or WM) that I use at times.
These files are for the systems themselves such as my Pinebook Pro, Raspberry Pi 4B or HP Omen.
**NOTE:** These are only really used to set the hostname, install the NVIDIA driver (like for thelio-nvidia) and such.
### x86_64 Nix files: (nix-configs/systems/x86_64/)
- `shepard.nix` : This file is for my custom desktop at home.
- `garrus.nix` : This file is for my System76 Galago Pro (galp3-b).
- `thelio-nvidia.nix` : This file is for my work Thelio B1.
- `sovereign.nix` : This file is for a Linode instance but it could be for other VPS services as well.
- `harbinger.nix` : This file is for a Linode instance but it could be for other VPS services as well.
@ -49,7 +57,6 @@ These files are for building software or for spinning something up like CUDA.
- `cuda-shell.nix` : This file setups CUDA (currently 11.7).
- `system-docs` : This is for building support.system76.com on NixOS for development.
- `COSMIC` : This is for building COSMIC on NixOS, there is no way to actually use it on NixOS though with how systemd works.
## Web Nix files: (nix-configs/web/)
@ -68,7 +75,6 @@ These files are for websites such as LAMP and NGINX.
This file is for using with [Home Manager](https://nix-community.github.io/home-manager/index.html#sec-install-standalone).
- `home.nix` : This file is for settings for my user like Git name/email and other settings
### Screenshots

View file

@ -1,15 +1,9 @@
{ config, pkgs, ... }:
{
# Import other configuration modules
# (hardware-configuration.nix is autogenerated upon installation)
# paths in nix expressions are always relative the file which defines them
imports =
[
./hardware-configuration.nix
"${builtins.fetchTarball "https://github.com/nix-community/disko/archive/master.tar.gz"}/module.nix"
./disko-config.nix
# ./programs.nix
# ./hardware-configuration.nix
];
# Latest kernel
@ -37,17 +31,6 @@
# Enter keyboard layout
services.xserver.layout = "us";
# Enable Flatpak
xdg = {
portal = {
enable = true;
extraPortals = with pkgs; [
xdg-desktop-portal-wlr
xdg-desktop-portal-kde
];
};
};
# Define user accounts
users.users.aaronh = {
description = "Aaron Honeycutt";
@ -56,36 +39,6 @@
isNormalUser = true;
hashedPassword = "$6$aAcbLtqiqzySifls$jdKMOQjoWITHD/dWNNZVUH/qNc6aoJ7v4zYofi0U7IJSVTbmOfChS3mzaJbp57AodjdPNKPrnrip8Nlh2Qanx.";
packages = with pkgs; [
neofetch
];
};
programs.bash = {
shellAliases = {
generations = "sudo nix-env -p /nix/var/nix/profiles/system --list-generations";
nix-upgrade = "sudo nixos-rebuild switch --upgrade";
};
};
programs.git = {
lfs.enable = true;
config = {
color = {
ui = "auto";
};
color.status = {
added = "green bold";
changed = "yellow bold";
untracked = "red bold";
};
push = {
autoSetupRemote = "true";
};
init = {
defaultBranch = "main";
};
};
};
# Allow Unfree
@ -129,7 +82,6 @@
hardware.bluetooth.enable = true;
# Enable services
services.flatpak.enable = true;
services.fwupd.enable = true;
services.printing.enable = true;
services.openssh.enable = true;

11
desktops/cosmic.nix Normal file
View file

@ -0,0 +1,11 @@
{ config, pkgs, ... }:
{
# COSMIC
services.xserver = {
enable = true;
displayManager.gdm.enable = true;
desktopManager.cosmic.enable = true;
};
}

105
flake.nix Normal file
View file

@ -0,0 +1,105 @@
{
description = "Generic System Flake file";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/release-23.11";
disko = {
url = github:nix-community/disko;
inputs.nixpkgs.follows = "nixpkgs";
};
home-manager = {
url = "github:nix-community/home-manager/release-23.11";
inputs.nixpkgs.follows = "nixpkgs"; # Use system packages list where available
};
};
outputs = { self, nixpkgs, disko, home-manager, ... }@inputs: {
nixosConfigurations = {
"nixos" = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
# Add Disko for disk management
disko.nixosModules.disko
./disko-config.nix
./configuration.nix
./hardware-configuration.nix
];
};
"dev-one" = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
# Add Disko for disk management
disko.nixosModules.disko
./disko-config.nix
./gnome.nix
./configuration.nix
./hardware-configuration.nix
home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.aaronh = import ./home.nix;
}
];
};
"thelio-b1" = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
# Add Disko for disk management
disko.nixosModules.disko
./disko-config.nix
./gnome.nix
./thelio-nvidia.nix
./configuration.nix
./hardware-configuration.nix
home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.aaronh = import ./home.nix;
}
];
};
"garrus" = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
# Add Disko for disk management
disko.nixosModules.disko
./disko-config.nix
./gnome.nix
./garrus.nix
./configuration.nix
./hardware-configuration.nix
home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.aaronh = import ./home.nix;
}
];
};
"vm" = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
# Add Disko for disk management
disko.nixosModules.disko
./disko-config.nix
./vm.nix
./configuration.nix
./hardware-configuration.nix
home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.aaronh = import ./home.nix;
}
];
};
};
};
}

View file

View file

View file

@ -1,44 +0,0 @@
{
description = "COSMIC Development Environment";
inputs = {
nixpkgs = {url = "github:NixOS/nixpkgs/nixpkgs-unstable";};
flake-utils = {url = "github:numtide/flake-utils";};
};
outputs = {
self,
nixpkgs,
flake-utils,
}:
flake-utils.lib.eachDefaultSystem (system: let
inherit (nixpkgs.lib) optional;
pkgs = import nixpkgs {inherit system;};
fhs = pkgs.buildFHSUserEnv {
name = "COSMIC";
targetPkgs = pkgs: (with pkgs; [
# There is a lot here, because I am not sure about your system. :)
xorg.libX11
xorg.libXext
xorg.libxcb
udev
#runScript = "bash -c ./pico8";
};
in {
devShell = pkgs.mkShell {
buildInputs = with pkgs; [
fhs
];
shellHook = ''
if [ -e pico8 ]
then
tput setaf 2; echo "Pico-8 binary present. Type 'pico8' to get started."; tput sgr0;
else
tput setaf 3; echo "No Pico-8 binary present. Please download it."; tput sgr0;
echo "You can purchase it here:"
tput setaf 2; echo "https://www.lexaloffle.com/pico-8.php"; tput sgr0;
fi
'';
};
});
}

View file

@ -14,24 +14,31 @@
# You can update Home Manager without changing this value. See
# the Home Manager release notes for a list of state version
# changes in each release.
home.stateVersion = "23.05";
home.stateVersion = "23.11";
nixpkgs.config.allowUnfree = true;
nixpkgs.config = {
allowUnfree = true;
};
home.packages = with pkgs; [
# GUI
spotify
vscode
discord
libreoffice-fresh
signal-desktop
system76-keyboard-configurator
tuba
#youtube-music
vscodium
# CLI
mdbook
neofetch
freshfetch
];
programs.bash = {
enable = true;
shellAliases = {
generations = "sudo nix-env -p /nix/var/nix/profiles/system --list-generations";
nix-generations = "sudo nix-env -p /nix/var/nix/profiles/system --list-generations";
nix-upgrade = "sudo nixos-rebuild switch --upgrade";
};
};
@ -64,8 +71,26 @@
};
};
};
programs.command-not-found.enable = true;
programs.nix-index = {
enable = true;
enableBashIntegration = true;
};
dconf.settings = {
"org/gnome/shell" = {
favorite-apps = [ "nautilus.desktop" "gnome-terminal.desktop" "firefox.desktop" "codium.desktop" "signal-desktop.desktop" ];
};
"org/gnome/desktop/peripherals/touchpad" = {
tap-to-click = true;
};
"org/gnome/desktop/interface" = {
clock-show-seconds = true;
clock-show-weekday = true;
color-scheme = "prefer-dark";
enable-hot-corners = false;
};
};
programs.gh.enable = true;

View file

View file

@ -1,35 +0,0 @@
# Builds now
{ pkgs ? import <nixpkgs> {} }:
pkgs.mkShell {
nativeBuildInputs = with pkgs; [
appstream-glib
cargo
clang
cmake
dbus
desktop-file-utils
egl-wayland
glib
gtk3
gtk4
lld
llvm
llvmPackages_15.llvm
libclang
libglvnd
libinput
libpulseaudio
libxkbcommon
mesa
meson
ninja
pipewire
pkg-config
seatd
systemd
];
LIBCLANG_PATH = "${pkgs.llvmPackages_15.libclang.lib}/lib";
}

View file

@ -3,9 +3,13 @@
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/release-23.11";
disko = {
url = github:nix-community/disko;
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, nixpkgs, ... }@inputs: {
outputs = { self, nixpkgs, disko, ... }@inputs: {
nixosConfigurations = {
"vm" = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
@ -13,63 +17,68 @@
# Import the configuration.nix we used before, so that the old configuration file can still take effect.
# Note: /etc/nixos/configuration.nix itself is also a Nix Module, so you can import it directly here
# ./configuration.nix
disko.nixosModules.disko
./disko-config.nix
{
_module.args.disks = [ "/dev/vda" ];
}
./hardware-configuration.nix
({config, pkgs, ...}: {
nix = {
settings.auto-optimise-store = true;
settings.experimental-features = [ "nix-command" "flakes" ];
nix = {
settings.auto-optimise-store = true;
settings.experimental-features = [ "nix-command" "flakes" ];
gc = {
automatic = true;
dates = "weekly";
options = "--delete-older-than 30d";
};
gc = {
automatic = true;
dates = "weekly";
options = "--delete-older-than 30d";
};
};
};
boot = {
kernelPackages = pkgs.linuxPackages_latest;
boot = {
kernelPackages = pkgs.linuxPackages_latest;
loader = {
systemd-boot.enable = true;
systemd-boot.consoleMode = "0";
};
loader = {
systemd-boot.enable = true;
systemd-boot.consoleMode = "0";
};
};
};
networking = {
hostName = "vm";
networking = {
hostName = "vm";
networkmanager.enable = true;
};
};
users.users.aaronh = {
isNormalUser = true;
extraGroups = [ "wheel" "networkmanager" ]; # Enable sudo for the user.
packages = with pkgs; [
cargo
git
git-lfs
];
};
environment.systemPackages = with pkgs; [
users.users.aaronh = {
isNormalUser = true;
extraGroups = [ "wheel" "networkmanager" ]; # Enable sudo for the user.
packages = with pkgs; [
cargo
git
git-lfs
neofetch
tree
wget
];
services.openssh = {
enable = true;
settings.PermitRootLogin = "no";
};
];
};
system = {
stateVersion = "23.11";
autoUpgrade.enable = true;
};
environment.systemPackages = with pkgs; [
git
git-lfs
neofetch
tree
wget
];
services.openssh = {
enable = true;
settings.PermitRootLogin = "no";
};
system = {
stateVersion = "23.11";
autoUpgrade.enable = true;
};
})
];
};

View file

@ -1,115 +1,8 @@
{ config, pkgs, ... }:
{
# Import other configuration modules
# (hardware-configuration.nix is autogenerated upon installation)
# paths in nix expressions are always relative the file which defines them
imports =
[
./hardware-configuration.nix
"${builtins.fetchTarball "https://github.com/nix-community/disko/archive/master.tar.gz"}/module.nix"
./disko-config.nix
# ./programs.nix
];
# Latest kernel
boot.kernelPackages = pkgs.linuxPackages_latest;
# Add kernel parameters for virtual machines
boot.kernelParams = [ "vfio-pci.ids=8086:9b41" "qxl" "bochs_drm"];
boot.loader = {
systemd-boot.enable = true;
systemd-boot.consoleMode = "0";
};
#nix.settings.auto-optimise-store = true;
nix.settings.experimental-features = [ "nix-command" "flakes" ];
nix.gc = {
automatic = true;
dates = "weekly";
options = "--delete-older-than 30d";
};
networking.networkmanager.enable = true;
# Set your time zone.
time.timeZone = "America/Denver";
# Enter keyboard layout
services.xserver.layout = "us";
# Define user accounts
users.users.aaronh = {
description = "Aaron Honeycutt";
home = "/home/aaronh";
extraGroups = [ "wheel" "networkmanager" "adm"];
isNormalUser = true;
hashedPassword = "$6$aAcbLtqiqzySifls$jdKMOQjoWITHD/dWNNZVUH/qNc6aoJ7v4zYofi0U7IJSVTbmOfChS3mzaJbp57AodjdPNKPrnrip8Nlh2Qanx.";
packages = with pkgs; [
firefox
neofetch
];
};
# Allow Unfree
nixpkgs.config.allowUnfree = true;
# Install some packages
environment.systemPackages =
with pkgs;
[
nix-index
nvd
unzip
wget
xz
];
# Enable/Disable hardware
## Turn off PulseAudio
hardware.pulseaudio.enable = false;
# Enable Pipewire
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
};
# Enable Bluetooth
hardware.bluetooth.enable = true;
services.printing.enable = true;
services.openssh.enable = true;
services.avahi = {
enable = true;
nssmdns = true;
openFirewall = true;
# Needed for detecting scanners
publish = {
enable = true;
addresses = true;
userServices = true;
};
};
# Scanner support
hardware.sane.enable = true;
hardware.sane.extraBackends = [ pkgs.sane-airscan ];
services.ipp-usb.enable = true;
system.activationScripts.diff = {
supportsDryActivation = true;
text = ''
${pkgs.nvd}/bin/nvd --nix-bin-dir=${pkgs.nix}/bin diff /run/current-system "$systemConfig"
'';
};
# System
system.stateVersion = "23.11";
system.autoUpgrade.enable = true;
networking.hostName = "vm";
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 106 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 239 KiB