clean up code

This commit is contained in:
zackartz 2024-05-05 17:15:43 -04:00
parent 4a89cd1d17
commit 375ed7d867
No known key found for this signature in database
GPG key ID: 5B53E53A9A514DBA

View file

@ -61,7 +61,7 @@ Now, lets add the package spec:
```nix ```nix
... ...
{
in { in {
# add packages :) # add packages :)
packages = eachSystem (pkgs: { packages = eachSystem (pkgs: {
@ -75,6 +75,7 @@ Now, lets add the package spec:
... ...
}; };
}
``` ```
Now, when we run `nix build`, everything works as expected, great! But how can we see the outputs of our build? If we run the following command: Now, when we run `nix build`, everything works as expected, great! But how can we see the outputs of our build? If we run the following command:
@ -98,6 +99,9 @@ At this point, we could add this repo as a input to the flake configuring our se
I added the following code to the outputs section of my `flake.nix`. I added the following code to the outputs section of my `flake.nix`.
```nix ```nix
{
# previous outputs
nixosModule = { nixosModule = {
config, config,
lib, lib,
@ -133,6 +137,7 @@ I added the following code to the outputs section of my `flake.nix`.
}; };
}; };
}; };
}
``` ```
Woah, that's a lot of code, let's break it down. Woah, that's a lot of code, let's break it down.
@ -148,27 +153,31 @@ Enough code, lets deploy!
After adding the repo of my blog project to my server's flake like this: After adding the repo of my blog project to my server's flake like this:
```nix ```nix
{
inputs = { inputs = {
... # all our previous definitions ... # all our previous definitions
blog.url = "github:zackartz/zmio"; blog.url = "github:zackartz/zmio";
}; };
... ...
nixosConfigurations.pluto = nixpkgs_stable.lib.nixosSystem { nixosConfigurations.pluto = nixpkgs_stable.lib.nixosSystem {
specialArgs = {inherit inputs;}; specialArgs = {inherit inputs;};
modules = [ modules = [
... # previous modules ... # previous modules
inputs.blog.nixosModule.default inputs.blog.nixosModule.default
]; ];
}; };
# other configs
}
``` ```
We can add the following to our server's main nixosModule: We can add the following to our server's main nixosModule:
```nix ```nix
zmio.blog.enable = true; zmio.blog.enable = true;
``` ```
And that should be it, after a rebuild it should be live! And that should be it, after a rebuild it should be live!