Commit Graph

2723 Commits

Author SHA1 Message Date
Donovan Glover
10bc64f097
chore: Attempt to organize packages a bit
Not perfect but good enough.
2024-04-06 10:19:18 -04:00
Donovan Glover
5bc853c489
chore: Fix specializations evaluating as sets 2024-04-06 09:44:40 -04:00
Donovan Glover
30f4d4f650
meta: Merge networking with system
This makes it easier to ensure that the system has our network settings
such as random mac addresses. This makes sense since networking in
general is related to the system.
2024-04-06 09:26:22 -04:00
Donovan Glover
8464d87cc9
meta: Merge specializations with desktop
This makes sense since the specializations are desktop-centric.
2024-04-06 08:30:54 -04:00
Donovan Glover
0e07ad48f5
virtualization: Mount /tmp as /mnt
This isn't *perfect*, but it does make it possible to share files
between the guest and the host without having to imperatively create a
directory that may or may not exist on other systems.
2024-04-06 08:21:32 -04:00
Donovan Glover
dd3d09bb67
system: Add option to specify hashedPassword
It may be useful to add hashedPasswordFile in the future, although from
my testing it was possible to rebuild a VM that used a cached derivation
with the old password.

Ideally your main form of authentication is through LUKS encryption or
SSH keys anyway, and this password should solely be used for sudo
purposes.
2024-04-06 08:18:32 -04:00
Donovan Glover
76a397031f
system: Set password to username by default
Ideally the user should supply their own hashedPassword.
2024-04-06 08:10:52 -04:00
Donovan Glover
3080c56023
containers: Fix warning when containers are disabled
Now it's possible to disable the containers without getting a warning
that containers.<name> is being defined.
2024-04-06 08:09:23 -04:00
Donovan Glover
8ba4792d03
virtualization: Fullscreen by default
Makes things easier to work with since hyprland doesn't automatically
match the resolution with the VM window by default.
2024-04-06 06:44:43 -04:00
Donovan Glover
2e50a1b3b3
chore(ci): Improve naming conventions
Should make it easier to determine which test is which from a glance.
2024-04-06 05:59:59 -04:00
Donovan Glover
3ddd42330d
ci: Add check for example flake config
Note that hardware-configuration.nix is created here since nix flake
check will look for the presence of fileSystems.
2024-04-06 05:53:01 -04:00
Donovan Glover
8c25c964da
feat: Add example config
Will extend upon this later, but this basically makes it possible to
guarantee that the flake can be used inside another flake and be
customized as expected.

Note that hardware-configuration.nix is optional if you're just using
the configuration for virtual machines and containers, which is why it's
optional here. A default file isn't provided to help users understand
that they have to bring their own.
2024-04-06 05:49:57 -04:00
Donovan Glover
46f778107b
chore: Improve formatting 2024-04-05 22:51:24 -04:00
Donovan Glover
1f1670ac54
virtualization: Disable zram
Causes errors on startup and generally isn't useful inside the VM.
2024-04-05 22:23:21 -04:00
Donovan Glover
d29e0c909e
chore: Remove useless /share/thumbnailers pathsToLink
This is already a part of the default list in nixpkgs.

See: 1487bdea61/nixos/modules/config/system-path.nix (L165)
2024-04-05 21:51:31 -04:00
Donovan Glover
c9ed800915
ci: Add check for evaluation only
Makes it easier to see if evaluation passes but end-to-end tests fail.
2024-04-05 21:35:46 -04:00
Donovan Glover
2f30ce241b
meta: Merge virtualization with system
The check VMs still work as expected with this change.
2024-04-05 19:43:52 -04:00
Donovan Glover
51273df2c8
meta: Move nixosConfiguration logic to separate file
Makes it easier to reason about the flake-specific stuff inside
the flake.
2024-04-05 19:21:20 -04:00
Donovan Glover
7a8fdd7259
chore: Improve formatting 2024-04-05 19:01:41 -04:00
Donovan Glover
3b82331556
ci: Add check for formatting
Note that `nix fmt` is used here to ensure that the formatter for the
flake can be changed in the future without having to change this file.
2024-04-05 16:56:32 -04:00
Donovan Glover
a1ec752ecd
virtualization: Don't share home directory
Not really necessary anymore since I no longer test home-specific stuff
inside the virtual machine.

It would be nice if there was a way to create a temporary directory on
the fly (such as one in /tmp) that could be mounted and used for sharing
files between the virtual machine and the host.
2024-04-05 14:35:40 -04:00
Donovan Glover
e2e8971eb3
chore: Simplify variable usage
Changes made:

- Preferred "inherits" where possible
- Removed unnecessary comments
- Added variables to avoid duplicate strings
- Reduced usage of "with x;"
2024-04-05 13:30:39 -04:00
Donovan Glover
41ce56718b
chore: Simplify tests
Removes the redundant `self`.
2024-04-05 11:53:40 -04:00
Donovan Glover
22e31ff60b
chore: Format with nixpkgs-fmt
Note that we will continue to use nixpkgs-fmt for the time being here
since nixfmt-rfc-style breaks string syntax highlighting and comments
like `/* this */` get turned into `# this`.

The conversion from lisp-like formatting to something else in flake.nix
is a bit unfortunate, but I'd rather have a singular style for the
entire code base to make things easier.
2024-04-05 11:40:23 -04:00
Donovan Glover
01acf8197d
system: Add option to avoid cleaning /tmp on boot
This increases boot times quite a bit so I'd rather use tmpfs as /tmp
where possible. Note that this defaults to cleaning /tmp anyway since
I'd rather clean /tmp than not do so at all.

For future reference, the message that gets shown is the following:
"A start job is running for Create Volatile Files and Directories"
2024-04-05 11:18:52 -04:00
Donovan Glover
59f557a3e5
feat: Pass nix-config as self to avoid infinite recursion
This change makes it possible to use this nix-config in all the
different ways imaginable (containers, bare metal, tests, and as a
separate flake input) *without* running into infinite recursion
issues with self.

It does this by using a trick similar to JavaScript in which
`var self = this;`, thus enabling the usage of "this" (or self, in
Nix's case) where it wouldn't otherwise be possible.

Note that this *only* works if the input for this repository is named
nix-config. This makes it impractical to combine with multiple
configurations that employ the same strategy.
2024-04-05 10:20:06 -04:00
Donovan Glover
b368817c52
feat: Simplify imports by importing with specialArgs
This change makes it possible to import the modules that are required
from the flake inputs in the output modules themselves, thus preventing
users from having to manually import those modules.

This simplifies things overall and was made possible by the specialArgs
option that allowed these flake inputs to be passed into our container.
2024-04-05 09:37:30 -04:00
Donovan Glover
267dda3224
chore: Add missing imports to tests
Necessary since system now depends on home-manager and desktop depends
on stylix, which also depends on home-manager.

Note that since conditional imports can't be used and we include the
system module inside of our containers which don't have access to self,
importing the required modules inside the module itself cannot be used.
2024-04-05 09:07:28 -04:00
Donovan Glover
83314da967
chore: Fix remaining hardcoded user values 2024-04-05 08:20:11 -04:00
Donovan Glover
ae85377a72
chore: Remove redundant container configuration
Not needed due to the imports, although useful to remember that these
options would typically be necessary in a raw implementation.
2024-04-05 08:14:42 -04:00
Donovan Glover
e739239542
chore: Enable missing module options
Forgot to enable these earlier but now everything works.
2024-04-05 08:13:24 -04:00
Donovan Glover
8ea3afa900
kitty: Use sane layout order
This is similar to before and makes it easier to recognize all the
different layouts when switching between them.
2024-04-05 08:11:07 -04:00
Donovan Glover
5f58800cc9
containers: Remove old imports
The simplification process has overall made it easier to import core
modules without having to worry about exactly which modules to import.
2024-04-05 07:21:01 -04:00
Donovan Glover
37aa1cac4c
greetd: Fix time format for exotic locales
Fixes an issue where the Japanese locale would prevent the datetime from
showing properly at the top.
2024-04-05 07:13:10 -04:00
Donovan Glover
7b234dfb19
chore: Add missing inherit
Also fixes an issue with mkMerge requiring things to be written
like this.
2024-04-05 07:10:30 -04:00
Donovan Glover
db5b95e983
nix: Prefer let-in over with
Fixes an issue where it's possible to write code that the linter thinks
is valid since with; is used.
2024-04-04 20:05:10 -04:00
Donovan Glover
b46c9a05a9
meta: Continue modularizing packages
Should make it easier to know what's what.
2024-04-04 20:03:31 -04:00
Donovan Glover
0babbfe458
git: Show relative dates for git blame 2024-04-04 19:42:06 -04:00
Donovan Glover
107b5c79d6
ncmpcpp: Fix broken change script
It turns out that we actually *do* need to 2>/dev/null.
2024-04-04 19:41:10 -04:00
Donovan Glover
a6f2c58d51
meta: Don't hardcode home directory
This is a much better way of handling things.
2024-04-04 19:39:35 -04:00
Donovan Glover
6f1b17a600
meta: Merge postgres module with shell
Realistically this might be more related to "system" than shell, however
it may also be advantageous to keep system as minimal as possible since
it could also be argued that interpreted programming languages are a
part of the system.
2024-04-04 18:37:44 -04:00
Donovan Glover
721ead4572
chore: Inherit builtins where possible
Possibly makes things easier to read.
2024-04-04 17:56:01 -04:00
Donovan Glover
8d4a7f780c
postgres: Ensure creation of database users
This is just a proof of concept that I plan to integrate into NixOS
containers running specific users. The ensureDBOwnership part would no
longer be needed since each database would receive its own container
and consequently user.
2024-04-04 17:44:21 -04:00
Donovan Glover
3946ea52fb
chore: Update test imports 2024-04-04 17:31:01 -04:00
Donovan Glover
7f05a66fa5
feat: Make username customizable
Now it's possible to use whatever username you want for your system. The
default value of "user" is good if you're concerned about information
disclosure attacks through things like the username being visible in
logs or other output.
2024-04-04 16:36:28 -04:00
Donovan Glover
558e0b1623
meta: Merge home-manager and user module with system
Makes it easier to create a working and pre-configured system with
minimal configuration.
2024-04-04 16:02:35 -04:00
Donovan Glover
dd38bf1c4c
meta: Begin making shell module customizable 2024-04-04 12:25:15 -04:00
Donovan Glover
a03963d1f7
meta: Merge wine module with desktop
Makes it easier to just import the desktop module and use everything we
want.
2024-04-04 12:19:47 -04:00
Donovan Glover
764fbd4917
Revert "meta: Migrate yazi from home-manager to shell module"
There is currently a bug where yazi crashes since it tries to create
directories but is unable to due to being managed at the system level.

There is an open PR in nixpkgs, however it's been 3 weeks and it hasn't
been merged yet.
2024-04-04 12:15:40 -04:00
Donovan Glover
e64cc2697f
meta: Migrate yazi from home-manager to shell module
This is a part of making it easier to instantly have access to yazi
without having to worry about using home-manager. Note that this works
for my use case since I don't use Nix on non-NixOS devices and don't
intend to do so anytime soon.
2024-04-04 12:14:26 -04:00