Clean Up, added nix-flatpak to flake, attempt ORG

This commit is contained in:
Zonsopkomst 2023-11-13 13:21:47 -06:00
parent e7ae27bf15
commit 641e2c5a28
6 changed files with 105 additions and 335 deletions

71
README copy.org Normal file
View File

@ -0,0 +1,71 @@
---
#+title: Flake Readme
#+author: Zonsopkomst
#+date: 2022-11-30
---
# My NixOS Configuraton File
This is my NixOS setup to manage multiple computers with a home-manager config structure using nix flakes.
# Current Desktop Screenshot
![Gnome](https://git.disroot.org/Zonsopkomst/flake/raw/branch/working/reference/assets/2023-09-21_09-18.png)
*Gnome*
## Highlights:
* Multiple NixOS configurations: desktop, laptop, and hopefully a test server and eventually a full transition over from my Ubuntu server.
## How to
![Process](https://git.disroot.org/Zonsopkomst/flake/raw/branch/working/reference/assets/underpants-gnomes.png)
*Source: South Park*
1. NixOS Installation
1. Install NixOS on a computer using the default Gnome installer from https://nixos.org/download.html.
1. Clone this repository [zonsopkomst](https://git.disroot.org/zonsopkomst) in the `/home/<username>/ directory.
1. Update the subdirectories in `hosts` and `users`.
1. Copy the `configuration.nix` and `hardware-configuration.nix` files from the `/etc/nixos` directory and move them to `hosts/PLACE(local OR remote)/NEW_PC_NAME`.
1. Rename `configuration.nix` to `default.nix` and, update `flake.nix` located in the top directory, link the appropriate modules to be used.
2. Segment out items from new `default.nix` to appropriate `.nix` files.
3. Make sure the correct version of NixOS is listed in the appropriate files.
2. `flake.nix` is where `.nix` files are imported with further instructions on declared packages and modules.
1. Declare packages either globally under `/hosts/<location>/hostname/packages.nix` or `/users/<username>/home-manager.nix`.
3. Rebuild NixOS *(<hostname> must be include the first time rebuilding, after the first rebuild, .# can be used and the system will know which hostname is to be used)*
1. ~~nix-channel --update~~ *May no longer be neccessary due to using a flake - need to look into further*
2. `nix flake --update && nixos-rebuild switch --flake .#<hostname>`
4. Push the updated git files to the repository so that they can be pulled, and the system rebuilt during the next update.
### Maintenance
1. See `/config/.bashrc` for `alias`: `flkup` using `sudo nixos-rebuild switch --flake .#<hostname>` commands and other useful items
### Sources
* [nix flakes](https://nixos.wiki/wiki/Flakes)
* [home-manager](https://github.com/nix-community/home-manager)
* [Home Manager as a NixOS Module](https://nix-community.github.io/home-manager/index.html#sec-flakes-nixos-module)
### Remove?
* The following may not be neccessary per [Discord Conversation](https://discord.com/channels/568306982717751326/1170826319706206248)
* ~~Added as [unstable channel](https://nix-community.github.io/home-manager/index.html#sec-install-nixos-module)~~
* ~~sudo `nix-channel --add https://github.com/nix-community/home-manager/archive/master.tar.gz home-manager`~~
* sudo ~~`nix-channel --update`~~
## Structure
Directory | What is it for?
-----------------------|-------------------------------------------------------------
common | Shared configurations and modules
config | Config files that are managed by NixOS
desktop | Shared desktop configs
display | Login Display managers
hosts | The PCs deployed
reference | Package list, git assets, notes, etc.
users | Individual User configs
flake.nix & flake.lock | Declared configuration using the above directories & configs
## Hosts
Hostname | Model | Type | RAM | Processor | Main Use
---------|---------------------|---------|------|---------------------------|------------
weda | Dell Inspiron 15 | Laptop | 16GB | AMD Ryzen 5 (Cezanne) | Business
frija | Acer Aspire 3 | Laptop | 4GB | AMD A9 | Testing
tyr | Intel i5 | Desktop | 16GB | Intel i5 | Media
tii | Dell Lattitude 5511 | Laptop | 16GB | Intel i5 Quad (i5-10400H) | Remote
tuisto | AMD Ryzen 5 | Desktop | 16GB | AMD Ryzen 5 (Renoir) | Remote
sintanne | Intel i5 | Desktop | 16GB | Intel i5-11320H | Remote
TODO | AMD Ryzen 5 | Server | ??GB | AMD 2200G | Test Server
TODO | AMD Ryzen 5 | Server | ??GB | AMD 2200G | Main Server

View File

@ -1,28 +0,0 @@
# TODO Marked for deletion
# Declarative, single user, via home-manager(opens new window)
# Enable the `programs.starship` module in your `home.nix` file, and add your settings
# Add the following to the end of ~/.bashrc:
# eval "$(starship init bash)"
{ config, pkgs, ... }:
{
programs.starship = {
enable = true;
# Configuration written to ~/.config/starship.toml
settings = pkgs.lib.importTOML ~/.config/starship;
#settings = {
# add_newline = false;
# character = {
# success_symbol = "[➜](bold green)";
# error_symbol = "[➜](bold red)";
# };
# package.disabled = true;
#};
};
}

View File

@ -5,6 +5,4 @@
hyprland.nixosModules.default
{programs.hyprland.enable = true;}
];
}
# This can be removed, something about modules too deep. If removed, also remove the associated lines in flake.nix.
}

View File

@ -6,14 +6,14 @@
home-manager.url = "github:nix-community/home-manager";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
hyprland.url = "github:hyprwm/Hyprland";
nix-flatpak.url = "github:gmodena/nix-flatpak/main"; # Added 10/25
nix-flatpak.url = "github:gmodena/nix-flatpak/main";
};
outputs = inputs@{
home-manager,
hyprland,
nixpkgs,
nix-flatpak, # Added 10/25
nix-flatpak,
...
}: {
@ -66,6 +66,7 @@
./hosts/local/frija/packages.nix
# User Specific
./users/aspire/flatpak.nix
./users/aspire/home-manager.nix
#./users/aspire/syncthing.nix
@ -75,6 +76,14 @@
home-manager.useUserPackages = true;
home-manager.users.aspire = import ./hosts/local/frija/home.nix;
}
nix-flatpak.nixosModules.nix-flatpak
{
}
#hyprland.nixosModules.default
#{programs.hyprland.enable = true;}
];
};
@ -122,7 +131,6 @@
# User Specific
./users/leeuwarden/flatpak.nix
#./users/leeuwarden/gnomekeyring.nix # Delete if successful 11/29/23
./users/leeuwarden/home-manager.nix
./users/leeuwarden/syncthing.nix
@ -133,11 +141,12 @@
home-manager.users.leeuwarden = import ./hosts/local/tyr/home.nix;
}
# Experimenting with nix-flatpak module
# Source: https://github.com/gmodena/nix-flatpak
nix-flatpak.nixosModules.nix-flatpak
{
}# Added 10/25
}
#hyprland.nixosModules.default
#{programs.hyprland.enable = true;}
];
};
@ -197,11 +206,9 @@
home-manager.users.zonsopkomst = import ./hosts/local/weda/home.nix;
}
# Experimenting with nix-flatpak module
# Source: https://github.com/gmodena/nix-flatpak
nix-flatpak.nixosModules.nix-flatpak
{
}# Added 10/25
}
hyprland.nixosModules.default
{programs.hyprland.enable = true;}
@ -255,6 +262,7 @@
./hosts/remote/sintanne/packages.nix
# User Specific
./users/annette/flatpak.nix
./users/annette/home-manager.nix
#./users/annette/hd.nix
#./users/annette/syncthing.nix
@ -266,6 +274,10 @@
home-manager.users.annette = import ./hosts/remote/sintanne/home.nix;
}
nix-flatpak.nixosModules.nix-flatpak
{
}
#hyprland.nixosModules.default
#{programs.hyprland.enable = true;}
];
@ -314,6 +326,7 @@
./hosts/remote/tii/packages.nix
# User Specific
./users/coleman/flatpak.nix
./users/coleman/home-manager.nix
#./users/coleman/hd.nix
./users/coleman/syncthing.nix
@ -325,6 +338,10 @@
home-manager.users.coleman = import ./hosts/remote/tii/home.nix;
}
nix-flatpak.nixosModules.nix-flatpak
{
}
#hyprland.nixosModules.default
#{programs.hyprland.enable = true;}
];
@ -373,6 +390,7 @@
./hosts/remote/tuisto/packages.nix
# User Specific
./users/admin/flatpak.nix
./users/admin/home-manager.nix
#./users/admin/hd.nix
./users/admin/syncthing.nix
@ -384,6 +402,10 @@
home-manager.users.admin = import ./hosts/remote/tuisto/home.nix;
}
nix-flatpak.nixosModules.nix-flatpak
{
}
#hyprland.nixosModules.default
#{programs.hyprland.enable = true;}
];

View File

@ -29,6 +29,8 @@
services.xserver.displayManager.autoLogin.user = "leeuwarden";
# Workaround for GNOME autologin: https://github.com/NixOS/nixpkgs/issues/103746#issuecomment-945091229
# Discourse: https://discourse.nixos.org/t/unlocking-gnome-keyring-automatically-upon-login-with-kde-sddm/6966
# Still not fixed: https://github.com/NixOS/nixpkgs/issues/86884#issuecomment-1134787613
systemd.services."getty@tty1".enable = false;
systemd.services."autovt@tty1".enable = false;

295
nixos.org
View File

@ -1,295 +0,0 @@
#+title: NixOS TODO List
#+author: Zonsopkomst
#+date: 2022-11-30
#+STARTUP: overview
* TODO Error Message
● lxd.service - LXD Container Management Daemon
Loaded: loaded (/etc/systemd/system/lxd.service; enabled; preset: enabled)
Active: activating (auto-restart) (Result: exit-code) since Mon 2023-10-09 13:26:19 CDT; 47ms ago
TriggeredBy: ● lxd.socket
Docs: man:lxd(1)
Process: 16717 ExecStartPost=/nix/store/0wbk9mgkwf46q4qsrqsb2pwaan1c1k1j-lxd-5.18/bin/lxd waitready --timeout=600 (code=exited, status=1/FAILURE)
Main PID: 16716 (code=exited, status=1/FAILURE)
IP: 0B in, 0B out
CPU: 943ms
warning: error(s) occurred while switching to the new configuration
* TODO Add Packages
** TODO Try new shells
- [[switch shells][https://linuxhandbook.com/change-shell-linux/]]
** TODO [[https://github.com/AbdelrhmanNile/UnderTaker141][UnderTaker141 ??]]
** TODO E-Pub Reader
** TODO NightPDF?
- flatpak install flathub io.github.lunarequest.NightPDF
** TODO OpenBB Update
*** DONE Remove old OpenBB Docker image
*** DONE Update or add new OpenBB Docker image
*** HOLD Manage using nixos?
*** TODO Remote client of some sort
**** HOLD nomachine
** HOLD direnv
- [[direnv][https://www.tecmint.com/direnv-manage-environment-variables-in-linux/]]
** DONE [[starship][https://starship.rs/guide/#%F0%9F%9A%80-installation]]
** DONE [[Bavarder][flatpak install flathub io.github.Bavarder.Bavarder]]
** DONE FOSS Discord?
** DONE Outputs Command
You can explore all outputs from this configuration by using:
$ nix flake show
* TODO Hyprland
What is the bare minimum to do in order to get hyprland working so I can use it and learn as I go?
Some package ideas as follows:
** TODO hyprland + swayidle + swaylock
*** [[Link][https://github.com/swaywm/sway/wiki/Useful-add-ons-for-sway]]
** TODO eww or waybar or [[nwg-panel][https://github.com/nwg-piotr/nwg-panel]]
** TODO neomutt + mbsync (email)
** TODO gpg + pass
** TODO sops-nix to manage secrets
** TODO podman
** TODO zathura
** TODO rofi / wofi
** TODO bat + fd + rg
** TODO nix-colors
** TODO sops-nix
** TODO Learn impermanence
** TODO deploy-rs
** DONE bash w/ starship
** DONE Improve kitty config
* TODO Headless Server
- Would like to transition from Ubuntu starting with my test server and eventually fully replacing with NixOS
** TODO Ability to SSH into Server using terminal / VSCodium
** TODO FreshRSS container
** TODO Guacamole or alternate remote client
** TODO Bookmark container
** TODO Jellyfin
** TODO Image Viewer
** TODO Questions for HuggingGPT
1. Question: Please show me detailed steps on how to set up a headless NixOS server that I can SSH into from another computer. It will need to use duckdns.org with NPM so that I can access it from a web browser. I would like NixOS to manage my containers directly instead of using Docker, but if there is no alternative, Docker or Podman are acceptable. I would also like to use an SSD drive for the main operating system, with two additional 18 TB hard drives, in which one will store container application's data, and the other will be used as a backup for the stated data on a regular basis.
2. I would like to run the following containers:
* Freshrss
* Guacamole
*
1. Question: Please provide specific steps in order to better optimize the flake located at https://git.disroot.org/Zonsopkomst/flake/src/branch/working.
1. Question: Can a package list for NixOS be added as a table instead of a list? If so, how would one go about implementing that? Please provide specific instructions and examples.
1. Question: How can I make Hyprland on NixOS do xxxx
Update
* TODO RPI4
Not sure if I want to go there, but maybe for a dedicated website?
** TODO Install on RPI4 [[RPI4][https://nix.dev/tutorials/installing-nixos-on-a-raspberry-pi]]
* DONE Setup New PCs
** DONE Add `default.nix` and `hardware.nix` to each new machine
* DONE optionsDocBook deprecated :issue:
Wait until 24.05, should be corrected
[[Solution][https://discourse.nixos.org/t/warning-optionsdocbook-is-deprecated-since-23-11-and-will-be-removed-in-24-05/31353]]
Nothing to do at this time. Waiting for fix.
Receive the following output upon rebuild:
```
unpacking channels...
building the system configuration...
trace: warning: optionsDocBook is deprecated since 23.11 and will be removed in 24.05
trace: warning: optionsDocBook is deprecated since 23.11 and will be removed in 24.05
trace: warning: optionsDocBook is deprecated since 23.11 and will be removed in 24.05
trace: warning: The option `fonts.enableDefaultFonts' defined in `/nix/store/s4jqyj35hii03rs7j5n6vn7gpgp6ja81-source/flake.nix' has been renamed to `fonts.enableDefaultPackages'.
trace: warning: The `waybar-hyprland` package is now in Nixpkgs
activating the configuration...
setting up /etc...
reloading user units for zonsopkomst...
setting up tmpfiles
Looking for updates…
Nothing to do.
These runtimes in installation 'system' are pinned and won't be removed; see flatpak-pin(1):
runtime/org.gtk.Gtk3theme.adw-gtk3-dark/x86_64/3.22
runtime/org.gtk.Gtk3theme.adw-gtk3/x86_64/3.22
Nothing unused to uninstall
```
* DONE Add Packages
** DONE Starship to starship.nix
** DONE Pandoc to terminal.nix & package references
** DONE Try to use magit through emacs
* DONE Add Emacs & init.el
Using init.el instead of org-mode for now.
Issue with reading the init file using NixOS to manage configs
[[https://github.com/emacs-tw/awesome-emacs#linux][awesome emacs github]]
* DONE VSCodium
** FAIL Add Snippets Configs
{
// Place your global snippets here. Each snippet is defined under a snippet name and has a scope, prefix, body and
// description. Add comma separated ids of the languages where the snippet is applicable in the scope field. If scope
// is left empty or omitted, the snippet gets applied to all languages. The prefix is what is
// used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders.
// Placeholders with the same ids are connected.
// Example:
// "Print to console": {
// "scope": "javascript,typescript",
// "prefix": "log",
// "body": [
// "console.log('$1');",
// "$2"
// ],
// "description": "Log output to console"
// }
"Console Log": {
"prefix": "hd",
"body": [
"---",
"title: TITLE",
"type: TYPE",
"author: Zonsopkomst",
"created: \"$CURRENT_YEAR-$CURRENT_MONTH-$CURRENT_DATE\"",
"---",
],
"scope": "markdown",
"description": "Create a header for markdown documents"
}
}
*** DONE File & Folder Added [2023-6-20 Tue]
*** TODO Need to double check paths and implement
** DONE Extension
- usernamehw.find-jump
* DONE Clean up / maintenance on users and hosts
* DONE Declare Configuration Files for:
** DONE Xiphos on all PCs
** DONE VSCodium on all PCs
- First check your NixOS config files to make sure you don't overwrite
- This is the settings.json from your Windows Work machine:
{
"org.todoKeywords": [
"TODO",
"DONE",
"HOLD",
"SCHD",
"FAIL",
],
"workbench.iconTheme": "file-icons",
"markdown-preview-enhanced.previewTheme": "github-dark.css",
"editor.wordWrap": "on",
"explorer.compactFolders": false,
"explorer.autoReveal": false,
"[markdown]": {
"editor.defaultFormatter": "darkriszty.markdown-table-prettify"
},
"todomd.defaultFile": "c:\\Users\\Church\\Documents\\Syncthing\\Church-Notes\\00 org\\todo.md",
"todohighlight.isEnable": true,
"todohighlight.include": [
"**/*.js",
"**/*.jsx",
"**/*.ts",
"**/*.tsx",
"**/*.html",
"**/*.css",
"**/*.scss",
"**/*.php",
"**/*.rb",
"**/*.txt",
"**/*.mdown",
"**/*.md",
"**/*.nix"
],
"editor.fontFamily": "JetBrainsMono Nerd Font, 'Courier New', monospace"
"editor.fontSize": 13,
"nix.serverSettings": {
},
}
* DONE VS Codium
** DONE Switch all extensions to be written by nixos config
** DONE Add Lisp-Syntax
* DONE Switch appropriate apps over to home-manager
* DONE Clean up Flake
* FAIL Fonts?
- [[Last Entry][https://github.com/NixOS/nixpkgs/issues/30085]]
- Fixed issue on remote pc about blurred fonts, but cannot seem to crisp them up
- Was trying to go for clarity like on a mac
- May revisit in the future