This commit is contained in:
cnst
2024-06-15 18:25:29 +02:00
parent c4975c7c0c
commit 4ce4dffc50
4 changed files with 107 additions and 30 deletions

View File

@@ -3,13 +3,14 @@
inputs = {
# Nixpkgs
nixpkgs.url = "github:nixos/nixpkgs/nixos-23.11";
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
nixpkgs-stable.url = "github:nixos/nixpkgs/nixos-24.05";
# Home manager
home-manager.url = "github:nix-community/home-manager/release-23.11";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = {
self,
nixpkgs,
@@ -21,8 +22,7 @@
# NixOS configuration entrypoint
# Available through 'nixos-rebuild --flake .#your-hostname'
nixosConfigurations = {
# FIXME replace with your hostname
your-hostname = nixpkgs.lib.nixosSystem {
cnix = nixpkgs.lib.nixosSystem {
specialArgs = {inherit inputs outputs;};
# > Our main nixos configuration file <
modules = [./nixos/configuration.nix];
@@ -32,9 +32,8 @@
# Standalone home-manager configuration entrypoint
# Available through 'home-manager --flake .#your-username@your-hostname'
homeConfigurations = {
# FIXME replace with your username@hostname
"your-username@your-hostname" = home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages.x86_64-linux; # Home-manager requires 'pkgs' instance
"cnst@cnix" = home-manager.lib.homeManagerConfiguration {
pkgs = pkgsFor.x86_64-linux;
extraSpecialArgs = {inherit inputs outputs;};
# > Our main home-manager configuration file <
modules = [./home-manager/home.nix];

View File

@@ -40,13 +40,49 @@
# TODO: Set your username
home = {
username = "your-username";
homeDirectory = "/home/your-username";
username = "cnst";
homeDirectory = "/home/cnst";
};
# Add stuff for your user as you see fit:
# programs.neovim.enable = true;
# home.packages = with pkgs; [ steam ];
programs.neovim.enable = true;
home.packages = with pkgs; [
# Dev
pyright
python312Packages.pip
python3
nodejs_22
cargo
# Utils
unzip
wget
curl
gzip
p7zip
ripgrep
git
wireguard-tools
# Desktop
firefox
alacritty
wl-clipboard
dunst
keepassxc
ranger
xfce.thunar
xfce.thunar-volman
xfce.thunar-archive-plugin
xarchiver
gvfs
];
# Hyprland & accessories
programs.hyprland.enable = true;
programs.waybar.enable = true;
programs.nm-applet.indicator = true;
# Enable home-manager and git
programs.home-manager.enable = true;
@@ -56,5 +92,5 @@
systemd.user.startServices = "sd-switch";
# https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion
home.stateVersion = "23.05";
home.stateVersion = "24.05";
}

View File

@@ -59,25 +59,56 @@
nixPath = lib.mapAttrsToList (n: _: "${n}=flake:${n}") flakeInputs;
};
# FIXME: Add the rest of your current configuration
# System packages
environment.systemPackages = with pkgs; [
git
neovim
];
# Bootloader
boot.loader.grub.enable = true;
boot.loader.grub.device = "/dev/vda";
boot.loader.grub.useOSProber = true;
# TODO: Set your hostname
networking.hostName = "your-hostname";
networking.hostName = "cnix";
# Time zone & Locale
time.timeZone = "Europe/Stockholm";
i18n.defaultLocale = "en_US.UTF-8";
i18n.extraLocaleSettings = {
LC_ADDRESS = "sv_SE.UTF-8";
LC_IDENTIFICATION = "sv_SE.UTF-8";
LC_MEASUREMENT = "sv_SE.UTF-8";
LC_MONETARY = "sv_SE.UTF-8";
LC_NAME = "sv_SE.UTF-8";
LC_NUMERIC = "sv_SE.UTF-8";
LC_PAPER = "sv_SE.UTF-8";
LC_TELEPHONE = "sv_SE.UTF-8";
LC_TIME = "sv_SE.UTF-8";
};
# COnfigure keymap in X11
services.xserver = {
layout = "us";
xkbVariant = "";
};
# TODO: Configure your system-wide user settings (groups, etc), add more users as needed.
users.users = {
# FIXME: Replace with your username
your-username = {
cnst = {
# TODO: 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!
initialPassword = "correcthorsebatterystaple";
initialPassword = "1234";
isNormalUser = true;
openssh.authorizedKeys.keys = [
# TODO: Add your SSH public key(s) here, if you plan on using SSH to connect
];
# TODO: Be sure to add any other groups you need (such as networkmanager, audio, docker, etc)
extraGroups = ["wheel"];
extraGroups = [ "wheel" "networkmanager" "audio" "video" ];
};
};
@@ -95,5 +126,5 @@
};
# https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion
system.stateVersion = "23.05";
system.stateVersion = "24.05";
}

View File

@@ -1,12 +1,23 @@
# This is just an example, you should generate yours with nixos-generate-config and put it in here.
{
boot.loader.systemd-boot.enable = true;
{ config, lib, pkgs, modulesPath, ... }:
fileSystems."/" = {
device = "/dev/sda1";
{
imports =
[ (modulesPath + "/profiles/qemu-guest.nix")
];
boot.initrd.availableKernalModules = [ "ahci" "xhci_pci" "virtio_pci" "sr_mod" "virtio_blk" ];
boot.initrd.kernalModules = [ ];
boot.kernalModules = [ "kvm-amd ];
boot.extraModulePackages = [ ];
filesSystems."/" =
{ device = "/dev/disk/by-uuid/66495946-e6f4-48db-bab3-e1d4cafc326d";
fsType = "ext4";
};
# Set your system kind (needed for flakes)
nixpkgs.hostPlatform = "x86_64-linux";
swapDevices = [ ];
networking.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
}