reorganize

This commit is contained in:
2024-02-27 10:52:11 -05:00
parent ccecea715c
commit 30cba6caf1
13 changed files with 120 additions and 40 deletions

View File

@@ -0,0 +1,25 @@
{ config, pkgs, inputs, ... }:
{
imports =
[ # Include the results of the hardware scan.
inputs.home-manager.nixosModules.default
];
environment.systemPackages = with pkgs; [
hello
];
home-manager = {
extraSpecialArgs = { inherit inputs; };
useGlobalPkgs = true;
useUserPackages = true;
users = {
"mthomson" = import ./home.nix;
};
};
# Auto upgrade nix package and the daemon service.
services.nix-daemon.enable = true;
nix.package = pkgs.nix;
}

18
hosts/macbook/home.nix Normal file
View File

@@ -0,0 +1,18 @@
{ config, pkgs, ... }:
{
imports = [
../../modules/home-manager/wezterm
];
home.username = "mthomson";
home.homeDirectory = "/Users/mthomson";
home.stateVersion = "23.11";
home.packages = with pkgs; [
hello
cowsay
];
programs.home-manager.enable = true;
programs.git.enable = true;
}

View File

@@ -0,0 +1,117 @@
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running nixos-help).
{ config, pkgs, inputs, ... }:
{
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
inputs.home-manager.nixosModules.default
];
# Bootloader.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
networking.hostName = "nixos"; # Define your hostname.
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
# Enable networking
networking.networkmanager.enable = true;
# Set your time zone.
time.timeZone = "America/Toronto";
# Select internationalisation properties.
i18n.defaultLocale = "en_CA.UTF-8";
# i3 relates stuff
environment.pathsToLink = [ "/libexec" ];
services.xserver = {
enable = true;
desktopManager = {
xterm.enable = false;
};
videoDrivers = [ "nvidia "];
displayManager = {
defaultSession = "none+i3";
lightdm.enable = true;
};
windowManager.i3 = {
enable = true;
package = pkgs.i3-gaps;
extraPackages = with pkgs; [
dmenu
i3status
i3lock
i3blocks
feh
arandr
];
};
layout = "us";
xkbVariant = "";
};
# pipewire
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
};
# Define a user account. Don't forget to set a password with passwd.
users.users.mthomson = {
isNormalUser = true;
description = "Michael Thomson";
extraGroups = [ "networkmanager" "wheel" ];
packages = with pkgs; [];
};
# Allow unfree packages
nixpkgs.config.allowUnfree = true;
nix.settings.experimental-features = [ "nix-command" "flakes" ];
environment.systemPackages = with pkgs; [
neovim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
wget
git
curl
];
environment.variables.EDITOR = "nvim";
home-manager = {
extraSpecialArgs = { inherit inputs; };
useGlobalPkgs = true;
useUserPackages = true;
users = {
"mthomson" = import ./home.nix;
};
};
programs.nix-ld.enable = true;
programs.nix-ld.libraries = with pkgs; [
# Add any missing dynamic libraries for unpackaged programs
# here, NOT in environment.systemPackages
];
# 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. Its 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 = "23.11"; # Did you read the comment?
}

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 = [ "nvme" "ahci" "xhci_pci" "usbhid" "usb_storage" "sd_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/96c63add-dc4b-473e-9273-db9e281f3004";
fsType = "ext4";
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/A240-8690";
fsType = "vfat";
};
swapDevices =
[ { device = "/dev/disk/by-uuid/3b38e555-ddc9-41ae-a3c7-49a20a2c5295"; }
];
# 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.enp38s0.useDHCP = lib.mkDefault true;
# networking.interfaces.wlo1.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

24
hosts/nixos/home.nix Normal file
View File

@@ -0,0 +1,24 @@
{ config, pkgs, ... }:
{
imports = [
./i3
./wezterm
./nvim
];
home.username = "mthomson";
home.homeDirectory = "/home/mthomson";
home.stateVersion = "23.11";
home.packages = with pkgs; [
cowsay
firefox
_1password-gui
gcc
fzf
nodejs
];
programs.home-manager.enable = true;
programs.git.enable = true;
}