Commit Graph

2744 Commits

Author SHA1 Message Date
Donovan Glover
006a3592e6
feat: Fix crackling audio inside containers
It turns out that enabling hyprland inside the container causes this to
happen. I've also disabled greetd for good measure.
2024-04-06 19:35:57 -04:00
Donovan Glover
534476e97b
feat: Add option to disable root at the system level
Reduces complexity in the containers module.
2024-04-06 19:28:22 -04:00
Donovan Glover
bd6fabad67
feat: Move starship/htop back to home
It's actually easier to maintain when programs with non-trivial configs
have their own module.
2024-04-06 18:46:27 -04:00
Donovan Glover
2e366abf7d
containers: Move wine config to separate file 2024-04-06 18:18:30 -04:00
Donovan Glover
7def2c1b3c
ci: Add missing git add before overriding input
Might fix things.
2024-04-06 14:39:07 -04:00
Donovan Glover
17663e7118
ci: Copy instead of soft link
Might fix the GitHub CI.
2024-04-06 14:34:33 -04:00
Donovan Glover
28da507020
ci: Make input override work for shallow clone
This should fix things.
2024-04-06 14:29:03 -04:00
Donovan Glover
8535a06e52
chore: Improve formatting 2024-04-06 14:25:10 -04:00
Donovan Glover
8671cba57a
kitty: Drop grid/stack layouts
Simplifies things a bit for me personally.
2024-04-06 14:20:40 -04:00
Donovan Glover
cea9bf43bb
ci: Drop --no-build check
Weird that this doesn't work but the full check does however I'm
not complaining.
2024-04-06 14:18:22 -04:00
Donovan Glover
a34dc24238
ci: Fix example directory typo
Forgot to change this after deciding on one example instead of several.
2024-04-06 14:14:28 -04:00
Donovan Glover
a4637faad6
example: Define basic hyprland setup
I wrote a simple flake.nix that shows how to use this nix-config in your
own flake. This example in particular has been updated to show a working
demonstration with hyprland, although it's possible to use only parts of
this nix-config in e.g. headless environments as well.
2024-04-06 14:03:10 -04:00
Donovan Glover
074b019656
ironbar: Remove non-essential favorites
This puts the focus more on individual discovery when it comes to using
applications like anki.
2024-04-06 13:54:38 -04:00
Donovan Glover
00135526e7
desktop: Support japanese/wine by default
Simplifies things a bit since my target audience includes those
interested in the Japanese language. Opinionated defaults like this
makes it easier for end-users to be immediately productive without
having to spend time configuring things.
2024-04-06 13:43:28 -04:00
Donovan Glover
5afd2f2b49
ci: Check example flake with relative source
This should make flake checks reproducible even when the GitHub
repository is updated.
2024-04-06 13:08:32 -04:00
Donovan Glover
8c9d60ca56
chore: Rename networking to system
Necessary since the networking module was merged with system.
2024-04-06 12:30:04 -04:00
Donovan Glover
a7821f7027
chore: Fix usage of argument not present in container
nix-config must be used when referencing flake inputs to make it
possible to use the same module inside containers.
2024-04-06 12:27:27 -04:00
Donovan Glover
0033dfceb0
chore: Disable command-not-found by default
Unfortunately command-not-found only works for channels and doesn't have
first-class support for flakes yet, and nix-index takes forever to build
the database on slower machines, so I'd rather just disable this by
default.
2024-04-06 12:13:02 -04:00
Donovan Glover
7649c658b7
meta: Merge packages module into existing modules 2024-04-06 11:49:03 -04:00
Donovan Glover
b4af703fdf
meta: Merge dual-function-keys with hardware
Seems like an alright categorization for now since dual-function-keys
can be used without a desktop environment, although realistically the
tty is impractical for things like CJK.
2024-04-06 11:09:09 -04:00
Donovan Glover
3fc9cb9c81
chore: Link paths at the system level
Fixes an issue where paths wouldn't be linked previously unless
manually specified.
2024-04-06 10:26:32 -04:00
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