nixos-config/README.org

92 lines
4.7 KiB
Org Mode
Raw Normal View History

2023-04-23 05:50:54 +05:30
#+title: NixOS Config
2023-06-06 00:45:48 +05:30
#+author: Emmet
2023-04-23 02:29:37 +05:30
2023-05-06 17:46:35 +05:30
[[https://gitlab.com/librephoenix/nixos-config][Main Repo Link (GitLab)]]
2023-06-29 22:11:57 +05:30
[[https://github.com/librephoenix/nixos-config][Mirror Repo Link (GitHub)]]
2023-05-06 17:46:35 +05:30
[[https://codeberg.org/librephoenix/nixos-config][Mirror Repo Link (Codeberg)]]
2023-06-11 20:56:47 +05:30
** What is this repository?
2023-06-02 03:30:22 +05:30
These are my dotfiles (configuration files) for my NixOS setup(s).
2023-04-23 02:29:37 +05:30
Here is my main setup:
[[desktop.png]]
2024-02-26 03:24:56 +05:30
** My Themes
2023-06-21 21:10:48 +05:30
[[https://github.com/danth/stylix#readme][Stylix]] (and [[https://github.com/SenchoPens/base16.nix#readme][base16.nix]], of course) is amazing, allowing you to theme your entire system with base16-themes.
Using this I have [[./themes][55+ themes]] (I add more sometimes) I can switch between on-the-fly. Visit the [[./themes][themes directory]] for more info and screenshots!
2023-06-11 20:56:47 +05:30
** Install
I wrote some reinstall notes for myself [[./install.org][here (install.org)]].
2023-04-23 02:29:37 +05:30
TLDR: You should™ be able to install my dotfiles to a fresh NixOS system with the following experimental script:
2024-02-26 03:20:21 +05:30
#+begin_src sh :noeval
nix-shell -p git nixFlakes --command "nix run gitlab:librephoenix/nixos-config"
2024-02-26 03:20:21 +05:30
#+end_src
Disclaimer: Ultimately, I can't gaurantee this will work for anyone other than myself, so /use this at your own discretion/. Also my dotfiles are /highly/ opinionated, which you will discover immediately if you try them out.
Potential Errors: I've only tested it working on UEFI with the default EFI mount point of =/boot=. I've added experimental legacy (BIOS) boot support, but it does rely on a quick and dirty script to find the grub device. If you are testing it using some weird boot configuration for whatever reason, try modifying =bootMountPath= (UEFI) or =grubDevice= (legacy BIOS) in =flake.nix= before install, or else it will complain about not being able to install the bootloader.
2024-02-29 07:47:48 +05:30
Note: If you're installing this to a VM, Hyprland won't work unless 3D acceleration is enabled.
Security Disclaimer: If you install or copy my =homelab= or =worklab= profiles, /CHANGE THE PUBLIC SSH KEYS UNLESS YOU WANT ME TO BE ABLE TO SSH INTO YOUR SERVER. YOU CAN CHANGE OR REMOVE THE SSH KEY IN THE RELEVANT CONFIGURATION.NIX/:
- [[./profiles/homelab/configuration.nix][configuration.nix]] for homelab profile
- [[./profiles/worklab/configuration.nix][configuration.nix]] for worklab profile
2023-06-11 20:56:47 +05:30
** Modules
Separate Nix files can be imported as modules using an import block:
#+BEGIN_SRC nix
2023-12-02 04:27:25 +05:30
imports = [ ./import1.nix
./import2.nix
2023-06-11 20:56:47 +05:30
...
];
2023-06-02 03:30:22 +05:30
#+END_SRC
2023-06-21 08:33:43 +05:30
This conveniently allows configurations to be (*cough cough) /modular/ (ba dum, tssss).
2023-06-11 20:56:47 +05:30
I have my modules separated into two groups:
- System-level - stored in the [[./system][system directory]]
2023-06-21 08:33:43 +05:30
- System-level modules are imported into configuration.nix, which is what is sourced into [[./flake.nix][my flake (flake.nix)]]
2023-06-11 20:56:47 +05:30
- User-level - stored in the [[./user][user directory]] (managed by home-manager)
2023-06-21 08:33:43 +05:30
- User-level modules are imported into home.nix, which is also sourced into [[./flake.nix][my flake (flake.nix)]]
2023-06-11 20:56:47 +05:30
More detailed information on these specific modules are in the [[./system][system directory]] and [[./user][user directory]] respectively.
2023-06-21 08:33:43 +05:30
2023-09-09 16:48:41 +05:30
** Patches
In some cases, since I use =nixpgs-unstable=, I must patch nixpkgs. This can be done inside of a flake via:
#+BEGIN_SRC nix
nixpkgs-patched = (import nixpkgs { inherit system; }).applyPatches {
name = "nixpkgs-patched";
src = nixpkgs;
patches = [ ./example-patch.nix ];
};
# configure pkgs
pkgs = import nixpkgs-patched { inherit system; };
# configure lib
lib = nixpkgs.lib;
#+END_SRC
Patches can either be local or remote, so you can even import unmerged pull requests by using =fetchpatch= and the raw patch url, i.e: https://github.com/NixOS/nixpkgs/pull/example.patch.
I currently curate patches local to this repo in the [[./patches][patches]] directory.
2023-06-21 08:33:43 +05:30
** Profiles
I separate my configurations into [[./profiles][profiles]] (essentially system templates), i.e:
- [[./profiles/personal][Personal]] - What I would run on a personal laptop/desktop
- [[./profiles/work][Work]] - What I would run on a work laptop/desktop (if they let me bring my own OS :P)
- [[./profiles/homelab][Homelab]] - What I would run on a server or homelab
2023-08-21 04:25:05 +05:30
- [[./profiles/wsl][WSL]] - What I would run underneath Windows Subystem for Linux
2023-06-21 08:33:43 +05:30
My profile can be conveniently selected in [[./flake.nix][my flake.nix]] by setting the =profile= variable.
More detailed information on these profiles is in the [[./profiles][profiles directory]].
2024-01-27 19:39:49 +05:30
** Star History
Didn't think this would get that many [[https://star-history.com/#librephoenix/nixos-config&Date][stars on GitHub]], yet here we are:
[[https://api.star-history.com/svg?repos=librephoenix/nixos-config&type=Date.png]]