refactor!: restructure and document configuration

This commit is contained in:
Alexandre Cavalheiro S. Tiago da Silva 2025-03-06 05:30:47 -03:00
parent 4a02e072a7
commit f87f9995be
Signed by: wizardlink
GPG key ID: A5767B54367CFBDF
126 changed files with 957 additions and 590 deletions

View file

@ -0,0 +1,18 @@
# READ THIS BEFORE PROCEEDING
Below is a checklist of changes you need to do before rebuilding your system.
## Generate your system configuration and replace the placeholders.
You can achieve this by running `sudo nixos-generate-config`, then overwrite `hardware-configuration.nix` and
`configuration.nix` with the contents of the files found in `/etc/nixos`.
## Replace placeholder text
In `flake.nix` you will find `your-hostname-here`, replace with your machine's current hostname.
In `home-manager.nix` you have to replace:
- `your-username-here` with your user's username;
- `your-home-directory-here` with the path of your home directory, usually the same as your username;
- `your-hostname-here` with your machine's current hostname;
- `your-flake-location-here` with where you are storing the flake.

View file

@ -0,0 +1 @@
{ ... }: { }

View file

@ -0,0 +1,48 @@
{
description = "NixOS System Flake";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
# Ideally using nixos-unstable since my configuration
# is based off of this channel.
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
linuxware = {
url = "github:wizardlink/linuxware";
inputs.nixpkgs.follows = "nixpkgs"; # Pin to your local `nixpkgs` if you use the unstable channel.
};
};
outputs =
{
home-manager,
nixpkgs,
linuxware,
...
}@inputs:
let
system = "x86_64-linux";
in
{
your-hostname-here =
let
specialArgs = inputs;
modules = [
./configuration.nix
home-manager.nixosModules.home-manager
{
home-manager.extraSpecialArgs = inputs;
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.wizardlink = import ./home-manager.nix;
}
linuxware.nixosModules.hyprland
];
in
nixpkgs.lib.nixosSystem { inherit system specialArgs modules; };
};
}

View file

@ -0,0 +1 @@
{ ... }: { }

View file

@ -0,0 +1,98 @@
{
config,
pkgs,
linuxware,
...
}:
{
imports = [
linuxware.homeManagerModules.emacs
linuxware.homeManagerModules.hyprland
linuxware.homeManagerModules.neovim
];
# Home Manager needs a bit of information about you and the paths it should
# manage.
home.username = "your-username-here";
home.homeDirectory = "/home/your-home-directory-here";
# This value determines the Home Manager release that your configuration is
# compatible with. This helps avoid breakage when a new Home Manager release
# introduces backwards incompatible changes.
#
# You should not change this value, even if you update Home Manager. If you do
# want to update the value, then make sure to first check the Home Manager
# release notes.
home.stateVersion = "24.11"; # Please read the comment before changing.
# The home.packages option allows you to install Nix packages into your
# environment.
home.packages = [
# # Adds the 'hello' command to your environment. It prints a friendly
# # "Hello, world!" when run.
# pkgs.hello
# # It is sometimes useful to fine-tune packages, for example, by applying
# # overrides. You can do that directly here, just don't forget the
# # parentheses. Maybe you want to install Nerd Fonts with a limited number of
# # fonts?
# (pkgs.nerdfonts.override { fonts = [ "FantasqueSansMono" ]; })
# # You can also create simple shell scripts directly inside your
# # configuration. For example, this adds a command 'my-hello' to your
# # environment:
# (pkgs.writeShellScriptBin "my-hello" ''
# echo "Hello, ${config.home.username}!"
# '')
];
# Home Manager is pretty good at managing dotfiles. The primary way to manage
# plain files is through 'home.file'.
home.file = {
# # Building this configuration will create a copy of 'dotfiles/screenrc' in
# # the Nix store. Activating the configuration will then make '~/.screenrc' a
# # symlink to the Nix store copy.
# ".screenrc".source = dotfiles/screenrc;
# # You can also set the file content immediately.
# ".gradle/gradle.properties".text = ''
# org.gradle.console=verbose
# org.gradle.daemon.idletimeout=3600000
# '';
};
# Home Manager can also manage your environment variables through
# 'home.sessionVariables'. These will be explicitly sourced when using a
# shell provided by Home Manager. If you don't want to manage your shell
# through Home Manager then you have to manually source 'hm-session-vars.sh'
# located at either
#
# ~/.nix-profile/etc/profile.d/hm-session-vars.sh
#
# or
#
# ~/.local/state/nix/profiles/profile/etc/profile.d/hm-session-vars.sh
#
# or
#
# /etc/profiles/per-user/wizardlink/etc/profile.d/hm-session-vars.sh
#
home.sessionVariables = {
# EDITOR = "emacs";
};
# Let Home Manager install and manage itself.
programs.home-manager.enable = true;
programs.neovim = {
# Enable Neovim, pre-configured by `linuxware`.
enable = true;
# Configure nixd
nixd = {
hostname = "your-hostname-here";
location = "your-flake-location-here";
};
};
}