Skip to content

Commit

Permalink
refactor: consolidate Nix.org and Emacs.org
Browse files Browse the repository at this point in the history
The configuration options that used to be stored in Emacs.org and
Nix.org are now no longer split into two files. Instead, there now
is a single file SwarselSystems.org that holds both these configs.
  • Loading branch information
Swarsel committed Jun 20, 2024
1 parent bc8c525 commit 95e0c81
Show file tree
Hide file tree
Showing 24 changed files with 17,121 additions and 8,409 deletions.
8 changes: 4 additions & 4 deletions .github/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ That being said, there is a lot of general configuration that you *probably* can

The files that are possibly of biggest interest are found here:

- [SwarselSystems.org](../SwarselSystems.org)
- [flake.nix](../flake.nix)
- [Nix.org](../Nix.org)
- [early-init.el](../programs/emacs/early-init.el)
- [Emacs.org](../Emacs.org)
- [init](../programs/emacs/init.el)

This is a nix flakes based setup that manages multiple hosts, including mixed (NixOS with home-manager as a submodule) as well as standalone home-manager machines, also using some overlays etc. There even is a configuration for an Android build. It is all wrapped in literal configuration .org files, because that allows me to have easy access without actually having to remember where the specific configuration files are all located. early-init.el is not tangled for the reason that adding it would break the emacs-overlay parsing.

Expand All @@ -52,9 +52,9 @@ Below is a rough general guide to setup this system on a new NixOS host. **Again
For a pure Home-Manager configuration, you need a few different steps. The biggest change is that you then want to call `home-manager --flake .#<your-username>@<your-hostname> switch` as the last step instead of `nixos-rebuild [...]`. A complete general guide for that case cannot really be given since you are most likely setting up the flake on a existing machine that already has a lot of configuration. If you are setting up a new system, I would recommend to use NixOS unless circumstances force you to use something else.

###### To do that:
1) adapt [Nix.org](../Nix.org)
1) adapt [SwarselSystems.org](../SwarselSystems.org)
1) adapt system specific options:
- Make a copy of "System Specific Configurations/TEMPLATE".
- Make a copy of "System/System Specific Configurations/TEMPLATE".
- Adapt all references to TEMPLATE to your host- and usernames etc - pay special attention to the header lines in each nix source block, i.e. the "#+begin_src nix [...] :tangle profiles/TEMPLATE/[...]" lines.

- Add the settings needed for your specific machine.
Expand Down
4,076 changes: 0 additions & 4,076 deletions Emacs.html

This file was deleted.

3,243 changes: 0 additions & 3,243 deletions Emacs.org

This file was deleted.

12,574 changes: 12,574 additions & 0 deletions SwarselSystems.html

Large diffs are not rendered by default.

5,117 changes: 4,356 additions & 761 deletions Nix.org → SwarselSystems.org

Large diffs are not rendered by default.

28 changes: 28 additions & 0 deletions Wiki.org
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ This requires changes in multiple locations. As an example we will use an early

* Build a firefox addon

1) app id can be found in the manifest.json file of the .xpi (.xpi is just a normal archive)
2) url can be found by copy url of the "add extension" button on the addon page
3) the rest of the information is also found in the manifest.json, but might not be needed

#+begin_src nix configuration.nix
programs.firefox = {
Expand Down Expand Up @@ -159,3 +162,28 @@ This requires changes in multiple locations. As an example we will use an early

* Patch a utilty for nix paths:
See https://drakerossman.com/blog/how-to-patch-a-package-source-on-nixos
* let-block for overriding a package in nixpkgs (here: replacing airsonic with airsonic-advanced)

This can be useful if a module does not let you use your own package yourself.

#+begin_src nix :tangle no

pkgs = import nixpkgs { inherit system;
overlays = [ emacs-overlay.overlay
nur.overlay
nixgl.overlay
(self: super: {
airsonic = super.airsonic.overrideAttrs (_: rec {
version = "11.0.2-kagemomiji";
name = "airsonic-advanced-${version}";
src = super.fetchurl {
url = "https://github.com/kagemomiji/airsonic-advanced/releases/download/11.0.2/airsonic.war";
sha256 = "PgErtEizHraZgoWHs5jYJJ5NsliDd9VulQfS64ackFo=";
};
});
})
];
config.allowUnfree = true;
};

#+end_src
22 changes: 0 additions & 22 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 1 addition & 17 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
# provides GL to non-NixOS hosts
nixgl.url = github:guibou/nixGL;

# manages all themeing using Home-Manager
# manages all theming using Home-Manager
stylix.url = github:danth/stylix;

# nix secrets management
Expand All @@ -47,12 +47,6 @@
inputs.nixpkgs.follows = "nixpkgs";
};

# privateinternetaccess nixos integration - not sure if I will keep using
pia = {
url = "git+https://git.sr.ht/~rprospero/nixos-pia?ref=development";
inputs.nixpkgs.follows = "nixpkgs";
};

# provides expressions for mautrix-signal
nixpkgs-mautrix-signal ={
url = github:niklaskorz/nixpkgs/nixos-23.11-mautrix-signal;
Expand Down Expand Up @@ -88,7 +82,6 @@
stylix,
sops-nix,
lanzaboote,
pia,
nixpkgs-mautrix-signal,
nix-gaming,
nixos-hardware,
Expand Down Expand Up @@ -255,7 +248,6 @@
specialArgs = {inherit inputs pkgs; };
modules = [
sops-nix.nixosModules.sops
pia.nixosModule
./profiles/server1/transmission/nixos.nix
];
};
Expand Down Expand Up @@ -345,14 +337,6 @@

packages.x86_64-linux = {

proxmox-lxc = nixos-generators.nixosGenerate {
inherit system;
modules = [
./profiles/server1/TEMPLATE/nixos.nix
];
format = "proxmox-lxc";
};

};

};
Expand Down
3 changes: 0 additions & 3 deletions profiles/TEMPLATE/home.nix
Original file line number Diff line number Diff line change
Expand Up @@ -126,14 +126,11 @@
startup = [

{ command = "nextcloud --background";}
# { command = "spotify";}
{ command = "discord --start-minimized";}
# { command = "element-desktop --hidden";}
{ command = "element-desktop --hidden -enable-features=UseOzonePlatform -ozone-platform=wayland --disable-gpu-driver-bug-workarounds";}
{ command = "ANKI_WAYLAND=1 anki";}
{ command = "OBSIDIAN_USE_WAYLAND=1 obsidian";}
{ command = "nm-applet";}
# { command = "sleep 60 && syncthingtray --wait"; }

];
};
Expand Down
1 change: 0 additions & 1 deletion profiles/TEMPLATE/nixos.nix
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@

stylix.image = ../../wallpaper/TEMPLATEwp.png;


stylix = {
base16Scheme = ../../wallpaper/swarsel.yaml;
# base16Scheme = "${pkgs.base16-schemes}/share/themes/shapeshifter.yaml";
Expand Down
Loading

0 comments on commit 95e0c81

Please sign in to comment.