├── .gitignore ├── LICENSE ├── README.md ├── flake.lock ├── flake.nix └── templates ├── empty └── flake.nix ├── home ├── flake.nix └── homes │ └── x86_64-linux │ └── user@system │ └── default.nix ├── lib ├── flake.nix └── lib │ ├── default.nix │ └── example │ └── default.nix ├── module ├── flake.nix └── modules │ └── nixos │ └── snowfall │ └── default.nix ├── package ├── flake.nix └── packages │ └── my-package │ └── default.nix └── system ├── flake.nix ├── homes └── x86_64-linux │ └── user@example │ └── default.nix ├── modules └── nixos │ └── snowfall │ └── default.nix └── systems └── x86_64-linux └── example ├── default.nix └── hardware.nix /.gitignore: -------------------------------------------------------------------------------- 1 | ./**/flake.lock 2 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | 3 | Version 2.0, January 2004 4 | 5 | http://www.apache.org/licenses/ TERMS 6 | AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 7 | 8 | 1. Definitions. 9 | 10 | "License" shall mean the terms and conditions for use, reproduction, and 11 | distribution as defined by Sections 1 through 9 of this document. 12 | 13 | "Licensor" shall mean the copyright owner or entity authorized by the copyright 14 | owner that is granting the License. 15 | 16 | "Legal Entity" shall mean the 17 | union of the acting entity and all other entities that control, are controlled 18 | by, or are under common control with that entity. For the purposes of this 19 | definition, "control" means (i) the power, direct or indirect, to cause the 20 | direction or management of such entity, whether by contract or otherwise, or (ii) 21 | ownership of fifty percent (50%) or more of the outstanding shares, or (iii) 22 | beneficial ownership of such entity. 23 | 24 | "You" (or "Your") shall mean 25 | an individual or Legal Entity exercising permissions granted by this License. 26 | 27 | "Source" form shall mean the preferred form for making modifications, 28 | including but not limited to software source code, documentation source, and 29 | configuration files. 30 | 31 | "Object" form shall mean any form resulting 32 | from mechanical transformation or translation of a Source form, including but not 33 | limited to compiled object code, generated documentation, and conversions to 34 | other media types. 35 | 36 | "Work" shall mean the work of authorship, 37 | whether in Source or Object form, made available under the License, as indicated 38 | by a copyright notice that is included in or attached to the work (an example is 39 | provided in the Appendix below). 40 | 41 | "Derivative Works" shall mean any 42 | work, whether in Source or Object form, that is based on (or derived from) the 43 | Work and for which the editorial revisions, annotations, elaborations, or other 44 | modifications represent, as a whole, an original work of authorship. For the 45 | purposes of this License, Derivative Works shall not include works that remain 46 | separable from, or merely link (or bind by name) to the interfaces of, the Work 47 | and Derivative Works thereof. 48 | 49 | "Contribution" shall mean any work 50 | of authorship, including the original version of the Work and any modifications 51 | or additions to that Work or Derivative Works thereof, that is intentionally 52 | submitted to Licensor for inclusion in the Work by the copyright owner or by an 53 | individual or Legal Entity authorized to submit on behalf of the copyright owner. 54 | For the purposes of this definition, "submitted" means any form of electronic, 55 | verbal, or written communication sent to the Licensor or its representatives, 56 | including but not limited to communication on electronic mailing lists, source 57 | code control systems, and issue tracking systems that are managed by, or on 58 | behalf of, the Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise designated in 60 | writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of 63 | whom a Contribution has been received by Licensor and subsequently incorporated 64 | within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and 67 | conditions of this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license 69 | to reproduce, prepare Derivative Works of, publicly display, publicly perform, 70 | sublicense, and distribute the Work and such Derivative Works in Source or Object 71 | form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of this 74 | License, each Contributor hereby grants to You a perpetual, worldwide, 75 | non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this 76 | section) patent license to make, have made, use, offer to sell, sell, import, and 77 | otherwise transfer the Work, where such license applies only to those patent 78 | claims licensable by such Contributor that are necessarily infringed by their 79 | Contribution(s) alone or by combination of their Contribution(s) with the Work to 80 | which such Contribution(s) was submitted. If You institute patent litigation 81 | against any entity (including a cross-claim or counterclaim in a lawsuit) 82 | alleging that the Work or a Contribution incorporated within the Work constitutes 83 | direct or contributory patent infringement, then any patent licenses granted to 84 | You under this License for that Work shall terminate as of the date such 85 | litigation is filed. 86 | 87 | 4. Redistribution. You may reproduce and distribute 88 | copies of the Work or Derivative Works thereof in any medium, with or without 89 | modifications, and in Source or Object form, provided that You meet the following 90 | conditions: 91 | 92 | (a) You must give any other recipients of the Work or 93 | Derivative Works a copy of this License; and 94 | 95 | (b) You must cause any 96 | modified files to carry prominent notices stating that You changed the files; 97 | and 98 | 99 | (c) You must retain, in the Source form of any Derivative Works that 100 | You distribute, all copyright, patent, trademark, and attribution notices from 101 | the Source form of the Work, excluding those notices that do not pertain to any 102 | part of the Derivative Works; and 103 | 104 | (d) If the Work includes a "NOTICE" text 105 | file as part of its distribution, then any Derivative Works that You distribute 106 | must include a readable copy of the attribution notices contained within such 107 | NOTICE file, excluding those notices that do not pertain to any part of the 108 | Derivative Works, in at least one of the following places: within a NOTICE text 109 | file distributed as part of the Derivative Works; within the Source form or 110 | documentation, if provided along with the Derivative Works; or, within a display 111 | generated by the Derivative Works, if and wherever such third-party notices 112 | normally appear. The contents of the NOTICE file are for informational purposes 113 | only and do not modify the License. You may add Your own attribution notices 114 | within Derivative Works that You distribute, alongside or as an addendum to the 115 | NOTICE text from the Work, provided that such additional attribution notices 116 | cannot be construed as modifying the License. 117 | 118 | You may add Your own 119 | copyright statement to Your modifications and may provide additional or different 120 | license terms and conditions for use, reproduction, or distribution of Your 121 | modifications, or for any such Derivative Works as a whole, provided Your use, 122 | reproduction, and distribution of the Work otherwise complies with the conditions 123 | stated in this License. 124 | 125 | 5. Submission of Contributions. Unless You explicitly 126 | state otherwise, any Contribution intentionally submitted for inclusion in the 127 | Work by You to the Licensor shall be under the terms and conditions of this 128 | License, without any additional terms or conditions. Notwithstanding the above, 129 | nothing herein shall supersede or modify the terms of any separate license 130 | agreement you may have executed with Licensor regarding such Contributions. 131 | 132 | 6. Trademarks. This License does not grant permission to use the trade names, 133 | trademarks, service marks, or product names of the Licensor, except as required 134 | for reasonable and customary use in describing the origin of the Work and 135 | reproducing the content of the NOTICE file. 136 | 137 | 7. Disclaimer of Warranty. Unless 138 | required by applicable law or agreed to in writing, Licensor provides the Work 139 | (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT 140 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, 141 | without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, 142 | MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible 143 | for determining the appropriateness of using or redistributing the Work and 144 | assume any risks associated with Your exercise of permissions under this 145 | License. 146 | 147 | 8. Limitation of Liability. In no event and under no legal theory, 148 | whether in tort (including negligence), contract, or otherwise, unless required 149 | by applicable law (such as deliberate and grossly negligent acts) or agreed to in 150 | writing, shall any Contributor be liable to You for damages, including any 151 | direct, indirect, special, incidental, or consequential damages of any character 152 | arising as a result of this License or out of the use or inability to use the 153 | Work (including but not limited to damages for loss of goodwill, work stoppage, 154 | computer failure or malfunction, or any and all other commercial damages or 155 | losses), even if such Contributor has been advised of the possibility of such 156 | damages. 157 | 158 | 9. Accepting Warranty or Additional Liability. While redistributing 159 | the Work or Derivative Works thereof, You may choose to offer, and charge a fee 160 | for, acceptance of support, warranty, indemnity, or other liability obligations 161 | and/or rights consistent with this License. However, in accepting such 162 | obligations, You may act only on Your own behalf and on Your sole responsibility, 163 | not on behalf of any other Contributor, and only if You agree to indemnify, 164 | defend, and hold each Contributor harmless for any liability incurred by, or 165 | claims asserted against, such Contributor by reason of your accepting any such 166 | warranty or additional liability. END OF TERMS AND CONDITIONS 167 | 168 | APPENDIX: How to apply the Apache License to your work. 169 | 170 | To apply the Apache License to your work, 171 | attach the following boilerplate notice, with the fields enclosed by brackets 172 | "[]" replaced with your own identifying information. (Don't include the 173 | brackets!) The text should be enclosed in the appropriate comment syntax for the 174 | file format. We also recommend that a file or class name and description of 175 | purpose be included on the same "printed page" as the copyright notice for easier 176 | identification within third-party archives. 177 | 178 | Copyright 2023 Jake Hamilton 179 | 180 | Licensed under the Apache License, Version 2.0 (the "License"); 181 | you may not use this file except in compliance with the License. 182 | 183 | You may obtain a copy of the License at 184 | 185 | http://www.apache.org/licenses/LICENSE-2.0 186 | 187 | Unless required by applicable law or agreed to in writing, software 188 | distributed under the License is distributed on an "AS IS" BASIS, 189 | 190 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 191 | 192 | See the License for the specific language governing permissions and 193 | limitations under the License. 194 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Snowfall Templates 2 | 3 | 4 | Nix Flakes Ready 5 | 6 | 7 | Built With Snowfall 8 | 9 | 10 |

11 | 15 |    16 |

17 | 18 | > Create new flakes for use with [@snowfallorg/lib](https://github.com/snowfallorg/lib). 19 | 20 | ## Usage 21 | 22 | Run the following command, replacing `` with one of the [available templates](#available-templates). 23 | 24 | ```bash 25 | nix flake init -t github:snowfallorg/templates# 26 | ``` 27 | 28 | ## Available Templates 29 | 30 | | Name | Description | 31 | | --------- | ------------------------------------------------- | 32 | | `empty` | A NixOS system and modules ready to modify. | 33 | | `home` | A Nix Flake that exports home manager. | 34 | | `system` | A NixOS system and modules ready to modify. | 35 | | `package` | A Nix Flake that exports packages and an overlay. | 36 | | `module` | A Nix Flake that exports NixOS modules. | 37 | | `lib` | A Nix Flake that exports a custom `lib` | 38 | -------------------------------------------------------------------------------- /flake.lock: -------------------------------------------------------------------------------- 1 | { 2 | "nodes": { 3 | "flake-compat": { 4 | "flake": false, 5 | "locked": { 6 | "lastModified": 1650374568, 7 | "narHash": "sha256-Z+s0J8/r907g149rllvwhb4pKi8Wam5ij0st8PwAh+E=", 8 | "owner": "edolstra", 9 | "repo": "flake-compat", 10 | "rev": "b4a34015c698c7793d592d66adbab377907a2be8", 11 | "type": "github" 12 | }, 13 | "original": { 14 | "owner": "edolstra", 15 | "repo": "flake-compat", 16 | "type": "github" 17 | } 18 | }, 19 | "flake-utils": { 20 | "inputs": { 21 | "systems": "systems" 22 | }, 23 | "locked": { 24 | "lastModified": 1694529238, 25 | "narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=", 26 | "owner": "numtide", 27 | "repo": "flake-utils", 28 | "rev": "ff7b65b44d01cf9ba6a71320833626af21126384", 29 | "type": "github" 30 | }, 31 | "original": { 32 | "owner": "numtide", 33 | "repo": "flake-utils", 34 | "type": "github" 35 | } 36 | }, 37 | "flake-utils-plus": { 38 | "inputs": { 39 | "flake-utils": "flake-utils" 40 | }, 41 | "locked": { 42 | "lastModified": 1715533576, 43 | "narHash": "sha256-fT4ppWeCJ0uR300EH3i7kmgRZnAVxrH+XtK09jQWihk=", 44 | "owner": "gytis-ivaskevicius", 45 | "repo": "flake-utils-plus", 46 | "rev": "3542fe9126dc492e53ddd252bb0260fe035f2c0f", 47 | "type": "github" 48 | }, 49 | "original": { 50 | "owner": "gytis-ivaskevicius", 51 | "repo": "flake-utils-plus", 52 | "rev": "3542fe9126dc492e53ddd252bb0260fe035f2c0f", 53 | "type": "github" 54 | } 55 | }, 56 | "nixpkgs": { 57 | "locked": { 58 | "lastModified": 1716218643, 59 | "narHash": "sha256-i/E7gzQybvcGAYDRGDl39WL6yVk30Je/NXypBz6/nmM=", 60 | "owner": "nixos", 61 | "repo": "nixpkgs", 62 | "rev": "a8695cbd09a7ecf3376bd62c798b9864d20f86ee", 63 | "type": "github" 64 | }, 65 | "original": { 66 | "owner": "nixos", 67 | "ref": "nixos-23.11", 68 | "repo": "nixpkgs", 69 | "type": "github" 70 | } 71 | }, 72 | "root": { 73 | "inputs": { 74 | "nixpkgs": "nixpkgs", 75 | "snowfall-lib": "snowfall-lib" 76 | } 77 | }, 78 | "snowfall-lib": { 79 | "inputs": { 80 | "flake-compat": "flake-compat", 81 | "flake-utils-plus": "flake-utils-plus", 82 | "nixpkgs": [ 83 | "nixpkgs" 84 | ] 85 | }, 86 | "locked": { 87 | "lastModified": 1716675292, 88 | "narHash": "sha256-7TFvVE4HR/b65/0AAhewYHEJzUXxIEJn82ow5bCkrDo=", 89 | "owner": "snowfallorg", 90 | "repo": "lib", 91 | "rev": "5d6e9f235735393c28e1145bec919610b172a20f", 92 | "type": "github" 93 | }, 94 | "original": { 95 | "owner": "snowfallorg", 96 | "ref": "v3.0.2", 97 | "repo": "lib", 98 | "type": "github" 99 | } 100 | }, 101 | "systems": { 102 | "locked": { 103 | "lastModified": 1681028828, 104 | "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", 105 | "owner": "nix-systems", 106 | "repo": "default", 107 | "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", 108 | "type": "github" 109 | }, 110 | "original": { 111 | "owner": "nix-systems", 112 | "repo": "default", 113 | "type": "github" 114 | } 115 | } 116 | }, 117 | "root": "root", 118 | "version": 7 119 | } 120 | -------------------------------------------------------------------------------- /flake.nix: -------------------------------------------------------------------------------- 1 | { 2 | description = "Snowfall Templates"; 3 | 4 | inputs = { 5 | nixpkgs.url = "github:nixos/nixpkgs/nixos-23.11"; 6 | 7 | snowfall-lib = { 8 | url = "github:snowfallorg/lib?ref=v3.0.2"; 9 | inputs.nixpkgs.follows = "nixpkgs"; 10 | }; 11 | }; 12 | 13 | outputs = inputs: 14 | inputs.snowfall-lib.mkFlake { 15 | inherit inputs; 16 | src = ./.; 17 | 18 | alias.templates.default = "empty"; 19 | 20 | templates = rec { 21 | empty = { 22 | description = "A Nix Flake using snowfall-lib"; 23 | }; 24 | 25 | system = { 26 | description = "A Nix flake with a NixOS system and modules ready to modify."; 27 | }; 28 | 29 | package = { 30 | description = "A Nix Flake that exports packages and an overlay."; 31 | }; 32 | 33 | module = { 34 | description = "A Nix Flake that exports NixOS modules."; 35 | }; 36 | 37 | lib = { 38 | description = "A Nix Flake that exports a custom lib."; 39 | }; 40 | 41 | home = { 42 | description = "A Nix Flake that exports home manager."; 43 | }; 44 | }; 45 | }; 46 | } 47 | -------------------------------------------------------------------------------- /templates/empty/flake.nix: -------------------------------------------------------------------------------- 1 | { 2 | description = "My Nix flake"; 3 | 4 | inputs = { 5 | nixpkgs.url = "github:nixos/nixpkgs/nixos-23.11"; 6 | unstable.url = "github:nixos/nixpkgs/nixos-unstable"; 7 | 8 | snowfall-lib = { 9 | url = "github:snowfallorg/lib"; 10 | inputs.nixpkgs.follows = "nixpkgs"; 11 | }; 12 | }; 13 | 14 | outputs = inputs: 15 | inputs.snowfall-lib.mkFlake { 16 | inherit inputs; 17 | 18 | src = ./.; 19 | }; 20 | } 21 | -------------------------------------------------------------------------------- /templates/home/flake.nix: -------------------------------------------------------------------------------- 1 | { 2 | description = "My Home Manager flake"; 3 | 4 | inputs = { 5 | nixpkgs.url = "github:nixos/nixpkgs/nixos-23.11"; 6 | unstable.url = "github:nixos/nixpkgs/nixos-unstable"; 7 | 8 | home-manager = { 9 | url = "github:nix-community/home-manager/release-23.11"; 10 | inputs.nixpkgs.follows = "nixpkgs"; 11 | }; 12 | 13 | snowfall-lib = { 14 | url = "github:snowfallorg/lib"; 15 | inputs.nixpkgs.follows = "nixpkgs"; 16 | }; 17 | }; 18 | 19 | outputs = inputs: 20 | inputs.snowfall-lib.mkFlake { 21 | inherit inputs; 22 | 23 | src = ./.; 24 | }; 25 | } 26 | -------------------------------------------------------------------------------- /templates/home/homes/x86_64-linux/user@system/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | lib, 3 | pkgs, 4 | config, 5 | ... 6 | }: 7 | # User information gathered by Snowfall Lib is available. 8 | let 9 | name = config.snowfallorg.user.name; 10 | home = config.snowfallorg.user.home.directory; 11 | in { 12 | home = { 13 | packages = with pkgs; [ 14 | neovim 15 | firefox 16 | ]; 17 | 18 | sessionVariables = { 19 | EDITOR = "nvim"; 20 | }; 21 | 22 | shellAliases = { 23 | vimdiff = "nvim -d"; 24 | }; 25 | 26 | stateVersion = "23.11"; 27 | }; 28 | } 29 | -------------------------------------------------------------------------------- /templates/lib/flake.nix: -------------------------------------------------------------------------------- 1 | { 2 | description = "My Nix library"; 3 | 4 | inputs = { 5 | nixpkgs.url = "github:nixos/nixpkgs/nixos-23.11"; 6 | unstable.url = "github:nixos/nixpkgs/nixos-unstable"; 7 | 8 | snowfall-lib = { 9 | url = "github:snowfallorg/lib"; 10 | inputs.nixpkgs.follows = "nixpkgs"; 11 | }; 12 | }; 13 | 14 | outputs = inputs: 15 | inputs.snowfall-lib.mkFlake { 16 | inherit inputs; 17 | 18 | src = ./.; 19 | }; 20 | } 21 | -------------------------------------------------------------------------------- /templates/lib/lib/default.nix: -------------------------------------------------------------------------------- 1 | { inputs 2 | , snowfall-inputs 3 | , lib 4 | }: 5 | 6 | { 7 | # This attribute will be available as `lib.hello-root`. 8 | hello-root = "Hello, Root"; 9 | } 10 | -------------------------------------------------------------------------------- /templates/lib/lib/example/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | inputs, 3 | snowfall-inputs, 4 | lib, 5 | }: { 6 | example = { 7 | # This attribute will be available as `lib..example.hello-example`. 8 | hello-example = "Hello, Example"; 9 | }; 10 | } 11 | -------------------------------------------------------------------------------- /templates/module/flake.nix: -------------------------------------------------------------------------------- 1 | { 2 | description = "My NixOS modules"; 3 | 4 | inputs = { 5 | nixpkgs.url = "github:nixos/nixpkgs/nixos-23.11"; 6 | unstable.url = "github:nixos/nixpkgs/nixos-unstable"; 7 | 8 | snowfall-lib = { 9 | url = "github:snowfallorg/lib"; 10 | inputs.nixpkgs.follows = "nixpkgs"; 11 | }; 12 | }; 13 | 14 | outputs = inputs: 15 | inputs.snowfall-lib.mkFlake { 16 | inherit inputs; 17 | 18 | src = ./.; 19 | }; 20 | } 21 | -------------------------------------------------------------------------------- /templates/module/modules/nixos/snowfall/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | lib, 3 | config, 4 | ... 5 | }: let 6 | cfg = config.snowfallorg.example; 7 | in { 8 | options.snowfallorg.example = { 9 | enable = lib.mkEnableOption "Snowfall Example"; 10 | }; 11 | 12 | config = lib.mkIf cfg.enable { 13 | environment.variables = { 14 | SNOWFALLORG_EXAMPLE = "enabled"; 15 | }; 16 | }; 17 | } 18 | -------------------------------------------------------------------------------- /templates/package/flake.nix: -------------------------------------------------------------------------------- 1 | { 2 | description = "My Nix packages"; 3 | 4 | inputs = { 5 | nixpkgs.url = "github:nixos/nixpkgs/nixos-23.11"; 6 | unstable.url = "github:nixos/nixpkgs/nixos-unstable"; 7 | 8 | snowfall-lib = { 9 | url = "github:snowfallorg/lib"; 10 | inputs.nixpkgs.follows = "nixpkgs"; 11 | }; 12 | }; 13 | 14 | outputs = inputs: 15 | inputs.snowfall-lib.mkFlake { 16 | inherit inputs; 17 | 18 | src = ./.; 19 | }; 20 | } 21 | -------------------------------------------------------------------------------- /templates/package/packages/my-package/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | lib, 3 | writeScriptBin, 4 | ... 5 | }: 6 | writeScriptBin 7 | "my-package" 8 | '' 9 | echo Hello from my-package! 10 | '' 11 | -------------------------------------------------------------------------------- /templates/system/flake.nix: -------------------------------------------------------------------------------- 1 | { 2 | description = "My NixOS / nix-darwin / nixos-generators systems"; 3 | 4 | inputs = { 5 | nixpkgs.url = "github:nixos/nixpkgs/nixos-23.11"; 6 | unstable.url = "github:nixos/nixpkgs/nixos-unstable"; 7 | 8 | home-manager = { 9 | url = "github:nix-community/home-manager/release-23.11"; 10 | inputs.nixpkgs.follows = "nixpkgs"; 11 | }; 12 | 13 | snowfall-lib = { 14 | url = "github:snowfallorg/lib"; 15 | inputs.nixpkgs.follows = "nixpkgs"; 16 | }; 17 | }; 18 | 19 | outputs = inputs: 20 | inputs.snowfall-lib.mkFlake { 21 | inherit inputs; 22 | 23 | src = ./.; 24 | }; 25 | } 26 | -------------------------------------------------------------------------------- /templates/system/homes/x86_64-linux/user@example/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | lib, 3 | pkgs, 4 | config, 5 | ... 6 | }: 7 | # User information gathered by Snowfall Lib is available. 8 | let 9 | name = config.snowfallorg.user.name; 10 | home = config.snowfallorg.user.home.directory; 11 | in { 12 | home = { 13 | packages = with pkgs; [ 14 | neovim 15 | firefox 16 | ]; 17 | 18 | sessionVariables = { 19 | EDITOR = "nvim"; 20 | }; 21 | 22 | shellAliases = { 23 | vimdiff = "nvim -d"; 24 | }; 25 | 26 | stateVersion = "23.11"; 27 | }; 28 | } 29 | -------------------------------------------------------------------------------- /templates/system/modules/nixos/snowfall/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | lib, 3 | config, 4 | ... 5 | }: let 6 | cfg = config.snowfallorg.example; 7 | in { 8 | options.snowfallorg.example = { 9 | enable = lib.mkEnableOption "Snowfall Example"; 10 | }; 11 | 12 | config = lib.mkIf cfg.enable { 13 | environment.variables = { 14 | SNOWFALLORG_EXAMPLE = "enabled"; 15 | }; 16 | }; 17 | } 18 | -------------------------------------------------------------------------------- /templates/system/systems/x86_64-linux/example/default.nix: -------------------------------------------------------------------------------- 1 | {pkgs, ...}: { 2 | imports = [./hardware.nix]; 3 | 4 | boot.loader.systemd-boot.enable = true; 5 | boot.loader.efi.canTouchEfiVariables = true; 6 | 7 | users.users.example = { 8 | isNormalUser = true; 9 | extraGroups = ["wheel"]; 10 | }; 11 | 12 | environment.systemPackages = with pkgs; [ 13 | neovim 14 | firefox 15 | ]; 16 | 17 | # Configure Home-Manager options from NixOS. 18 | snowfallorg.user.example.home.config = {}; 19 | 20 | system.stateVersion = "23.11"; 21 | } 22 | -------------------------------------------------------------------------------- /templates/system/systems/x86_64-linux/example/hardware.nix: -------------------------------------------------------------------------------- 1 | {modulesPath, ...}: { 2 | imports = [ 3 | (modulesPath + "/installer/scan/not-detected.nix") 4 | ]; 5 | 6 | fileSystems."/" = { 7 | device = "/dev/disk/by-label/nixos"; 8 | fsType = "ext4"; 9 | }; 10 | 11 | fileSystems."/boot" = { 12 | device = "/dev/disk/by-label/nixos"; 13 | fsType = "vfat"; 14 | }; 15 | 16 | swapDevices = [ 17 | {device = "/dev/disk/by-label/swap";} 18 | ]; 19 | 20 | networking.useDHCP = true; 21 | } 22 | --------------------------------------------------------------------------------