dotfiles
My PC Dotfiles & Websitegit clone https://github.com/maydayv7/dotfiles
commit e8d9be70e9ca6661932285b7aa8d1f32a0840141 parent 9e298e98db91bda6b48289c2ee4f6506c3bed0d6 Author: maydayv7 <maydayv7@gmail.com> Date: Sun, 3 Apr 2022 15:05:36 +0530 docs: Update README
Diffstat:
| M | README.md | | | 38 | +++++++++++++++++++++++++++++++++++++- |
| M | flake.nix | | | 3 | +-- |
| M | packages/dotfiles.nix | | | 4 | ++-- |
| M | secrets/README.md | | | 2 | +- |
| D | site/content/blog/flakes.md | | | 30 | ------------------------------ |
| M | site/content/blog/nix.md | | | 83 | +++++-------------------------------------------------------------------------- |
| M | site/content/now.md | | | 6 | +++--- |
7 files changed, 49 insertions(+), 117 deletions(-)
diff --git a/README.md b/README.md @@ -410,6 +410,17 @@ You can navigate to the `README`'s present in the various directories to know mo <details> <summary><b>Changelog</b></summary> +### 22.04 (v10) + +- Deprecate `git-crypt` Usage +- Improve Installation Experience +- Create Nix Cheat Sheet + +<details> +<summary><i>Archive</i></summary> + +### v7.0 + - Create Website using [Zola](https://www.getzola.org/) - Refine Compatibility Libraries - Refine Scripts @@ -418,6 +429,8 @@ You can navigate to the `README`'s present in the various directories to know mo - Support Visual Studio Code Editor - Use [`alejandra`](https://github.com/kamadorueda/alejandra) for formatting code +### v5.0 + - Improve `channels` Usage - Support `source` Filters - Refine `git` Configuration @@ -430,6 +443,8 @@ You can navigate to the `README`'s present in the various directories to know mo - Add Support for Automatic Deployments using [`deploy-rs`](https://github.com/serokell/deploy-rs) - Add Developer `shells` for Multiple Programming Languages integrated with [`lorri`](https://github.com/nix-community/lorri) +### v4.5 + - Use Calendar Versioning - Use `nixConfig` - Support Auto-Upgrade @@ -438,6 +453,8 @@ You can navigate to the `README`'s present in the various directories to know mo - Use PipeWire (with low-latency) for audio - Use [`nixos-generators`](https://github.com/nix-community/nixos-generators) for Image Generation +### v4.0 + - Use `nixConfig` - Bifurcate `devices` - Refactor `lib.build.system` into `build.iso` and `build.device` @@ -456,10 +473,13 @@ You can navigate to the `README`'s present in the various directories to know mo - Use `advanced` Ephemeral Root File System Layout with [ZFS](https://zfsonlinux.org/) - Use [`flake-compat`](https://github.com/edolstra/flake-compat), [`nix-gaming`](https://github.com/fufexan/nix-gaming) and [`nix-wayland`](https://github.com/nix-community/nix-wayland) - Improve Code Consistency, reduce Complexity and fix Syntactic and Semantic Errors + - Use [`pre-commit-hooks`](https://github.com/cachix/pre-commit-hooks.nix) to improve configuration `checks` - Use [`nixfmt`](https://github.com/serokell/nixfmt) for formatting code - Use [`nix-linter`](https://github.com/Synthetica9/nix-linter) to check stylistic errors +### v3.0 + - Upgrade to NixOS v21.11 (Porcupine)! - Improve Package Declaration - Add Support for Instant Nix REPL @@ -472,6 +492,8 @@ You can navigate to the `README`'s present in the various directories to know mo - Use [`sops-nix`](https://github.com/Mic92/sops-nix) at `secrets` for managing authentication credentials - Automatically map `modules`, `packages`, `overlays`, `shells` and `inputs` +### v2.3 + - Add `docs` directory - Fix `.iso` Boot and Install Errors - Improve Scripts with error-checking @@ -481,6 +503,8 @@ You can navigate to the `README`'s present in the various directories to know mo - Improve CI with automatic `flake.lock` update and dependency-checking - Bifurcate Flake `outputs` (as `configuration.nix`), `scripts` and `overlays` +### v2.1 + - Simplify Installation - Add `install` Script - Add Support for creating Install Media @@ -488,6 +512,8 @@ You can navigate to the `README`'s present in the various directories to know mo - Automatically build `.iso` and publish release using CI - Fix Home Activation +### v2.0 + - Add BTRFS (opt-in state) Configuration - Improve Ephemeral Root Support with [impermanence](https://github.com/nix-community/impermanence) - Improve Installation Experience @@ -496,12 +522,16 @@ You can navigate to the `README`'s present in the various directories to know mo - Reduce CI Time - Add the Office role +### v1.0 + - Add Cachix Support - Add Nix Shell Support - Increase Readability - Improve Package Management - Under the hood CI changes +### v0.7 + - Improve Secrets Management using Private Submodule at `secrets` - Overhaul Package Overrides - Use `final: prev:` instead of `self: super:` @@ -513,6 +543,8 @@ You can navigate to the `README`'s present in the various directories to know mo - Improve Fonts Management - Update README and `scripts` +### v0.5 + - Added Support for Nix Flakes - Added Custom Libraries for Device and User Management - Created System Management Script @@ -520,6 +552,8 @@ You can navigate to the `README`'s present in the various directories to know mo - Add full support for Multi-Device Configuration - Use Better Repository Management +### v0.1 + - Added basic NixOS system configuration using GNOME and GTK+ - Added hardware support for 2 devices - Added `setup` script @@ -533,6 +567,8 @@ You can navigate to the `README`'s present in the various directories to know mo </details> +</details> + <details> <summary><b>Known Limitations</b></summary> @@ -541,7 +577,7 @@ You can navigate to the `README`'s present in the various directories to know mo </details> -> Last Updated: **March** 2022 +> Last Updated: **April** 2022 If you like this project, consider leaving a [star](https://github.com/maydayv7/dotfiles) diff --git a/flake.nix b/flake.nix @@ -23,7 +23,7 @@ # Author -> V 7 <maydayv7@gmail.com> # # License -> MIT # # URL -> github:maydayv7/dotfiles # -# Version -> 20220318 (v7.0) # +# Version -> 22.04 (v10) # # --------------------------------------- # # Welcome to Ground Zero! # # The Very Heart of my 'dotfiles' # @@ -75,7 +75,6 @@ gaming = { url = "github:fufexan/nix-gaming"; inputs.nixpkgs.follows = "unstable"; - inputs.utils.follows = "utils"; }; ## Configuration Modules ## diff --git a/packages/dotfiles.nix b/packages/dotfiles.nix @@ -6,8 +6,8 @@ }: pkgs.stdenv.mkDerivation rec { pname = "Dotfiles"; - version = "v7.0"; - longVersion = "20220318"; + version = "v10"; + longVersion = "22.04"; src = files.path.toplevel; dontBuild = true; diff --git a/secrets/README.md b/secrets/README.md @@ -1,3 +1,3 @@ ### Credentials -The authentication credentials are managed using [`sops-nix`](https://github.com/Mic92/sops-nix) at `secrets`. The [`sops`](https://github.com/mozilla/sops) encrypted secrets (using GPG authentication) are stored at multiple places, like in this directory, as well as [`modules/user/passwords`](../modules/user/passwords). User passwords are made using the command `mkpasswd -m sha-512` and specified using the `passwordFile` option. The `sops` encrypted secrets are of `binary` format (and have the extension `.secret`) and can be conveniently managed using the [`nixos`](../scripts/README.md) `secret` command. The `keys` directory contains the *public* User GPG Keys which are automatically imported +The authentication credentials are managed using [`sops-nix`](https://github.com/Mic92/sops-nix) at `secrets`. The [`sops`](https://github.com/mozilla/sops) encrypted secrets (using GPG authentication) are stored at multiple places, like in this directory, as well as [`modules/user/passwords`](../modules/user/passwords). User passwords are made using the command `mkpasswd -m sha-512` and specified using the `passwordFile` option. The `sops` encrypted secrets are of `binary` format (and have the extension `.secret`) and can be conveniently managed using the [`nixos`](../scripts/README.md) `secret` command. The `keys` directory contains the _public_ User GPG Keys which are automatically imported diff --git a/site/content/blog/flakes.md b/site/content/blog/flakes.md @@ -1,30 +0,0 @@ -+++ -title = "My take on Nix Flakes" -description = "A Blog on what exactly are the benefits of using Flakes, and some helpful information about it's quirks" -date = 2022-02-21 -draft = true - -[taxonomies] -series = ["NixOS Desktop"] -tags = ["Linux", "Nix", "Flakes"] - -[extra] -ToC = true -edit = true -comments = true -+++ - -# Under Construction! - -# Topic - -# Resources - -Below is a list of handy, helpful resources and documentation that can be used to learn more about the Nix Flakes in depth: - -- Tweag [Article](https://www.tweag.io/blog/2020-05-25-flakes/) introducing Flakes -- Serokell's [Blog](https://serokell.io/blog/practical-nix-flakes) on Flakes Usage - -# Footnotes - -[^1]: diff --git a/site/content/blog/nix.md b/site/content/blog/nix.md @@ -1,6 +1,6 @@ +++ -title = "What is Nix?" -description = "An Introductory Article about the Nix Ecosystem" +title = "The Nix Cheat Sheet" +description = "A Handy Rubric for the Nix Ecosystem" date = 2022-02-20 [taxonomies] @@ -25,90 +25,17 @@ This Page is still under heavy development and may remain unfinished or subjecte [**`nixpkgs`**](https://github.com/nixos/nixpkgs), basically the main _package repository_ to use with Nix, is a giant collection of package descriptions as well as configuration modules written in the Nix language, that serves to build multiple applications for our day-to-day use, as well as the tools required to properly define a NixOS Configuration. It provides a vast number of applications, programs and services, language-specific package sets, cross-compilation tools, and many other such packages, which makes Nix such a powerful tool -The Nix **programming language** is simple, _lazy_ (which means evaluation of expressions is delayed until their values are actually needed), pure, functional, and dynamically typed, which specializes in building packages - -# Language Basics - -`nix repl` is a simple CLI tool for playing around with the Nix language. It is advisable to use it in order to completely understand all the quirks of the syntax - -## Types - -Nix supports the basic `+`, `-`, `*` and `/` arithmetic operations (although using `/` with single space converts a string to a path) -Other operators are: _Booleans_ - `||`, `&&` and `!`, _Relationals_ - `!=`, `==`, `<`, `>`, `<=`, `>=`. -It has _integer_, _floating point_, _string_, _path_, _boolean_ and `null` simple types. Then there are also lists, sets and functions -Nix is **_strongly typed_**, strings and integers must be _converted_ to be mixed together and used - -#### Strings - -They are enclosed in either `""` for a single line or `''` for multiple lines. It is also possible to **_interpolate_** Nix expressions using `${ ... }` (which can also be escaped using `''$`) - -#### Lists - -Sequence of expressions delimited by space. Ex - `[ "1" "2" true var ]` - -#### Attribute Sets - -They are association between string keys (Unquoted identifiers can also be used) and Nix Values. Ex - `{ a = "foo"; "a-b" = "bar"; }`. Members can be accessed using the `.` operator. **_Recursive_** Sets are created using the `rec` keyword which allows members of the `attrset` to be referenced by the other elements. For example, when `msg = rec { hi = "Hello"; world = hi + "World!"}`, `msg.world` equals `"HelloWorld!"` - -## Expressions - -**_if_** **Expression:** Conditional used for evaluation. Ex - `if 7 > 3 then "yes" else "no"` evaluates to `"yes"` - -**_let_** **Expression:** Allows for definition of local variables to be used in inner elements (recursively). Ex - `let a = 7; in a + 3` evaluates to `10`. The same variable cannot be assigned twice - -## Functions - -Functions are of two types. The first makes use of positional parameters. A simple function `add = x: y: x + y`, when called using `add 7 3`, will return `10`. Such a function has to be called with exactly the same number of arguments as explicitly defined, or will return an error. The second type of functions allows more complex substitutions. For example, when `add = { x ? 7, y }: x + y` is called using `add { y = 3; }`, it will still return 10, as `?` allows you to specify the default value when the argument isn't provided - -## Derivation - -Given below is an simple Nix derivation, just as an example: - -```nix -{ lib, pkgs, ... }: -with pkgs; -stdenv.mkDerivation rec { - pname = "Dotfiles"; - version = "v7.0"; - longVersion = "20220318"; - - src = fetchFromGitHub - { - owner = "maydayv7"; - repo = "dotfiles"; - sha256 = lib.fakeSha256; - rev = version; - }; - - dontBuild = true; - buildInputs = [ coreutils ]; - installPhase = "mkdir -p $out/ && cp -r . $out/"; - - meta = with lib; { - description = "My PC Dotfiles"; - homepage = "https://github.com/maydayv7/dotfiles"; - license = licenses.mit; - platform = platforms.all; - maintainers = [ "maydayv7" ]; - }; -} -``` - -Let us inspect it line by line - -1. `{ lib, pkgs, ... }`: `lib` refers to the cores set of library functions provided by `nixpkgs` which act as tools to perform a number of package management functions using Nix. `pkgs` refers to all the other packages already present in `nixpkgs` which may be used as dependencies by the program to be built -2. `with` is a keyword that allows us to directly call the members of an `attrset` without prefixing it's name multiple times. For example, instead of using `pkgs.fetchFromGitHub` or `pkgs.coreutils` (later in the file), we can directly reference using their names -3. `stdenv` is a standard derivation which serves as base for packaging software. It is used to pull in dependencies and basic tools needed to compile the program. `mkDerivation` is a wrapper around the raw derivation function which pulls in the `stdenv` for us, and runs a generic `make` builder -4. `src` specifies the root source tree from which the program is to be built. `fetchFromGitHub` is a convenience function used to specify a GitHub repository as the source +The Nix **programming language** is simple, _lazy_ (which means evaluation of expressions is delayed until their values are actually needed), pure, functional, and dynamically typed, which specializes in building packages. The Nix [Pills](https://nixos.org/guides/nix-pills/) Tutorial dives into the language syntax and semantics in detail # Resources Below is a list of handy, helpful resources and documentation that can be used to learn more about the Nix ecosystem in depth: - Official [Documentation](https://nixos.org/learn.html) and the NixOS [Manual](https://nixos.org/manual/nixpkgs/stable) -- The Nix [Pills](https://nixos.org/guides/nix-pills/) Tutorial - Serokell's [Blog](https://serokell.io/blog/what-is-nix) introducing Nix - Justin's [Notes](https://github.com/justinwoo/nix-shorts) on using Nix +- Tweag [Article](https://www.tweag.io/blog/2020-05-25-flakes/) introducing Flakes +- Serokell's [Blog](https://serokell.io/blog/practical-nix-flakes) on Flakes Usage # Footnotes diff --git a/site/content/now.md b/site/content/now.md @@ -1,6 +1,6 @@ +++ title = "Now" -description = "What I'm currently up to" +description = "What I'm currently up to!" +++ This page is inspired by [NowNowNow](https://nownownow.com) @@ -8,8 +8,8 @@ This page is inspired by [NowNowNow](https://nownownow.com) - Playing around with Nix(OS) - Creating this (beautiful) Website - Studying for my upcoming Exams -- Binge-watching films +- Binge-watching anime Nothing much else really! ;) -> Last Updated: **March** 2022 +> Last Updated: **April** 2022