I looked through most of the files when someone else mentioned I can’t use /home
anywhere but I’ll cat them all out and copy them below, if I find one I’ll try to update it.
# configuration.nix
# The main configuration for the NixOS system
{ inputs, config, pkgs, ... }:
{
imports =
[
./hardware-configuration.nix
./locale.nix
./packages.nix
./display.nix
./network.nix
./multimedia.nix
./system.nix
./services.nix
inputs.home-manager.nixosModules.home-manager
];
home-manager = {
extraSpecialArgs = { inherit inputs; };
users = {
anakin = import ./home.nix;
};
};
nix.settings.experimental-features = [ "nix-command" "flakes" ];
}
# display.nix
# this is the configuration for the display server settings for the NixOS system
{ config, pkgs, ... }:
{
services.xserver.enable = true;
services.xserver.videoDrivers = [ "amdgpu" "displaylink" "modesetting"]; # For AMD graphics
hardware.firmware = [ pkgs.linux-firmware ]; # Correctly specifying firmware package
services.xserver.displayManager.lightdm.enable = true;
services.xserver.displayManager.lightdm.background = /home/anakin/Wallpapers/Untitled_Artwork.jpeg;
services.xserver.windowManager.qtile.enable = true;
services.xserver.xkb = {
layout = "us";
variant = "";
};
services.libinput.enable = true;
}
{
description = "my NixOS flake";
inputs = {
nixpkgs.url = "nixpkgs/nixos-unstable";
zen-browser.url = "github:0xc000022070/zen-browser-flake";
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = {self, nixpkgs, home-manager, ...}@inputs:
let
system = "x86_64-linux";
pkgs = import nixpkgs {
inherit system;
config = {
allowUnfree = true;
};
};
in
{
nixosConfigurations = {
anakin = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = {inherit inputs system; };
modules = [
./configuration.nix
{ home-manager.users.anakin = ./home.nix; }
];
};
};
};
}
#home.nix
{ config, pkgs, inputs, ... }:
{
home.username = "anakin";
home.homeDirectory = "/home/anakin";
home.stateVersion = "23.11";
programs.home-manager.enable = true;
}
There is a /home/anakin
here, and I also pasted this file above. I assume it’s proper as it defines the home directory but I can change it
# locale.nix
# the configuration for locale and timezone information in the NixOS system
{ config, pkgs, ... }:
{
time.timeZone = "America/New_York"; # Set your time zone.
i18n.defaultLocale = "en_US.UTF-8";
i18n.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";
};
}
# multimedia.nix
# this file is for configuring various audio and video settings
{ config, pkgs, ... }:
{
services.pulseaudio.enable = false;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
jack.enable = true;
};
# services.xserver.displayManager.sessionCommands = ''
# ${lib.getBin pkgs.xorg.xrandr}/bin/xrandr --setprovideroutputsource 2 0
# '';
}
# network.nix
# this file is for configuring network and firewall settings
{ config, pkgs, lib, ... }:
{
networking.hostName = "nixos"; # Define your hostname.
networking.networkmanager.enable = true;
# Enable CUPS to print documents.
services.printing.enable = true;
# Example of additional networking settings:
networking.firewall.enable = true;
networking.firewall.allowedTCPPorts = [ 22 ];
# networking.firewall.allowedUDPPorts = [ ... ];
services.openssh.enable = true;
# Enable resolvconf for DNS management
networking.resolvconf = {
enable = true;
package = lib.mkForce pkgs.openresolv;
};
# Setting up Rapsberry Pi router; comment out after set up is complete
#networking.interfaces.etho.ipv4.addresses = [ {
# address = "192.168.1.10";
# prefixLength = 24;
#} ];
#networking.defaultGateway = "192.168.1.1";
#networking.nameservers = [ "1.1.1.1" ];
}
I was trying to set up raspberry pi router with OpenWRT a while ago, which is what all the comments at the bottom are about. Additionally, I didn’t think the hostname mattered, and I ran sudo nixos-rebuild switch --flake /home/anakin/Nixos#nixos
out of curiosity because I don’t know if I was jsut that dumb this whole time and that doesn’t get anywhere.
# packages.nix
# this is for adding and removing packages from the NixOS system
{ config, pkgs, inputs, ... }:
{
environment.systemPackages = with pkgs; [
bash
blueman
brightnessctl
cryptsetup
displaylink
firmwareLinuxNonfree
home-manager
pavucontrol
pulseaudioFull
python3
python3Packages.qtile-extras
python3Packages.pip
python3Packages.pillow
python3Packages.psutil
udev
unzip
vim
wget
wg-netmanager
wireguard-tools
xorg.libxcb
xorg.libXext
xorg.libX11
inputs.zen-browser.packages."${system}".default
inputs.zen-browser.packages."${system}".beta
inputs.zen-browser.packages."${system}".twilight
inputs.zen-browser.packages."${system}".twilight-official
];
users.users.anakin = {
isNormalUser = true;
description = "anakin";
extraGroups = [ "networkmanager" "wheel" ];
packages = with pkgs; [
arandr
brave
discord
dosfstools
drm_info
dunst
emacs
eza
exfatprogs
fastfetch
file
fzf
flameshot
gimp
git
ghostscript
ghostty
graphicsmagick
htop
jellyfin-ffmpeg
kitty
kmonad
#localsend
mpv
nitrogen
neovim
picom
#protonvpn-gui
#protonmail-desktop
python3Packages.qtile-extras
python3Packages.pywal
tldr
ripgrep
rofi
rpi-imager
spotify
spotify-player
udiskie
ueberzug
usbutils
vieb
viu
vlc
yazi
#zellij
zoxide
];
};
programs.firefox.enable = true;
nixpkgs.config.allowUnfree = true;
}
This file is full of junk because I was playing around with some stuff when I was trying to learn what sort of programs I wanted to use, as well as the inputs for trying to make the Zen browser work (The reason I am trying to do flake things at all).
# Services.nix
{ config, pkgs, ... }:
{
# Enabling battery management through tlp
services.tlp.enable = true;
services.tlp.settings = {
START_CHARGE_THRESH_BAT0 = 50;
STOP_CHARGE_THRESH_BAT0 = 85;
RUNTIME_PM_ALL = "auto";
#DISK_APM_LEVEL_ON_AC= "254";
#DISK_APM_LEVEL_ON_BAT= "128";
DEVICES_TO_DISABLE_ON_AC="bluetooth";
DEVICES_TO_DISABLE_ON_BAT="bluetooth";
CPU_SCALING_GOVERNOR_ON_AC = "performance";
CPU_SCALING_GOVERNOR_ON_BAT = "powersave";
SOUND_POWER_SAVE_ON_BAT = 5;
SOUND_POWER_SAVE_CONTROLLER = "Y";
MEM_SLEEP_ON_AC= "s2idle";
MEM_SLEEP_ON_BAT= "deep";
};
# Running the emacs background daemon
systemd.services.emacs = {
description = "Emacs: the extensible, self-documenting text editor";
after = [ "network.target" ]; # Adjust dependencies as needed
wantedBy = [ "multi-user.target" ];
serviceConfig = {
Type = "forking";
ExecStart = "${pkgs.emacs}/bin/emacs --daemon";
ExecStop = "${pkgs.emacs}/bin/emacsclient --eval '(kill-emacs)'";
Restart = "always";
User = "anakin"; # Replace with your actual username
};
};
# Systemd-resolved service
services.resolved.enable = true;
#Enables bletooth connection
services.blueman.enable = true;
}
There’s some stuff in here I was trying to use to help prolong my battery life away from the wall, as well as I was trying some emacs before deciding I prefer vim
# system.nix
# This is the file for boot laoder, system version, and other system information
# system.nix
{ config, pkgs, ... }:
{
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
swapDevices = [
{ device = "/swap"; }
];
boot.kernelParams = [ "resume=/swap" ];
hardware.firmware = [ pkgs.linux-firmware ];
hardware.bluetooth.enable = true;
# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions
# on your system were taken. It‘s perfectly fine and recommended to leave
# this value at the release version of the first install of this system.
# Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "24.05"; # Did you read the comment?
}
I’m not seeing any problematic /home
references here, but I have been staring at my terminal for a while now, and absolutley could have missed it. Or I have some other error I’m totally overlooking, Apologies for basically pasting a wall of text but i’m not sure of an esaier way